MCPcopy Create free account

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

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

↓ 1 callersMethod_log_next_action_summary
Log a comprehensive summary of the next action(s)
chapter9/browser-use-rpa/browser-use/browser_use/agent/service.py:1222
↓ 1 callersMethod_log_request_response
Log full request and response when in verbose mode Args: request_data: The request payload sent to the API
chapter1/context/agent.py:605
↓ 1 callersMethod_log_role_banner
(self)
chapter10/multi-role-transfer/orchestrator.py:100
↓ 1 callersMethod_log_seed
(self, reqs: str)
chapter10/staged-system-prompt/agent.py:283
↓ 1 callersMethod_log_sensitive_data_usage
Log when sensitive data is being used on a page
chapter9/browser-use-rpa/browser-use/browser_use/tools/registry/service.py:392
↓ 1 callersMethod_log_step_completion_summary
Log step completion summary with action count, timing, and success/failure stats
chapter9/browser-use-rpa/browser-use/browser_use/agent/service.py:1265
↓ 1 callersMethod_log_step_context
Log step context information
chapter9/browser-use-rpa/browser-use/browser_use/agent/service.py:1213
↓ 1 callersMethod_log_usage
Log usage to the logger
chapter9/browser-use-rpa/browser-use/browser_use/tokens/service.py:232
↓ 1 callersMethod_makeCollapsible
(body)
extras/agent-lab/agent-trajectory.js:375
↓ 1 callersFunction_make_chunk
(text=None, tool_calls=None)
chapter2/local_llm_serving/test_parallel_tools.py:77
↓ 1 callersFunction_make_client
构造客户端并解析模型名,含通用 OpenRouter 兜底。返回 (client, resolved_model)。 - 有 OPENAI_API_KEY:直连;但当 model 是 gpt-5.x 且同时设置了 OPENROUTER_API_KEY 时优先走 OpenRout
chapter5/small-model-codified-rules/agent.py:141
↓ 1 callersFunction_make_client_and_model
构造客户端并解析模型名。返回 (client, resolved_model)。 端点、key 与模型名映射统一由 agentbook 的 provider 注册表维护。 chosen_by_reader=False 表示 "openai" 是本实验的默认值而非读者的显式选择:
chapter5/erp-agent/agent.py:17
↓ 1 callersMethod_make_history_item
Create and store history item
chapter9/browser-use-rpa/browser-use/browser_use/agent/service.py:963
↓ 1 callersFunction_make_mcp_function
(spec: ExpandedToolSpec)
chapter4/perception-tools/src/expanded_catalog.py:962
↓ 1 callersMethod_make_strict_compatible
Ensure all properties are required for OpenAI strict mode
chapter9/browser-use-rpa/browser-use/browser_use/llm/schema.py:145
↓ 1 callersFunction_make_task_from_query
把临时 --query 包装成带判分槽位的任务(槽位按关键词推断)。
chapter4/active-tool-discovery/demo.py:104
↓ 1 callersFunction_manifest_fields_complete
(manifest: dict[str, Any])
chapter9/self-modifying-agent/run_experiment_9_6.py:35
↓ 1 callersFunction_manifest_fields_complete
(manifest: dict[str, Any])
chapter9/harness-safety-gate/run_experiment_9_7.py:37
↓ 1 callersFunction_map_model_for_openrouter
把常见模型名映射成 OpenRouter 的 `provider/model` 形式。 - 已含 "/" 的 id(如 anthropic/claude-opus-4.8、google/gemini-2.5-pro)原样透传。 - gpt-*/o1-*/o3-*/o4-* -> o
chapter6/async-agent/demo.py:51
↓ 1 callersFunction_map_model_for_openrouter
Map a plain model id onto OpenRouter's `provider/model` form. Ids that already contain "/" pass through unchanged; gpt-*/o1-*/o3-*/o4-* becom
chapter4/active-tool-selection/config.py:22
↓ 1 callersFunction_map_model_for_openrouter
Map a plain model id onto OpenRouter's `provider/model` form.
chapter4/perception-tools/src/media_processing_tools.py:26
↓ 1 callersFunction_map_to_openrouter_model
把直连模型名映射为 OpenRouter 上的 id(非可映射 id 统一兜底到当前廉价旗舰)。
chapter5/dynamic-form/demo.py:61
↓ 1 callersFunction_map_to_openrouter_model
把直连模型名映射为 OpenRouter 上的 id(非可映射 id 统一兜底到当前廉价旗舰)。
chapter5/small-model-codified-rules/agent.py:31
↓ 1 callersFunction_map_to_openrouter_model
把直连模型名映射为 OpenRouter 上的 id(非可映射 id 统一兜底到当前廉价旗舰)。
chapter5/adaptive-log-parser/agent.py:77
↓ 1 callersFunction_map_to_openrouter_model
把直连模型名映射为 OpenRouter 上的 id(非可映射 id 统一兜底到当前廉价旗舰)。
chapter5/log-diagnosis/diagnoser.py:23
↓ 1 callersFunction_marker_def
()
book-en/svg_lib.py:267
↓ 1 callersFunction_marker_def
()
book-tr/svg_lib.py:267
↓ 1 callersFunction_marker_def
()
book-ar/svg_lib.py:293
↓ 1 callersFunction_marker_def
()
book-ru/svg_lib.py:267
↓ 1 callersFunction_marker_def
()
book-es/svg_lib.py:267
↓ 1 callersFunction_marker_def
()
book-mn/svg_lib.py:267
↓ 1 callersFunction_marker_def
()
book-id/svg_lib.py:267
↓ 1 callersMethod_marketing
(self, email: dict[str, Any])
chapter6/agent-with-event-trigger/unipile_mailbox_experiment.py:420
↓ 1 callersMethod_match
(self, q: str)
chapter10/staged-system-prompt/simulated_user.py:39
↓ 1 callersFunction_match_ground_truth
(query, gt)
chapter5/video-edit/demo.py:278
↓ 1 callersFunction_matches_any
(text: str, patterns: tuple[re.Pattern[str], ...])
chapter2/prompt-injection/robustness_evaluator.py:100
↓ 1 callersMethod_max_tool_ctx_growth
Largest per-step increase in tool context tokens (0 if unknown).
chapter7/agent-cost-analysis/cost_efficiency_analyzer.py:424
↓ 1 callersMethod_maybe_fail
(self, action: str)
chapter6/gemini-xlerobot-navigation/desktop_planner.py:63
↓ 1 callersFunction_mcnemar_exact
(transfer_pass: list[bool], skill_pass: list[bool])
chapter10/multi-role-transfer/run_comparison.py:121
↓ 1 callersMethod_mcnemar_test
McNemar's test for paired binary (pass/fail) outcomes. Both agents run on the same tasks, so their outcomes are paired. The test cons
chapter9/hermes-self-evolution/run_downstream_ablation.py:401
↓ 1 callersFunction_mcp_create_issue
(title: str, body: str, repo: str, token: str)
chapter5/log-diagnosis/campaign.py:373
↓ 1 callersFunction_mean
(values: Iterable[float])
chapter7/android-world/experiment_core.py:42
↓ 1 callersFunction_mean
(xs: List[float])
chapter3/agentic-rag/compare_offline.py:78
↓ 1 callersFunction_media
(name: str, query: str, options: dict[str, Any])
chapter4/perception-tools/src/expanded_catalog.py:789
↓ 1 callersFunction_media_float
(value: Any)
chapter4/perception-tools/src/expanded_catalog.py:852
↓ 1 callersFunction_media_int
(value: Any)
chapter4/perception-tools/src/expanded_catalog.py:859
↓ 1 callersMethod_meeting
(self, email: dict[str, Any])
chapter6/agent-with-event-trigger/unipile_mailbox_experiment.py:355
↓ 1 callersMethod_memory_view
(self)
chapter9/self-evolution-eval/agent.py:159
↓ 1 callersMethod_merge_storage_states
Merge two storage states, with new values taking precedence.
chapter9/browser-use-rpa/browser-use/browser_use/browser/watchdogs/storage_state_watchdog.py:286
↓ 1 callersFunction_message_text
(message: Dict[str, Any])
chapter1/context/grounding.py:97
↓ 1 callersMethod_messages_for_api
把当前角色的系统提示词拼到共享历史前面。
chapter10/multi-role-transfer/orchestrator.py:90
↓ 1 callersMethod_messages_for_api
(self)
chapter10/multi-role-transfer/skill_orchestrator.py:170
↓ 1 callersFunction_metrics
(payload: dict[str, Any])
chapter9/self-modifying-agent/sandbox_runner.py:119
↓ 1 callersFunction_metrics_for_query
单条查询的 recall@k / precision@k / 命中排名(用于 MRR)。
chapter3/dense-embedding/cli.py:203
↓ 1 callersFunction_metrics_for_query
单条查询的 recall@k / precision@k / 命中排名(用于 MRR)。
chapter3/sparse-embedding/cli.py:161
↓ 1 callersFunction_minimax_endpoint
Return the t2a_v2 endpoint for MINIMAX_REGION: cn -> api.minimaxi.com, otherwise the global api.minimax.io host.
chapter7/tts-quality-eval/pipeline.py:194
↓ 1 callersFunction_missing_key_error
Build the error raised when no credential can be found. Args: spec: The provider that could not be configured. Returns: A ``
agentbook/providers/resolution.py:111
↓ 1 callersFunction_mock_result
为常用工具返回像样的 mock 结果,其余返回通用占位结果。
chapter4/active-tool-discovery/tools_library.py:330
↓ 1 callersMethod_monitor_storage_changes
Periodically check for storage changes and auto-save.
chapter9/browser-use-rpa/browser-use/browser_use/browser/watchdogs/storage_state_watchdog.py:125
↓ 1 callersMethod_monitoring_loop
Main monitoring loop.
chapter9/browser-use-rpa/browser-use/browser_use/browser/watchdogs/crash_watchdog.py:237
↓ 1 callersFunction_month_key
(d: date)
chapter5/erp-agent/seed.py:40
↓ 1 callersMethod_move
Move to another room.
chapter1/learning-from-experience/game_environment.py:292
↓ 1 callersMethod_navigate
Navigate to a URL.
chapter9/browser-use-rpa/browser-use/browser_use/mcp/server.py:650
↓ 1 callersMethod_navigate_interruptibly
(self, page)
chapter10/parallel-web-research/agents.py:114
↓ 1 callersFunction_needs_openrouter_for_gpt5
Report whether a gpt-5 request must be rerouted through OpenRouter. Two independent things make the direct OpenAI API a poor default for gpt-
agentbook/providers/resolution.py:78
↓ 1 callersFunction_neutralize_network_creds
演示前清空 .env 中的占位凭据,避免离线演示尝试真实网络请求而阻塞。
chapter4/collaboration-tools/main.py:191
↓ 1 callersFunction_next_user_msg
把工具返回包装成喂给模型的下一条 user 消息。
chapter7/agent-cost-analysis/agent.py:165
↓ 1 callersFunction_no_answer_leak
(receipt: dict[str, Any])
chapter9/self-evolution-eval/run_experiment_9_9.py:74
↓ 1 callersMethod_non_context_aware_combined_summary
Strategy 2B: Non-context-aware summarization - Concatenate all pages then summarize once
chapter2/context-compression/compression_strategies.py:348
↓ 1 callersMethod_non_context_aware_individual_summary
Strategy 2A: Non-context-aware summarization - Summarize each page individually then concatenate
chapter2/context-compression/compression_strategies.py:260
↓ 1 callersFunction_nonempty
(values: Mapping[str, str], name: str)
chapter6/computer-use-open-model/config.py:38
↓ 1 callersFunction_norm
把单个值归一化为 ('n', 数值) 或 ('s', 字符串),便于容差比对。
chapter5/erp-agent/demo.py:38
↓ 1 callersFunction_norm
(value: str, alias: dict)
chapter6/controllable-tts/markup.py:47
↓ 1 callersMethod_normalize_action_function_signature
Normalize action function to accept only kwargs. Returns: - Normalized function that accepts (*_, params: ParamModel, **special_params) -
chapter9/browser-use-rpa/browser-use/browser_use/tools/registry/service.py:57
↓ 1 callersFunction_normalize_parent_context
(parent_context: Optional[Union[str, Dict[str, Any]]])
chapter4/collaboration-tools/src/subagent_tools.py:162
↓ 1 callersFunction_normalize_text
Normalize text for duplicate detection: lowercase and collapse whitespace. Used by the offline consolidation/dedup logic so that notes that diffe
chapter3/user-memory/memory_manager.py:18
↓ 1 callersMethod_normalize_turn
Map a raw turn/span dict onto the analyzer's canonical fields.
chapter7/agent-cost-analysis/cost_efficiency_analyzer.py:157
↓ 1 callersFunction_normalized_required_info
( raw_arguments: dict[str, Any], decision: dict[str, Any] )
chapter10/autonomous-phone-registration/validate_acceptance.py:103
↓ 1 callersFunction_notify_admin_of_request
Notify admin about pending approval request.
chapter4/collaboration-tools/src/hitl_tools.py:76
↓ 1 callersFunction_notify_dispatch
(args)
chapter4/collaboration-tools/main.py:172
↓ 1 callersFunction_now
()
chapter6/phone-agent/agent.py:52
↓ 1 callersFunction_ntok
(text: str)
chapter7/agent-cost-analysis/agent.py:183
↓ 1 callersMethod_offline_choose_target
离线夜间选目标:狼人/预言家等必选场景优先选『已知狼人之外』的目标; 女巫解药/毒药等可放弃场景按概率决定。
chapter10/voice-werewolf/werewolf/agent.py:263
↓ 1 callersMethod_offline_speak
离线发言:按角色生成一句符合身份、且不泄露私密信息的模板发言。
chapter10/voice-werewolf/werewolf/agent.py:284
↓ 1 callersFunction_offline_summarize_context
规则式离线上下文摘要:剔除敏感行并压缩长度(llm_generated 的离线替身)。
chapter4/collaboration-tools/src/subagent_tools.py:306
↓ 1 callersMethod_offline_vote
离线投票:优先投自己『确知的狼人』(预言家验人 / 狼人不投队友),否则随机。
chapter10/voice-werewolf/werewolf/agent.py:248
↓ 1 callersMethod_on_target_crash_cdp
Handle target crash detected via CDP.
chapter9/browser-use-rpa/browser-use/browser_use/browser/watchdogs/crash_watchdog.py:169
↓ 1 callersFunction_openrouter_model_id
Map a provider-native model name to an OpenRouter model id, used by the universal OpenRouter fallback. An explicit OPENROUTER_MODEL env var wins.
chapter3/user-memory-evaluation/config.py:11
↓ 1 callersFunction_openrouter_model_id
Map a provider-native model name to an OpenRouter model id, used by the universal OpenRouter fallback. An explicit OPENROUTER_MODEL env var wins.
chapter3/agentic-rag-for-user-memory/config.py:21
↓ 1 callersFunction_openrouter_model_id
Map a provider-native model name to an OpenRouter model id, used by the universal OpenRouter fallback. An explicit OPENROUTER_MODEL env var wins.
chapter3/structured-index/config.py:15
↓ 1 callersFunction_openrouter_model_id
Map a provider-native model name to an OpenRouter model id, used by the universal OpenRouter fallback. An explicit OPENROUTER_MODEL env var wins.
chapter3/mem0/config.py:21
↓ 1 callersFunction_openrouter_model_id
Map a provider-native model name to an OpenRouter model id, used by the universal OpenRouter fallback. An explicit OPENROUTER_MODEL env var wins.
chapter3/contextual-retrieval/config.py:12
↓ 1 callersFunction_openrouter_model_id
Map a provider-native model name to an OpenRouter model id, used by the universal OpenRouter fallback. An explicit OPENROUTER_MODEL env var wins.
chapter3/agentic-rag/config.py:12
↓ 1 callersFunction_openrouter_model_id
Map a provider-native model name to an OpenRouter model id, used by the universal OpenRouter fallback. An explicit OPENROUTER_MODEL env var wins.
chapter3/contextual-retrieval-for-user-memory/config.py:21
↓ 1 callersFunction_openrouter_model_id
Map a provider-native model name to an OpenRouter model id, used by the universal OpenRouter fallback. An explicit OPENROUTER_MODEL env var wins.
chapter3/memobase/config.py:13
↓ 1 callersFunction_openrouter_model_id
将供应商原生模型名映射为 OpenRouter 模型 id(通用 OpenRouter 回退用)。 显式的 OPENROUTER_MODEL 环境变量优先。
chapter3/structured-knowledge-extraction/config.py:19
↓ 1 callersMethod_optimize_tree
Step 2: Optimize tree structure.
chapter9/browser-use-rpa/browser-use/browser_use/dom/serializer/serializer.py:505
↓ 1 callersFunction_optional_dependency_stubs
()
chapter8/orpheus/test_orpheus_inference.py:11
↓ 1 callersFunction_optional_int_env
Read an optional integer without making module import configuration-fatal.
chapter1/search-codegen/config.py:11
↓ 1 callersFunction_options
(raw: str)
chapter4/perception-tools/src/expanded_catalog.py:473
← previousnext →3,601–3,700 of 13,003, ranked by callers