MCPcopy Create free account

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

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

↓ 4 callersFunctioncard
( x, y, width, height, { fill = palette.panel, rx = 8, dash = '', extra = '' } = {}, )
web-astro/scripts/collaboration-context-figures.mjs:69
↓ 4 callersFunctioncase_dir
(name: str)
chapter4/execution-tools/test_code_interpreter_python_runtime.py:27
↓ 4 callersMethodchat
Main chat interface with streaming support
chapter4/multimodal-agent/agent.py:843
↓ 4 callersMethodchat
Simple chat interface (wraps execute_task for compatibility) Args: message: User message stream: Whe
chapter3/user-memory/agent.py:873
↓ 4 callersMethodcheck
Check or uncheck a checkbox/radio button.
chapter9/browser-use-rpa/browser-use/browser_use/actor/element.py:526
↓ 4 callersFunctioncheck_hiring_violations
Check all integrity violations in hiring scenario.
chapter5/permission-embedded-data-objects/pedo/eval/dataguardbench/harness.py:374
↓ 4 callersFunctioncheck_transition_violation
Check if a status transition was valid.
chapter5/permission-embedded-data-objects/pedo/eval/dataguardbench/harness.py:472
↓ 4 callersMethodchoose_action
Choose an action using LLM reasoning with in-context learning.
chapter1/learning-from-experience/llm_agent.py:215
↓ 4 callersMethodchunk_conversation
Chunk a single conversation into segments Args: conversation_id: Unique conversation identifier test
chapter3/contextual-retrieval-for-user-memory/chunker.py:105
↓ 4 callersMethodchunk_document
Chunk a document with optional contextual enhancement. Educational Note: This is the core innovation - each chunk ge
chapter3/contextual-retrieval/contextual_chunking.py:121
↓ 4 callersFunctionclassify_risk
参考风险分类器:基于工具名与参数模式判定是否需要用户确认。 返回 (风险类别, 原因);风险类别为 None 表示低风险,可直接执行。 诊断阶段用它聚合失败簇;候选模块需自带等价逻辑并接受回放验证。
chapter9/harness-safety-gate/evolution.py:74
↓ 4 callersMethodcleanup
Clean up browser resources.
chapter9/browser-use-rpa/learning_agent/replay.py:66
↓ 4 callersMethodclear_working_memory
Clear working memory (short-term)
chapter3/memobase/agent.py:247
↓ 4 callersFunctionclient
构造(并缓存)OpenAI 客户端,含通用 OpenRouter 兜底。 - 有 OPENAI_API_KEY:直连;但默认模型 gpt-5.x(直连需组织实名认证)且设置了 OPENROUTER_API_KEY 时优先走 OpenRouter。 - 无 OPENAI_
chapter5/video-edit/agents.py:53
↓ 4 callersMethodclient
(self)
chapter7/model-benchmark/campaign.py:151
↓ 4 callersMethodclose
Close the HTTP client and cleanup any active sessions.
chapter9/browser-use-rpa/browser-use/browser_use/browser/cloud.py:215
↓ 4 callersFunctioncode
(ids)
web-astro/scripts/computer-use-layout.mjs:5
↓ 4 callersFunctioncompute_bradley_terry_leaderboard
Compute leaderboard using Bradley-Terry model (official Chatbot Arena method). Args: df: DataFrame with columns 'model_a', 'mode
chapter7/elo-leaderboard/bradley_terry.py:205
↓ 4 callersFunctioncompute_metrics
对一组输出计算 boundary/retention 两组指标。
chapter8/premature-completion-dpo/evaluate.py:85
↓ 4 callersMethodcompute_ndcg_at_k
NDCG@k with binary relevance (matches ``evaluate.ndcg_at_k``). Gain per relevant hit at rank ``i`` (1-indexed) is ``1 / log2(i + 1)``;
chapter3/retrieval-pipeline/stage_evaluator.py:193
↓ 4 callersMethodcompute_precision_at_k
Precision@k = |top-k ∩ relevant| / k (0.0 when k <= 0).
chapter3/retrieval-pipeline/stage_evaluator.py:173
↓ 4 callersMethodcompute_recall_at_k
Recall@k = |top-k ∩ relevant| / |relevant| (0.0 when no gold).
chapter3/retrieval-pipeline/stage_evaluator.py:183
↓ 4 callersFunctionconfig
()
chapter7/openvla-robotwin2-eval/test_experiment.py:15
↓ 4 callersMethodconsolidate_and_learn
Consolidate memories and extract learnings
chapter3/memobase/agent.py:510
↓ 4 callersFunctioncontaining_shape
(all_shapes, x: float, y: float)
book-vi/fix_svg_text_layout.py:232
↓ 4 callersMethodcontextual_search
Perform contextual search using specified method. Args: query: Search query method: Search method -
chapter3/contextual-retrieval/contextual_tools.py:227
↓ 4 callersFunctioncopied_run
(tmp_path: Path)
chapter8/MiniMind-pretrain/validation/test_vlm_training_report_audit.py:33
↓ 4 callersFunctioncount_tokens
(text: str)
chapter4/active-tool-discovery/run_exact_experiment.py:147
↓ 4 callersMethodcreate
(self, **_kwargs)
chapter5/agent-creator/test_creator.py:29
↓ 4 callersMethodcreate
(self, **kwargs)
chapter6/phone-agent/test_agent.py:45
↓ 4 callersMethodcreateChatCompletion
(messages, options = {})
chapter6/live-audio/backend/utils/providers/llmProviders.js:172
↓ 4 callersFunctioncreate_task_with_proxy
Create a task with proxy enabled from a specific country. Args: instructions: Task description country_code: Proxy country ('us', 'fr',
chapter9/browser-use-rpa/browser-use/examples/cloud/04_proxy_usage.py:62
↓ 4 callersFunctiondefault_model
(provider: str)
chapter9/ai-style-skill/llm_client.py:49
↓ 4 callersFunctiondelete_path
Remove a path from the workspace by moving it to private quarantine.
chapter4/perception-tools/src/filesystem_tools.py:281
↓ 4 callersFunctiondemoMinutes
(lesson)
slides/generate.mjs:82
↓ 4 callersFunctiondetectLang
(path)
extras/lang-switcher.js:31
↓ 4 callersMethoddetect_pii
Detect Level 3 PII in conversation text using local LLM Args: conversation_text: Text to analyze
chapter3/log-sanitization/agent.py:139
↓ 4 callersFunctiondevice_info
(device: torch.device)
chapter6/robotics_lab_common.py:44
↓ 4 callersFunctiondiagnose_failures
Aggregate failed cases into an evidence-bearing change request.
chapter9/prompt-auto-optimization/learning_signal.py:62
↓ 4 callersFunctiondirect_plan
Build the fixed-parameter control without an LLM planning call.
chapter6/phone-agent/agent.py:200
↓ 4 callersMethoddisconnect_all
Cleanup MCP manager (no persistent connections to close) Since we spawn fresh connections for each tool call, there'
chapter6/agent-with-event-trigger/agent.py:243
↓ 4 callersFunctiondisplay_sample
( instr: str, ty: type[T] | dict[str, Any], t: str | None = None, response: T
chapter2/prompt-engineering/tau_bench/model_utils/model/chat.py:94
↓ 4 callersFunctiondisplay_simple_search_results
Display simple search results in a readable format.
chapter9/browser-use-rpa/browser-use/examples/cloud/05_search_api.py:131
↓ 4 callersFunctiondownload_file_from_url
Download file from URL to temporary location. Args: url: URL to download from timeout: Request timeout in seconds
chapter4/perception-tools/src/base.py:74
↓ 4 callersFunctiondump_json
(path: Path, value: Any)
chapter7/openvla-robotwin2-eval/experiment.py:45
↓ 4 callersFunctionedge
(name, d, extra = '')
web-astro/scripts/collaboration-manager-figures.mjs:88
↓ 4 callersFunctionedge
(k, name, from, to, d, extra = {})
web-astro/scripts/coding-production-layout.mjs:90
↓ 4 callersFunctionemail_text
(email: dict[str, Any])
chapter6/agent-with-event-trigger/unipile_mailbox_experiment.py:279
↓ 4 callersFunctionenergy_vad_events
Return start, acoustic endpoint, and later VAD decision sample. The decision occurs only after the full low-energy run. Keeping it separate f
chapter6/streaming-speech/whisper_baseline.py:44
↓ 4 callersFunctionerror_details
(exc: Exception)
chapter7/model-benchmark/campaign.py:407
↓ 4 callersFunctionescapeHtml
(value)
slides/generate.mjs:26
↓ 4 callersMethodevaluate
(self, responses)
chapter9/trajectory-verifier/test_claim_action_order.py:46
↓ 4 callersMethodevaluate
(self, trajectory: Dict[str, Any])
chapter9/trajectory-verifier/llm_judge.py:41
↓ 4 callersMethodevaluate_all
Evaluate all loaded test cases
chapter3/agentic-rag-for-user-memory/main.py:403
↓ 4 callersFunctionevaluate_release_gate
( before: Dict[str, Any], after: Dict[str, Any], manifest: Dict[str, Any] )
chapter9/prompt-auto-optimization/release_gate.py:23
↓ 4 callersMethodevaluate_retention
Evaluate downstream QA retention accuracy on compressed context.
chapter2/context-compression/benchmark_compression.py:177
↓ 4 callersMethodevaluate_stage
Evaluate one stage's results for a single query. ``results`` is the ranked result-dict list for one (query, stage) pair; ``relevant_i
chapter3/retrieval-pipeline/stage_evaluator.py:222
↓ 4 callersFunctionevaluate_task
Score a task with a small deterministic rubric and a veto. The expected numbers are deliberately broad because live sources can report slight
chapter10/multi-role-transfer/evaluation.py:148
↓ 4 callersMethodevaluate_test_case
Evaluate a single test case with dual memory system Args: test_id: Test case ID Returns:
chapter3/contextual-retrieval-for-user-memory/contextual_evaluator.py:269
↓ 4 callersFunctionevaluationKit
(source, number, count, options = {})
web-astro/scripts/evaluation-layout-kit.mjs:7
↓ 4 callersFunctionexecute_and_filter_model_errors
( funcs: list[Callable[[], T]], max_concurrency: int | None = None, )
chapter2/prompt-engineering/tau_bench/model_utils/api/exception.py:46
↓ 4 callersFunctionexecute_tool
(name: str, arguments: dict[str, Any])
chapter5/agent-creator/reference_agent/domain_tools.py:75
↓ 4 callersMethodexecute_tool
执行工具。第 4 层防御在这里对高风险操作做运行时拦截。
chapter2/prompt-injection/agent.py:239
↓ 4 callersFunctionexecution_config_fingerprint
Fingerprint execution semantics while allowing price-only report rebuilds.
chapter7/user-memory-system-evaluation/experiment.py:1855
↓ 4 callersFunctionextractLabels
(source, figure, expectedLabels, expectedShape)
web-astro/scripts/collaboration-manager-figures.mjs:40
↓ 4 callersFunctionextractLabels
(source, figure, expected)
web-astro/scripts/collaboration-context-figures.mjs:24
↓ 4 callersFunctionextract_answer_from_boxed
从 \\boxed{} 格式中提取答案(同时支持 \\(\\boxed{}\\) 形式)
chapter8/Intuitor/evaluate_from_cache.py:14
↓ 4 callersFunctionextract_pdf_text
Extract text from PDF file. Args: file_path: Path to PDF file page_range: Optional page range (e.g., "1-5" or "1,3,5")
chapter4/perception-tools/src/document_processing_tools.py:24
↓ 4 callersFunctionextract_quantities
Pull the revenue-scale numbers out of free text. Handles the two ways the same amount is written in these tasks -- grouped digits (``$2,282,6
chapter1/context/grounding.py:51
↓ 4 callersMethodfill
Fill the input element using proper CDP methods with improved focus handling.
chapter9/browser-use-rpa/browser-use/browser_use/actor/element.py:352
↓ 4 callersFunctionfire
(name, ...args)
tests/js/auto-translate.test.js:55
↓ 4 callersFunctionflush
把缓冲区的普通文本作为一个 speech 片段输出。
chapter6/controllable-tts/markup.py:70
↓ 4 callersFunctionfmt
(value: float)
book-vi/fix_svg_text_layout.py:114
↓ 4 callersFunctionformat_trace_step
把一条 ReAct 轨迹步骤渲染成一行可读文本。 这正是本章强调的“轨迹(trajectory)”——用户消息、模型思考、工具调用、 工具结果都被清晰地区分开来,让 ReAct 循环“想→做→看”一目了然。
chapter1/web-search-agent/agent.py:39
↓ 4 callersFunctiongenerate_candidate
确定性对照候选:不触碰 stable/,只产出新模块源码。
chapter9/harness-safety-gate/evolution.py:327
↓ 4 callersMethodgenerate_next_message
(self, messages: List[Dict[str, Any]])
chapter2/prompt-engineering/tau_bench/envs/user.py:117
↓ 4 callersMethodgetHeaders
()
chapter6/live-audio/backend/utils/providers/llmProviders.js:153
↓ 4 callersFunctionget_all_tools
Get flat list of all tools from all servers.
chapter4/active-tool-selection/tool_knowledge_base.py:604
↓ 4 callersMethodget_api_key
Get API key for specified provider (or configured provider if not specified)
chapter5/coding-agent/config.py:43
↓ 4 callersMethodget_bounding_box
Get the bounding box of the element.
chapter9/browser-use-rpa/browser-use/browser_use/actor/element.py:652
↓ 4 callersFunctionget_client
Get or create the global PubChem client.
chapter4/perception-tools/src/pubchem_tools.py:172
↓ 4 callersFunctionget_client
返回一个配置好的 OpenAI 客户端。 优先使用官方端点(读取 OPENAI_API_KEY);若缺失则在存在 OPENROUTER_API_KEY 时 回退到 OpenRouter(OpenAI 兼容端点)。
chapter3/structured-knowledge-extraction/config.py:64
↓ 4 callersMethodget_client
(self)
chapter9/browser-use-rpa/browser-use/browser_use/llm/groq/chat.py:76
↓ 4 callersFunctionget_compound_properties
Retrieve detailed chemical properties for a PubChem compound. Args: cid: PubChem Compound ID properties: List of propert
chapter4/perception-tools/src/pubchem_tools.py:299
↓ 4 callersMethodget_context
Get agent context for a session.
chapter3/mem0/agent.py:196
↓ 4 callersFunctionget_cwe_for_violation
Return the CWE ID for a given violation type string.
chapter5/permission-embedded-data-objects/pedo/eval/dataguardbench/cwe_taxonomy.py:107
↓ 4 callersMethodget_dialogue_context
Return formatted dialogue context.
chapter6/streaming-speech/interruption_manager.py:371
↓ 4 callersMethodget_dir
Get the file system directory
chapter9/browser-use-rpa/browser-use/browser_use/filesystem/file_system.py:229
↓ 4 callersFunctionget_env
( env_name: str, user_strategy: Union[str, UserStrategy], user_model: str, task_split: str,
chapter2/prompt-engineering/tau_bench/envs/__init__.py:8
↓ 4 callersMethodget_graph_statistics
Get statistics about the knowledge graph.
chapter3/structured-index/graphrag_indexer.py:578
↓ 4 callersFunctionget_graphrag_config
Get GraphRAG configuration from environment.
chapter3/structured-index/config.py:134
↓ 4 callersMethodget_hidden_rules
Return the hidden game rules (for debugging/analysis).
chapter1/learning-from-experience/game_environment.py:491
↓ 4 callersMethodget_performance_metrics
Get agent performance metrics
chapter3/memobase/agent.py:564
↓ 4 callersMethodget_provider
Get the configured provider
chapter5/coding-agent/config.py:38
↓ 4 callersFunctionget_raptor_config
Get RAPTOR configuration from environment.
chapter3/structured-index/config.py:96
↓ 4 callersMethodget_rating
Get current rating for a model, initializing if necessary.
chapter7/elo-leaderboard/elo_rating.py:31
↓ 4 callersMethodget_reaction_log
(self)
chapter5/permission-embedded-data-objects/pedo/core/store.py:630
↓ 4 callersMethodget_routing_details
Get detailed routing information for debugging/visualization. Returns a dictionary with: - request: Original request
chapter4/active-tool-selection/semantic_router.py:195
↓ 4 callersFunctionget_sample_tasks
Get sample tasks for testing Returns: list: List of sample task dictionaries
chapter1/context/main.py:699
↓ 4 callersMethodget_statistics
Get statistics about the knowledge base. Returns: Dictionary containing knowledge base statistics
chapter9/browser-use-rpa/learning_agent/knowledge_base.py:303
← previousnext →801–900 of 13,003, ranked by callers