MCPcopy Create free account

hub / github.com/bojieli/ai-agent-book / functions

Functions13,003 in github.com/bojieli/ai-agent-book

↓ 2 callersFunctionsingle_query
针对单条查询,离线对比 plain 与 contextual 两种索引下的 Top-K 检索结果。
chapter3/contextual-retrieval-for-user-memory/contextual_compare.py:194
↓ 2 callersFunctionslide
(options, body, cue)
slides/generate.mjs:52
↓ 2 callersFunctionslide
(body, { layout, className, cue } = {})
slides/chapter1-pilot.mjs:9
↓ 2 callersFunctionslideCount
(lesson)
slides/review.mjs:35
↓ 2 callersFunctionsnapshot
(repo: Path)
chapter7/model-action-threshold/experiment.py:181
↓ 2 callersMethodsnapshot
(self)
chapter7/android-world/run_controlled_experiment.py:727
↓ 2 callersMethodsnapshot_candidates
Capture candidate states before an operation.
chapter5/permission-embedded-data-objects/pedo/eval/benchmark_safety_v2.py:94
↓ 2 callersFunctionsnapshot_manager
()
chapter10/book-translation/agents.py:491
↓ 2 callersFunctionsourceEdition
(path = '')
web-astro/src/lib/edition-source.mjs:3
↓ 2 callersFunctionsourceLabels
(source, figure)
web-astro/scripts/evaluation-spectrum-figures.mjs:14
↓ 2 callersFunctionspawn_subagent
Create a sub-agent to handle a delegated task. Args: task: The sub-task for the sub-agent. context_strategy: "minimal" or "llm_ge
chapter4/collaboration-tools/src/subagent_tools.py:361
↓ 2 callersFunctionsplit_summary
(split: str)
chapter8/prompt-distillation/run_experiment_8_8.py:306
↓ 2 callersFunctionsplit_translation_units
Create bounded chapter parts while retaining an exact reassembly map.
chapter10/book-translation/run_official_experiment.py:79
↓ 2 callersFunctionstackedCard
(k, ids, x, y, width, options = {})
web-astro/scripts/voice-architecture-layout.mjs:91
↓ 2 callersFunctionstageNumber
(number, x, y)
web-astro/scripts/training-workflows-figures.mjs:62
↓ 2 callersMethodstart_monitoring
Start system monitoring
chapter6/agent-with-event-trigger/client.py:95
↓ 2 callersFunctionstatus_message
()
chapter2/attention_visualization/run_status_bar_experiment.py:149
↓ 2 callersMethodstep
Execute one step of the task
chapter9/browser-use-rpa/browser-use/browser_use/agent/service.py:646
↓ 2 callersMethodstop
(self)
chapter6/agent-with-event-trigger/event_loop_demo.py:67
↓ 2 callersMethodstop
Stop the vLLM server
chapter2/local_llm_serving/server.py:132
↓ 2 callersFunctionstream_process
(command: list[str], workspace: Path, env: dict, stream_path: Path, stderr_path: Path, tag:
chapter2/agent-skills-ppt/run_official_experiment.py:106
↓ 2 callersFunctionstub_client
()
chapter3/user-memory/test_stream_empty_choices.py:25
↓ 2 callersFunctionsum_currency_costs
( records: Iterable[RunRecord], attribute: str = "cost_by_currency", )
chapter7/user-memory-system-evaluation/experiment.py:1221
↓ 2 callersMethodsummarize_output
Summarize complex tool output. Args: tool_name: Name of the tool that produced the output output: Th
chapter4/execution-tools/llm_helper.py:169
↓ 2 callersMethodsummarize_text
Summarize text using OpenAI API.
chapter3/structured-index/raptor_indexer.py:81
↓ 2 callersFunctionsummarize_workloads
(rows: Sequence[dict[str, Any]])
chapter7/model-benchmark/analysis.py:71
↓ 2 callersMethodsupports_dp
(self, dp: Datapoint)
chapter2/prompt-engineering/tau_bench/model_utils/model/model.py:48
↓ 2 callersFunctionsvg_text
(locale: str, chapter: int, figure: int)
tests/test_i18n_figure_placement.py:57
↓ 2 callersMethodsyncChatHistory
()
chapter6/live-audio/backend/server.js:1006
↓ 2 callersFunctionsyncMenuState
(conf)
extras/auto-translate.js:376
↓ 2 callersMethodsync_to_disk
(self, path: Path)
chapter9/browser-use-rpa/browser-use/browser_use/filesystem/file_system.py:54
↓ 2 callersMethodsynthesize
(self, text: str, *, sample_rate: int = 8_000)
chapter6/phone-agent/speech.py:87
↓ 2 callersMethodsynthesize
(self, text: str)
chapter10/autonomous-phone-registration/webrtc_channel.py:226
↓ 2 callersMethodsystem_prompt
(self)
chapter2/prompt-injection/agent.py:119
↓ 2 callersFunctiontag
(element, attributes)
web-astro/scripts/evaluation-overview-figures.mjs:63
↓ 2 callersFunctiontag
(element, attributes)
web-astro/scripts/async-architecture-layout.mjs:62
↓ 2 callersFunctiontask_prompt
(task: str, text: str)
chapter2/prompt-engineering/tau_bench/model_utils/model/completion.py:41
↓ 2 callersFunctiontemplate_payload
()
chapter5/agent-creator/test_creator.py:54
↓ 2 callersFunctiontextMap
()
web-astro/src/scripts/highlights.ts:68
↓ 2 callersFunctiontextNodes
(source)
web-astro/scripts/memory-foundation-layout.mjs:224
↓ 2 callersFunctiontimestamp_wrap
(features: set[str], timestamp: str, content: str)
chapter2/system-hint/run_experiment_2_8.py:294
↓ 2 callersMethodto_dict
Convert metrics to a standard dictionary representation.
chapter2/context-compression/benchmark_compression.py:48
↓ 2 callersMethodto_dict
Convert workflow to dictionary for serialization
chapter9/browser-use-rpa/learning_agent/workflow.py:180
↓ 2 callersMethodto_dict
(self)
chapter10/autonomous-phone-registration/models.py:73
↓ 2 callersMethodto_dict
Convert to dictionary for JSON serialization
chapter3/log-sanitization/metrics.py:42
↓ 2 callersMethodto_dict
(self)
chapter3/contextual-retrieval/contextual_tools.py:39
↓ 2 callersMethodto_dict
(self)
chapter3/contextual-retrieval-for-user-memory/contextual_indexer.py:42
↓ 2 callersMethodto_dict
(self)
chapter3/contextual-retrieval-for-user-memory/contextual_evaluator.py:112
↓ 2 callersMethodto_string
Get string representation of the history item
chapter9/browser-use-rpa/browser-use/browser_use/agent/message_manager/views.py:33
↓ 2 callersMethodto_user_message
Convert event to user message format for the agent
chapter6/agent-with-event-trigger/event_types.py:36
↓ 2 callersFunctiontoken_totals
(calls: Iterable[Dict[str, Any]])
chapter3/user-memory/run_evaluation.py:407
↓ 2 callersFunctiontokenize
把文本切成 BM25 词项。 - 英文单词、纯数字、以及像 ``http-403`` / ``max_buffer_size`` / ``xr-7000`` 这样的技术代码会被整体保留(连字符、下划线不切开),保证精确匹配。 - 连续 CJK 片段同时产出 jieba
chapter3/retrieval-pipeline/evaluate.py:147
↓ 2 callersFunctiontokenize
CJK 感知的轻量分词:英文/数字按词,中文按『单字 + 相邻双字』。 对相邻双字(bigram)保留位置邻接关系,避免跨片段产生虚假二元组。
chapter3/contextual-retrieval-for-user-memory/contextual_compare.py:29
↓ 2 callersMethodtokenize
(text: str)
chapter3/memory_rag_campaign.py:123
↓ 2 callersFunctiontop
(el: HTMLElement)
web-astro/src/scripts/reading-position.ts:23
↓ 2 callersFunctiontop_indices
(scores: np.ndarray, k: int)
chapter3/structured-index/campaign.py:311
↓ 2 callersMethodtranscribe
( self, pcm: bytes, *, retained_wav_path: Path | None = None )
chapter6/phone-agent/speech.py:183
↓ 2 callersMethodtranscribeAudio
* Transcribe audio using the configured ASR provider * @param {Buffer} audioBuffer - Raw audio data * @param {Object} options - Transcription op
chapter6/live-audio/backend/utils/speechToText.js:58
↓ 2 callersFunctiontransfer_tool_schema
transfer_to_agent 工具的 OpenAI schema —— 所有角色都持有它。
chapter10/multi-role-transfer/roles.py:116
↓ 2 callersFunctiontranslatePage
()
extras/auto-translate.js:131
↓ 2 callersFunctiontry_classify_recover
(s: str, decode_map: dict[str, int])
chapter2/prompt-engineering/tau_bench/model_utils/model/utils.py:132
↓ 2 callersFunctiontype_to_json_schema_string
(typ: type[T])
chapter2/prompt-engineering/tau_bench/model_utils/model/utils.py:37
↓ 2 callersMethodtype_with_custom_actions_flash_mode
Extend actions with custom actions for flash mode - memory and action fields only
chapter9/browser-use-rpa/browser-use/browser_use/agent/views.py:220
↓ 2 callersMethodtype_with_custom_actions_no_thinking
Extend actions with custom actions and exclude thinking field
chapter9/browser-use-rpa/browser-use/browser_use/agent/views.py:195
↓ 2 callersFunctionupdateNote
( db: IDBDatabase, id: string, patch: Pick<Annotation, 'note' | 'noteDraft'>, )
web-astro/src/lib/highlight-store.ts:59
↓ 2 callersFunctionupdateUndo
()
web-astro/src/scripts/highlights.ts:43
↓ 2 callersMethodupdate_attention
Store attention weights for a position (only for output tokens)
chapter2/attention_visualization/agent.py:129
↓ 2 callersFunctionupdate_config_with_click_args
Update configuration with command-line arguments.
chapter9/browser-use-rpa/browser-use/browser_use/cli.py:172
↓ 2 callersMethodupdate_experience
Store an experience for future in-context learning.
chapter1/learning-from-experience/llm_agent.py:378
↓ 2 callersFunctionurl_citations
(result: Dict[str, Any])
chapter1/search-codegen/run_experiment_1_3.py:114
↓ 2 callersFunctionusage
(response)
chapter5/adaptive-log-parser/campaign.py:91
↓ 2 callersFunctionusage_cost
(usage: dict, pricing: dict)
chapter10/staged-system-prompt/run_official_experiment.py:33
↓ 2 callersFunctionutc_now
()
chapter6/claude-computer-use-native/run_weather_task.py:40
↓ 2 callersFunctionutc_now
()
chapter2/attention_visualization/run_status_bar_experiment.py:31
↓ 2 callersFunctionutc_now
()
chapter2/system-hint/run_experiment_2_8.py:39
↓ 2 callersFunctionutc_now
()
chapter2/prompt-injection/run_campaign.py:28
↓ 2 callersFunctionvalidate
(report_path: Path)
chapter10/voice-werewolf/validate_simulator_run.py:15
↓ 2 callersMethodvalidate
校验并按需应用通用回退。 0) gpt-5.x 系列直连 OpenAI 需组织验证(且这类推理模型只接受默认温度), 因此只要设置了 OPENROUTER_API_KEY,即便同时有 OPENAI_API_KEY,也优先走 OpenRou
chapter10/staged-system-prompt/config.py:46
↓ 2 callersMethodvalidate
验证配置是否有效 Returns: bool: 配置是否有效
chapter1/web-search-agent/config.py:74
↓ 2 callersFunctionvalidateExperimentEvidence
(evidence, evidenceDir)
chapter6/live-audio/backend/experiment_validation.js:19
↓ 2 callersFunctionvalidate_agent
( root: Path, *, live_task: str | None = None, live_cases: list[dict[str, Any]] | None = None,
chapter5/agent-creator/validator.py:331
↓ 2 callersMethodvalidate_api_keys
Check which API keys are configured
chapter4/multimodal-agent/config.py:129
↓ 2 callersFunctionvalidate_clarification
( first: Dict[str, Any], second: Dict[str, Any] | None )
chapter1/search-codegen/run_experiment_1_3.py:167
↓ 2 callersFunctionvalidate_form
用 BeautifulSoup + 正则做鲁棒校验。 由于模型生成的具体标签写法不完全可控,这里采用"关键词/属性匹配"的鲁棒策略: 只要能定位到语义等价的控件即算通过,并把每一项证据打印出来。 返回 (是否全部通过, 报告字典, 脚本文本)。
chapter5/dynamic-form/demo.py:424
↓ 2 callersFunctionvalidate_manifest
(manifest: dict)
chapter10/staged-system-prompt/run_official_experiment.py:53
↓ 2 callersFunctionvalidate_readiness
(config: Dict[str, Any], readiness: Dict[str, Any])
chapter7/user-memory-system-evaluation/experiment.py:1916
↓ 2 callersFunctionvalidate_study
(study: dict[str, Any])
chapter6/controllable-tts/evaluate_audio_quality.py:359
↓ 2 callersFunctionvalidate_tool_call
Module-level entrypoint for validating a tool call against safety policy rules.
chapter9/harness-safety-gate/safety_policy_gate.py:424
↓ 2 callersFunctionvalidate_tool_protocol
(messages: list[dict])
chapter2/system-hint/run_experiment_2_8.py:432
↓ 2 callersFunctionvalidated_receipt_summary
Reject recovered checkpoints whose canonical receipt contains errors.
chapter10/generative-agents/run_campaign.py:370
↓ 2 callersFunctionvectorize
把一条抽取结果转成特征向量,并返回 known 掩码(该维是否有已知取值)。
chapter3/structured-knowledge-extraction/archetypes.py:57
↓ 2 callersFunctionvectorize
(extraction: Dict[str, Any], columns: List[str])
chapter3/structured-knowledge-extraction/campaign.py:374
↓ 2 callersFunctionverify
规则验证器:核对最终答案是否与标准答案一致。
chapter8/cot-distillation/generate_data.py:84
↓ 2 callersFunctionverify
( model: str, provider: str, response: str, messages: List[Dict[str, Any]] )
chapter2/prompt-engineering/tau_bench/envs/user.py:287
↓ 2 callersMethodverify_confirmation
Verify and consume a single-use confirmation token.
chapter9/harness-safety-gate/safety_policy_gate.py:167
↓ 2 callersFunctionverticalEdge
(kit, name, from, to, x, fromBottom, toTop, options)
web-astro/scripts/coding-application-layout.mjs:83
↓ 2 callersFunctionviewbox
(root)
book-vi/fix_svg_text_layout.py:197
↓ 2 callersMethodvirtual_desktop_execute
Drive headful Chromium through X11 keyboard events and retain pixels.
chapter4/execution-tools/extended_tools.py:139
↓ 2 callersMethodvirtual_mobile_execute
Operate a real AndroidWorld emulator through ADB inside its container.
chapter4/execution-tools/extended_tools.py:289
↓ 2 callersFunctionvisibleText
(markdown)
slides/review.mjs:75
← previousnext →2,801–2,900 of 13,003, ranked by callers