MCPcopy Create free account

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

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

↓ 1 callersMethod_reasoning_content
Return provider reasoning text without assuming one SDK shape.
chapter1/context/agent.py:556
↓ 1 callersFunction_reasoning_safe_max_tokens
Reasoning models spend completion budget on hidden reasoning tokens before emitting content / tool calls. Give them enough headroom so a tool
chapter2/kv-cache/agent.py:47
↓ 1 callersFunction_reasoning_safe_temperature
Reasoning models (Kimi K3, GPT-5, ...) only accept temperature=1. Return 1 for those; otherwise the requested value so non-reasoning providers
chapter6/agent-with-event-trigger/server_fastapi.py:32
↓ 1 callersFunction_reasoning_safe_temperature
Reasoning models (Kimi K3, GPT-5, ...) only accept temperature=1. Return 1 for those; otherwise the requested value so non-reasoning providers
chapter6/agent-with-event-trigger/agent.py:37
↓ 1 callersFunction_reasoning_safe_temperature
Reasoning models (Kimi K3, GPT-5, ...) only accept temperature=1. Return 1 for those; otherwise the requested value so non-reasoning providers
chapter6/agent-with-event-trigger/server.py:33
↓ 1 callersFunction_reasoning_safe_temperature
Reasoning models (Kimi K3, GPT-5, ...) only accept temperature=1. Return 1 for those; otherwise the requested value so non-reasoning providers
chapter6/agent-with-event-trigger/tests/manual/demo.py:19
↓ 1 callersFunction_reasoning_safe_temperature
Reasoning models (Kimi K2.5/K2.6/K2.7/K3, GPT-5, ...) only accept temperature=1. Return 1 for those; otherwise the requested value so non-reas
chapter2/kv-cache/agent.py:40
↓ 1 callersFunction_reasoning_safe_temperature
Reasoning models (Kimi K3, GPT-5, ...) only accept temperature=1. Return 1 for those; otherwise the requested value so non-reasoning providers
chapter2/system-hint/agent.py:28
↓ 1 callersFunction_reasoning_safe_temperature
Reasoning models (Kimi K3, GPT-5, ...) only accept temperature=1. Return 1 for those; otherwise the requested value so non-reasoning providers
chapter1/learning-from-experience/llm_agent.py:19
↓ 1 callersFunction_reasoning_safe_temperature
Reasoning models (Kimi K3, GPT-5, ...) only accept temperature=1. Return 1 for those; otherwise the requested value so non-reasoning providers
chapter1/context/config.py:13
↓ 1 callersFunction_reasoning_safe_temperature
Reasoning models (Kimi K3, GPT-5, ...) only accept temperature=1. Return 1 for those; otherwise the requested value so non-reasoning providers
chapter1/context/agent.py:26
↓ 1 callersFunction_reasoning_safe_temperature
Reasoning models (Kimi K3, GPT-5, ...) only accept temperature=1. Return 1 for those; otherwise the requested value so non-reasoning providers
chapter3/agentic-rag-for-user-memory/config.py:13
↓ 1 callersFunction_reasoning_safe_temperature
Reasoning models (Kimi K3, GPT-5, ...) only accept temperature=1. Return 1 for those; otherwise the requested value so non-reasoning providers
chapter3/agentic-rag-for-user-memory/agent.py:19
↓ 1 callersFunction_reasoning_safe_temperature
Reasoning models (Kimi K3, GPT-5, ...) only accept temperature=1. Return 1 for those; otherwise the requested value so non-reasoning providers
chapter3/user-memory/config.py:14
↓ 1 callersFunction_reasoning_safe_temperature
Reasoning models (Kimi K3, GPT-5, ...) only accept temperature=1. Return 1 for those; otherwise the requested value so non-reasoning providers
chapter3/user-memory/conversational_agent.py:19
↓ 1 callersFunction_reasoning_safe_temperature
Reasoning models (Kimi K3, GPT-5, ...) only accept temperature=1. Return 1 for those; otherwise the requested value so non-reasoning providers
chapter3/mem0/config.py:13
↓ 1 callersFunction_reasoning_safe_temperature
Reasoning models (Kimi K3, GPT-5, ...) only accept temperature=1. Return 1 for those; otherwise the requested value so non-reasoning providers
chapter3/contextual-retrieval/contextual_chunking.py:22
↓ 1 callersFunction_reasoning_safe_temperature
Reasoning models (Kimi K3, GPT-5, ...) only accept temperature=1. Return 1 for those; otherwise the requested value so non-reasoning providers
chapter3/contextual-retrieval-for-user-memory/config.py:13
↓ 1 callersFunction_reasoning_safe_temperature
Reasoning models (Kimi K3, GPT-5, ...) only accept temperature=1. Return 1 for those; otherwise the requested value so non-reasoning providers
chapter3/contextual-retrieval-for-user-memory/contextual_indexer.py:24
↓ 1 callersFunction_reasoning_safe_temperature
Reasoning models (Kimi K3, GPT-5, ...) only accept temperature=1. Return 1 for those; otherwise the requested value so non-reasoning providers
chapter3/contextual-retrieval-for-user-memory/contextual_chunking.py:21
↓ 1 callersFunction_reasoning_safe_temperature
Reasoning models (Kimi K3, GPT-5, ...) only accept temperature=1. Return 1 for those; otherwise the requested value so non-reasoning providers
chapter3/contextual-retrieval-for-user-memory/agent.py:19
↓ 1 callersFunction_reasoning_safe_temperature
Reasoning models (Kimi K3, GPT-5, ...) only accept temperature=1. Return 1 for those; otherwise the requested value so non-reasoning providers
chapter3/contextual-retrieval-for-user-memory/contextual_agent.py:22
↓ 1 callersFunction_reasoning_safe_temperature
Reasoning models (Kimi K3, GPT-5, ...) only accept temperature=1. Return 1 for those; otherwise the requested value so non-reasoning providers
chapter3/contextual-retrieval-for-user-memory/contextual_evaluator.py:26
↓ 1 callersFunction_reasoning_safe_temperature
Reasoning models (Kimi K3, GPT-5, ...) only accept temperature=1. Return 1 for those; otherwise the requested value so non-reasoning providers
chapter3/memobase/agent.py:27
↓ 1 callersMethod_rebuild_without_deleted
Rebuild the index without deleted items.
chapter3/dense-embedding/indexing.py:136
↓ 1 callersMethod_receive_computer_feedback
Independent inbound loop: Computer -> Phone is not a write-only channel.
chapter10/autonomous-phone-registration/orchestration.py:141
↓ 1 callersMethod_recommendations
( self, metrics: list[TurnMetrics], efficiency_score: float, total_cost: float
chapter7/agent-cost-analysis/cost_efficiency_analyzer.py:359
↓ 1 callersMethod_recommendations_for
Generate sandbox-hardening recommendations for detected patterns.
chapter5/coding-agent/sandbox_evaluator.py:264
↓ 1 callersMethod_record_call
(self, kwargs: dict, response: object, started: float)
chapter10/multi-role-transfer/skill_orchestrator.py:177
↓ 1 callersMethod_record_receipt
Checkpoint credential-free raw provider evidence after every call.
chapter4/execution-tools/llm_helper.py:62
↓ 1 callersFunction_refine_boundaries
Ask Vision to tighten a rejected edit using dense source-frame evidence. Ground-truth annotations are deliberately not supplied here: the next ed
chapter5/video-edit/campaign.py:427
↓ 1 callersMethod_register_default_tools
Register default tools from local_llm_serving
chapter2/attention_visualization/tools.py:22
↓ 1 callersMethod_register_default_tools
Register default tools
chapter2/local_llm_serving/tools.py:23
↓ 1 callersMethod_register_default_types
Register sample object types for standalone security evaluation.
chapter5/permission-embedded-data-objects/run_live_security_eval.py:198
↓ 1 callersMethod_register_tool_as_action
Register a single MCP tool as a browser-use action. Args: registry: Browser-use registry to register action to action_name: Name for the regi
chapter9/browser-use-rpa/browser-use/browser_use/mcp/client.py:246
↓ 1 callersMethod_register_tool_as_action
Register an MCP tool as a browser-use action. Args: tool_name: Name of the MCP tool tool: MCP Tool object with schema information
chapter9/browser-use-rpa/browser-use/browser_use/mcp/controller.py:91
↓ 1 callersFunction_rejudge
从留下的原始数据重新判一遍。 判定口径后来改过(续写和元指令都要和断点处那一截拼起来再看),重跑一整场 活动只为换个口径不划算,原始请求和响应都在,重判即可。
chapter5/provider-failover/summarize.py:120
↓ 1 callersFunction_relative_parts
(value: str)
chapter4/perception-tools/src/filesystem_tools.py:63
↓ 1 callersFunction_relative_source
(source: str)
scripts/git_revision_dates.py:66
↓ 1 callersMethod_remap_messages
(self, messages: list[dict[str, str]])
chapter2/prompt-engineering/tau_bench/model_utils/model/claude.py:80
↓ 1 callersFunction_remove_container
(name: str)
chapter9/self-modifying-agent/candidate_sandbox.py:108
↓ 1 callersMethod_render
(data)
extras/agent-lab/agent-trajectory.js:316
↓ 1 callersFunction_render_field_html
把单个字段 schema 渲染成 HTML 片段。
chapter5/dynamic-form/demo.py:244
↓ 1 callersFunction_render_model_script
( backend: Backend, *, label: str, source: Path, output: Path, start: float, end:
chapter5/video-edit/campaign.py:265
↓ 1 callersFunction_replay
(args: argparse.Namespace)
chapter10/multi-role-transfer/run_comparison.py:310
↓ 1 callersFunction_replay_all
(gate: Dict[str, Any], cases: Iterable[Dict[str, Any]])
chapter9/harness-safety-gate/evolution.py:428
↓ 1 callersMethod_report_fill_error
Record one browser failure and forward the shared error envelope.
chapter10/autonomous-phone-registration/orchestration.py:294
↓ 1 callersMethod_request
(self, kwargs: Dict[str, Any])
chapter7/user-memory-system-evaluation/experiment.py:242
↓ 1 callersMethod_request
(self, kwargs: Dict[str, Any])
chapter7/user-memory-system-evaluation/experiment.py:315
↓ 1 callersFunction_required_receipts_real
(record: dict[str, Any], task: dict[str, Any])
chapter4/active-tool-discovery/run_exact_experiment.py:869
↓ 1 callersFunction_rescore_run
(run: dict)
chapter10/multi-role-transfer/run_comparison.py:280
↓ 1 callersMethod_reset
()
extras/agent-lab/agent-trajectory.js:412
↓ 1 callersMethod_reset_tab_state
(self, browser_session: BrowserSession, base_url: str)
chapter9/browser-use-rpa/browser-use/tests/ci/test_browser_session_tab_management.py:118
↓ 1 callersFunction_resolve_backend
Resolve the effective backend. ``auto`` -> ``anthropic`` if ANTHROPIC_API_KEY is set, else ``openrouter`` if OPENROUTER_API_KEY is set.
chapter7/elo-leaderboard/llm_judge.py:119
↓ 1 callersMethod_resolve_pooling
(pooling: str, model_name: str)
chapter3/retrieval-pipeline/evaluate.py:213
↓ 1 callersMethod_respond
(self, messages: List[Dict])
chapter4/active-tool-discovery/offline_backend.py:158
↓ 1 callersMethod_restart
Replace a stuck shell while retaining session state.
chapter5/coding-agent/tools/shell_session.py:232
↓ 1 callersMethod_retry_with_browser_use_agent
Run an autonomous agent task.
chapter9/browser-use-rpa/browser-use/browser_use/mcp/server.py:568
↓ 1 callersFunction_review
( backend: Backend, *, purpose: str, clip: Path, directory: Path, receipts: list[dict[
chapter5/video-edit/campaign.py:400
↓ 1 callersFunction_row_match
(a, b, tol)
chapter5/erp-agent/demo.py:47
↓ 1 callersFunction_run
( command: list[str], root: Path, timeout: int, extra_env: dict[str, str] | None = None, )
chapter5/agent-creator/validator.py:182
↓ 1 callersFunction_run
()
chapter5/log-diagnosis/github_mcp.py:119
↓ 1 callersFunction_run
()
chapter4/collaboration-tools/test_recurring_max_occurrences_zero.py:11
↓ 1 callersMethod_run
(self, state: TaskState, job: str)
chapter6/async-agent/tasks.py:138
↓ 1 callersMethod_run_anthropic_iteration
Run one iteration with Anthropic API
chapter5/coding-agent/agent.py:181
↓ 1 callersMethod_run_dialogue
(self)
chapter10/autonomous-phone-registration/orchestration.py:166
↓ 1 callersFunction_run_episode
( *, env: Any, task_type: Any, params: dict[str, Any], task_name: str, trial: int,
chapter7/android-world/run_controlled_experiment.py:1075
↓ 1 callersMethod_run_multi_session_test
Run a multi-session test
chapter3/user-memory/locomo_benchmark.py:358
↓ 1 callersMethod_run_one_model_turn
调一次模型;执行它请求的所有工具调用。 返回 True 表示整个任务结束(approve_code)。 阶段转换工具会切换 self.stage 并立刻返回,让下一轮用新提示词+新工具。
chapter10/staged-system-prompt/agent.py:300
↓ 1 callersMethod_run_openai_iteration
Run one iteration with OpenAI/OpenRouter API
chapter5/coding-agent/agent.py:304
↓ 1 callersFunction_run_python_source
把源码写到临时文件并用子进程执行,返回合并后的输出。
chapter10/staged-system-prompt/tools.py:212
↓ 1 callersFunction_run_single
执行单次请求(single / dry-run 模式),打印可读轨迹并按需保存结果。
chapter1/search-codegen/main.py:273
↓ 1 callersMethod_run_single_session_test
Run a single session test
chapter3/user-memory/locomo_benchmark.py:271
↓ 1 callersMethod_run_stdio_client
Run the stdio client connection in a background task.
chapter9/browser-use-rpa/browser-use/browser_use/mcp/client.py:129
↓ 1 callersFunction_run_turn_offline
离线确定性回合:按系统提示词约定的 JSON 结构返回占位结论,不冒充 LLM。
chapter4/collaboration-tools/src/subagent_tools.py:319
↓ 1 callersMethod_run_with_learning
Run task with browser-use agent and capture workflow. Args: max_steps: Maximum steps for agent
chapter9/browser-use-rpa/learning_agent/agent.py:383
↓ 1 callersMethod_run_with_replay
Run task using a learned workflow. Args: workflow: The workflow to replay Returns:
chapter9/browser-use-rpa/learning_agent/agent.py:351
↓ 1 callersMethod_run_with_sampling_strategy
( self, models: list[AnyModel], datapoint: Datapoint, sampling_strategy: Sampl
chapter2/prompt-engineering/tau_bench/model_utils/api/api.py:161
↓ 1 callersFunction_runner
()
chapter4/collaboration-tools/src/subagent_tools.py:440
↓ 1 callersFunction_s
(desc: str)
chapter4/active-tool-discovery/tools_library.py:41
↓ 1 callersFunction_safe_ast
Apply a fast defense-in-depth filter before sandboxed execution.
chapter9/self-modifying-agent/evolution.py:192
↓ 1 callersFunction_safe_ast
执行前的快速预筛:只允许白名单导入,禁止危险内建调用。
chapter9/harness-safety-gate/evolution.py:352
↓ 1 callersFunction_safe_create
调用 Chat Completions;对推理型模型(如 gpt-5.x)的参数限制做自动降级重试: - 不支持 max_tokens 时改用 max_completion_tokens; - 不支持非默认 temperature 时移除该参数(回退到模型默认 1)。 这样同
chapter10/voice-werewolf/werewolf/agent.py:42
↓ 1 callersFunction_safe_eval
只支持四则运算/幂/取模的安全表达式求值(不走 Python 内置 eval)。
chapter10/multi-role-transfer/tools.py:161
↓ 1 callersMethod_safe_parse_number
Parse string to float, handling negatives and decimals.
chapter9/browser-use-rpa/browser-use/browser_use/dom/serializer/serializer.py:61
↓ 1 callersMethod_safe_parse_optional_number
Parse string to float, returning None for invalid values.
chapter9/browser-use-rpa/browser-use/browser_use/dom/serializer/serializer.py:68
↓ 1 callersFunction_same_evidence
Compare evidence as set-like collections, including JSON objects.
chapter7/public-health-reporting-eval/evaluator.py:38
↓ 1 callersFunction_sanitize
receipt 中的请求体脱敏:超长字符串(如 base64 图片)替换为哈希摘要。
chapter5/cad-vs-diffusion/llm.py:22
↓ 1 callersFunction_sanitize_for_evidence
Retain raw public text while replacing large data URLs with hashes.
chapter5/paper-to-ppt/agents.py:157
↓ 1 callersFunction_sanity_ok
自检:用库中已存在的向量查询,应能召回它自己。用于识别环境中损坏的索引后端。
chapter3/dense-embedding/cli.py:270
↓ 1 callersMethod_save_indexes
Save BM25 indexes to disk
chapter3/contextual-retrieval/contextual_tools.py:557
↓ 1 callersMethod_save_learned_workflow
Save the captured workflow to knowledge base.
chapter9/browser-use-rpa/learning_agent/agent.py:437
↓ 1 callersFunction_save_partial_summary
单方案运行(--mode dual/single)时,落盘该方案自身的质量与 token 结果。
chapter5/paper-to-ppt/demo.py:376
↓ 1 callersMethod_save_results
Save results to JSON file
chapter2/context-compression/experiment.py:217
↓ 1 callersMethod_save_results
Save benchmark results
chapter3/user-memory/locomo_benchmark.py:497
↓ 1 callersMethod_save_trajectory
Save current trajectory to JSON file for debugging
chapter6/agent-with-event-trigger/agent.py:472
↓ 1 callersMethod_save_trajectory
Save current trajectory to JSON file for debugging
chapter2/system-hint/agent.py:226
↓ 1 callersMethod_save_trajectory
Save current trajectory to file for debugging
chapter3/user-memory/agent.py:579
↓ 1 callersMethod_scan
(self)
chapter6/agent-with-event-trigger/event_loop_demo.py:135
↓ 1 callersFunction_scenario_tools
Expose the deliberately defective Harness used to create each labeled arm. These are controlled ablations, not fabricated post-hoc transcripts: t
chapter9/trajectory-verifier/customer_service_env.py:90
← previousnext →3,801–3,900 of 13,003, ranked by callers