MCPcopy Create free account

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

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

↓ 1 callersMethodrun_llm_turn
调用 LLM 做决策;同步工具就地执行并回填,异步工具启动后回占位符。
chapter6/async-agent/runtime.py:265
↓ 1 callersFunctionrun_main_interface
Run the main browser-use interface
chapter9/browser-use-rpa/browser-use/browser_use/cli.py:1878
↓ 1 callersFunctionrun_matrix
( trials: int, attack_idx: list[int], defense_idx: list[int], model: str | None, temperatu
chapter2/prompt-injection/demo.py:93
↓ 1 callersFunctionrun_memory_op
Run a single direct memory operation (add/search/get-all/history/delete). This exposes mem0 v3's ADD-only ingestion and retrieval API independent
chapter3/mem0/main.py:242
↓ 1 callersFunctionrun_mock
用合成数据演示指标聚合,无需 key/网络。
chapter7/model-benchmark/demo.py:274
↓ 1 callersFunctionrun_mode
跑一种 LLM 模式(pure/code),返回逐题记录列表。
chapter5/code-for-logic/demo.py:277
↓ 1 callersFunctionrun_multi_model_test
Test with different generation parameters as model proxy.
chapter5/permission-embedded-data-objects/pedo/eval/benchmark_comparisons.py:509
↓ 1 callersFunctionrun_offline
运行离线演示(无需 API key)。
chapter6/async-agent/demo.py:207
↓ 1 callersFunctionrun_offline
(out_path: Path)
chapter2/agent-skills-ppt/demo.py:359
↓ 1 callersFunctionrun_offline_benchmark
Deterministic (no-API) strategy comparison: retrieval recall vs token cost. This is the heart of the experiment and runs without any API key
chapter4/active-tool-selection/demo_comparison.py:227
↓ 1 callersFunctionrun_offline_selftest
(output_path: str | None = None)
chapter9/self-evolving-tools/demo.py:96
↓ 1 callersFunctionrun_once
Run a single extraction and exit
chapter9/browser-use-rpa/browser-use/examples/apps/news-use/news_monitor.py:225
↓ 1 callersFunctionrun_once
(model: str, timeout: float)
chapter1/web-search-agent/run_experiment_1_2.py:185
↓ 1 callersMethodrun_once
Run a single task non-interactively and exit. Returns a process exit code (0 = success).
chapter5/coding-agent/main.py:321
↓ 1 callersFunctionrun_one
(scenario: dict, label: str, condition: str, handlers)
chapter5/permission-embedded-data-objects/pedo/eval/baxbench_adapter/harness.py:101
↓ 1 callersFunctionrun_one
(requirement: Dict[str, str], route: str, run_dir: Path)
chapter1/image-gen-workflow/main.py:84
↓ 1 callersFunctionrun_online
(tasks: list, allow_create: bool, model: str | None, output_path: str | None)
chapter9/self-evolving-tools/demo.py:182
↓ 1 callersFunctionrun_online_benchmark
End-to-end benchmark (requires API key): does the model actually CALL the ground-truth tool, at what token cost and latency, under each strat
chapter4/active-tool-selection/demo_comparison.py:325
↓ 1 callersFunctionrun_pair
(source: str, target: str, arm: str)
chapter5/provider-failover/run_handoff.py:46
↓ 1 callersFunctionrun_parallel_phase
( sites: List[Website], target: str, timeout: float, phase: str, recorder: ReceiptRecorder
chapter10/parallel-web-research/run_official_experiment.py:124
↓ 1 callersFunctionrun_passes
(selected_provider: str, selected_key: str, selected_model: str)
chapter6/controllable-tts/evaluate_audio_quality.py:417
↓ 1 callersFunctionrun_pedo_workflow
Run the full workflow against PEDO store.
chapter5/permission-embedded-data-objects/pedo/eval/benchmark_application.py:239
↓ 1 callersFunctionrun_performance_test
Run a performance test.
chapter3/dense-embedding/test_client.py:193
↓ 1 callersFunctionrun_pipeline
( *, provider: str = "openai", model: str | None = None, seed: int = 8901, batches: int =
chapter9/ai-style-skill/run_ai_style_skill.py:36
↓ 1 callersFunctionrun_probes
( store: CampaignStore, providers: Sequence[Provider], factory: PromptFactory, config: dict[st
chapter7/model-benchmark/campaign.py:961
↓ 1 callersFunctionrun_prompt_mode
Run browser-use in non-interactive mode with a single prompt.
chapter9/browser-use-rpa/browser-use/browser_use/cli.py:1352
↓ 1 callersFunctionrun_proposer_reviewer
(paper_md, figures, max_rounds=MAX_ROUNDS)
chapter5/paper-to-ppt/demo.py:101
↓ 1 callersFunctionrun_quick_demo
Run a quick demonstration
chapter3/agentic-rag-for-user-memory/quickstart.py:52
↓ 1 callersFunctionrun_quick_demo
Run a quick demonstration
chapter3/contextual-retrieval-for-user-memory/quickstart.py:53
↓ 1 callersFunctionrun_rate_limit
( store: CampaignStore, providers: Sequence[Provider], factory: PromptFactory, config: dict[st
chapter7/model-benchmark/campaign.py:923
↓ 1 callersFunctionrun_raw_workflow
Run the full workflow against raw PostgreSQL.
chapter5/permission-embedded-data-objects/pedo/eval/benchmark_application.py:334
↓ 1 callersFunctionrun_reaction_benchmarks
Run the reaction vs trigger comparison.
chapter5/permission-embedded-data-objects/pedo/eval/benchmark_reactions.py:408
↓ 1 callersFunctionrun_reasoning_stream
(field)
chapter2/local_llm_serving/test_benchmark.py:23
↓ 1 callersFunctionrun_report
Offline: build the comparison table from existing result_*.json files. No API key required - reads previously saved runs so the final result is
chapter2/kv-cache/main.py:151
↓ 1 callersFunctionrun_retrieval_prefilter
(client, model, task_prompt: str, index, top_n: int = 10, tools: List[Dict] = None
chapter4/active-tool-discovery/agent.py:211
↓ 1 callersFunctionrun_rl_learning_check
Test that Q-learning can learn the game. Args: stochastic: If True, use stochastic environment episodes: List of episode coun
chapter1/learning-from-experience/tests/manual/rl_learning_check.py:19
↓ 1 callersFunctionrun_rls_test_fixed
Test RLS with non-superuser role.
chapter5/permission-embedded-data-objects/pedo/eval/benchmark_final_comprehensive.py:298
↓ 1 callersFunctionrun_route_a
(book: ReceiptBook)
chapter5/cad-vs-diffusion/run_experiment.py:55
↓ 1 callersFunctionrun_route_b
(book: ReceiptBook)
chapter5/cad-vs-diffusion/run_experiment.py:101
↓ 1 callersFunctionrun_safety_eval
Run safety evaluation for one model.
chapter5/permission-embedded-data-objects/pedo/eval/benchmark_final_comprehensive.py:247
↓ 1 callersFunctionrun_safety_evaluation
Run the complete safety evaluation.
chapter5/permission-embedded-data-objects/pedo/eval/benchmark_safety.py:509
↓ 1 callersFunctionrun_safety_v2
Run strengthened safety evaluation.
chapter5/permission-embedded-data-objects/pedo/eval/benchmark_safety_v2.py:314
↓ 1 callersFunctionrun_scaling_eval
Test system performance at different scales.
chapter5/permission-embedded-data-objects/pedo/eval/benchmark_comparisons.py:434
↓ 1 callersMethodrun_scenario_session
Run a single session of a scenario.
chapter3/mem0/experiment.py:137
↓ 1 callersFunctionrun_scenarios
()
chapter5/permission-embedded-data-objects/pedo/eval/enterprise_agent_scenarios.py:110
↓ 1 callersFunctionrun_scenarios
运行 LLM 驱动的验证场景(需要 API key)。
chapter6/async-agent/demo.py:213
↓ 1 callersFunctionrun_search
()
chapter9/browser-use-rpa/browser-use/examples/models/gemini.py:20
↓ 1 callersFunctionrun_search
()
chapter9/browser-use-rpa/browser-use/examples/models/novita.py:25
↓ 1 callersFunctionrun_search
执行单条稠密查询并打印结果,返回结构化结果供 --output 落盘。
chapter3/dense-embedding/cli.py:181
↓ 1 callersFunctionrun_search
执行单条查询并打印结果,返回结构化结果供 --output 落盘。
chapter3/sparse-embedding/cli.py:131
↓ 1 callersFunctionrun_selfcheck
确定性地验证「沙箱 + 题库」这条链路,无需 API key。 对每道题执行其 problems.json 里附带的参考解(Python 代码), 在子进程沙箱里运行,抽取整数输出并与真值比对。既演示了 「模型写代码 → 沙箱执行 → 按真值判分」的核心机制,也自检了题库真
chapter5/code-for-math/demo.py:301
↓ 1 callersFunctionrun_selftest
(tasks)
chapter5/small-model-codified-rules/demo.py:245
↓ 1 callersFunctionrun_serial_phase
( sites: List[Website], target: str, timeout: float, recorder: ReceiptRecorder, )
chapter10/parallel-web-research/run_official_experiment.py:161
↓ 1 callersFunctionrun_simple_browser_automation
Connect to browser-use MCP server and perform basic browser automation.
chapter9/browser-use-rpa/browser-use/examples/mcp/simple_server.py:28
↓ 1 callersFunctionrun_single
Run a single test and return result dict.
chapter5/permission-embedded-data-objects/run_targeted_eval.py:303
↓ 1 callersFunctionrun_single_agent
(paper_md, figures, max_rounds=MAX_ROUNDS)
chapter5/paper-to-ppt/demo.py:154
↓ 1 callersFunctionrun_single_mode
Run agent in a single mode Args: api_key: API key for Kimi mode: KV cache mode to use task: Custom task (optional)
chapter2/kv-cache/main.py:201
↓ 1 callersFunctionrun_single_query
Run a single ad-hoc query through the chosen strategies (requires API).
chapter4/active-tool-selection/demo_comparison.py:386
↓ 1 callersFunctionrun_single_question
单个问题模式 - 回答一个问题后退出 Args: agent: WebSearchAgent 实例 question: 要回答的问题 max_iterations: 最大 ReAct 迭代次数 output: 可选,
chapter1/web-search-agent/main.py:99
↓ 1 callersMethodrun_single_strategy
Run experiment with a single compression strategy Args: strategy: Compression strategy to test verbo
chapter2/context-compression/experiment.py:68
↓ 1 callersFunctionrun_single_task
Run a single task with optional streaming
chapter2/local_llm_serving/main.py:259
↓ 1 callersFunctionrun_single_task
Run a single task in the current process (called by subprocess)
chapter9/browser-use-rpa/browser-use/tests/ci/evaluate_tasks.py:38
↓ 1 callersFunctionrun_single_task
Run a single task with the agent Args: api_key: API key for the LLM provider task: Task description context_mode: Co
chapter1/context/main.py:578
↓ 1 callersFunctionrun_single_task
Run a single task
chapter3/memobase/main.py:202
↓ 1 callersMethodrun_single_test
Run a single ablation test Args: task: Task to execute context_mode: Context mode to test test_n
chapter1/context/main.py:140
↓ 1 callersMethodrun_single_test
Run a single test case.
chapter3/user-memory-evaluation/main.py:71
↓ 1 callersMethodrun_single_test
Run a single test case Args: agent: User memory agent test_case: Test case definition
chapter3/user-memory/locomo_benchmark.py:232
↓ 1 callersFunctionrun_smoke
快速自检:不调用 LLM,用内置样例仅跑 重放框架 + GitHub mock 的端到端管道。 退出码:管道全绿(复现全部 + 验证全部)返回 0,否则返回 3。
chapter5/log-diagnosis/demo.py:122
↓ 1 callersFunctionrun_solver
离线约束求解模式:直接用 python-constraint 求解结构化陈述,无需 LLM/API。
chapter5/code-for-logic/demo.py:334
↓ 1 callersFunctionrun_spec_error_eval_v2
Run execution-based specification error evaluation.
chapter5/permission-embedded-data-objects/pedo/eval/benchmark_spec_errors_v2.py:302
↓ 1 callersFunctionrun_spec_error_evaluation
Run the specification error evaluation.
chapter5/permission-embedded-data-objects/pedo/eval/benchmark_spec_errors.py:261
↓ 1 callersFunctionrun_spec_error_trials
Run spec error evaluation with retries.
chapter5/permission-embedded-data-objects/pedo/eval/benchmark_final_comprehensive.py:553
↓ 1 callersFunctionrun_speed_comparison
Run multiple tasks to compare speed vs accuracy.
chapter9/browser-use-rpa/browser-use/examples/cloud/02_fast_mode_gemini.py:164
↓ 1 callersFunctionrun_splade
学习型稀疏检索(SPLADE)。需要 transformers + torch + 预训练模型。 离线环境无法下载模型时,会打印清晰提示并返回 None(不影响参数解析验证)。
chapter3/sparse-embedding/cli.py:213
↓ 1 callersFunctionrun_strategy
执行一种策略并返回 (result_dict, latency_s)。
chapter4/active-tool-discovery/demo.py:111
↓ 1 callersMethodrun_strategy
Run a single compression strategy Args: strategy: The compression strategy to test Returns:
chapter2/context-compression/run_all_strategies.py:96
↓ 1 callersFunctionrun_task_subprocess
Run a task in a separate subprocess
chapter9/browser-use-rpa/browser-use/tests/ci/evaluate_tasks.py:180
↓ 1 callersFunctionrun_test_case
对单条测试用例:取原始轨迹输入 -> 重放被测系统 -> 求值断言。
chapter5/log-diagnosis/replay.py:105
↓ 1 callersMethodrun_test_case
Run a complete test case.
chapter3/retrieval-pipeline/test_client.py:90
↓ 1 callersMethodrun_test_case
Run a single test case
chapter3/contextual-retrieval/evaluation/evaluate.py:91
↓ 1 callersMethodrun_test_case
Run a single test case
chapter3/agentic-rag/evaluation/evaluate.py:99
↓ 1 callersFunctionrun_test_scenarios
Run various test scenarios
chapter6/agent-with-event-trigger/client.py:138
↓ 1 callersFunctionrun_tests
Run all tests
chapter4/multimodal-agent/test_multimodal.py:223
↓ 1 callersFunctionrun_tool_case
(client, tokenizer, protocol)
chapter2/local_llm_serving/run_experiment.py:209
↓ 1 callersFunctionrun_upper_bound
(episodes: int, objects: int, seed: int, device: torch.device)
chapter6/xlerobot-teleoperation/teleop.py:24
↓ 1 callersFunctionrun_whisper_baseline
(audio_path: str | Path, transcriber)
chapter6/streaming-speech/whisper_baseline.py:97
↓ 1 callersFunctionrun_workloads
( store: CampaignStore, providers: Sequence[Provider], factory: PromptFactory, config: dict[st
chapter7/model-benchmark/campaign.py:895
↓ 1 callersMethodruntime_metadata
(self)
chapter6/end-to-end-speech/speech_model.py:187
↓ 1 callersFunctionruntime_provenance
()
chapter3/experiment_utils.py:65
↓ 1 callersFunctionsafe_path
(repo: Path, relative: str)
chapter7/model-action-threshold/experiment.py:165
↓ 1 callersFunctionsafe_summary
(records: list[dict[str, Any]])
chapter4/active-tool-discovery/run_exact_experiment.py:833
↓ 1 callersFunctionsanitize_file
对任意日志文件执行脱敏,结果写入输出文件
chapter3/log-sanitization/main.py:117
↓ 1 callersFunctionsanitized_error
(exc: Exception, key_envs)
chapter7/user-memory-system-evaluation/probe_backends.py:22
↓ 1 callersFunctionsave
()
web-astro/src/scripts/reading-position.ts:54
↓ 1 callersMethodsave
(self, key, profile)
chapter7/model-action-threshold/tasks/crosscutting_identity/repo/accounts/store.py:5
↓ 1 callersMethodsaveRecording
()
chapter6/live-audio/backend/server.js:646
↓ 1 callersFunctionsave_and_push_model
保存模型并可选择推送到 Hugging Face Hub Args: trainer: 训练好的 trainer 对象 output_dir: 输出目录 push_to_hub: 是否推送到 Hub hub_
chapter8/MultilingualReasoning/gpt_oss_20b_sft.py:284
↓ 1 callersMethodsave_chunk_to_document_store
Save individual chunk to document store immediately (compatible with tools.py)
chapter3/contextual-retrieval/index_local_laws_contextual.py:279
↓ 1 callersFunctionsave_conversation
Save conversation history to file asynchronously.
chapter9/browser-use-rpa/browser-use/browser_use/agent/message_manager/utils.py:15
↓ 1 callersMethodsave_document_info
Save document summary information to local store
chapter3/contextual-retrieval/index_local_laws_contextual.py:312
← previousnext →6,701–6,800 of 13,003, ranked by callers