MCPcopy Create free account

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

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

↓ 7 callersMethodregister_rollback_handler
Register a callback function to be executed when state rollback is triggered.
chapter9/harness-safety-gate/safety_policy_gate.py:121
↓ 7 callersMethodroute_request
Route a tool request to relevant tools using hierarchical semantic matching. Args: tool_request: Natural languag
chapter4/active-tool-selection/semantic_router.py:67
↓ 7 callersMethodrun
(self, agent, tasks: Iterable[Dict[str, Any]])
chapter9/self-evolution-eval/harness.py:24
↓ 7 callersMethodrun
处理一条用户消息,跑完整个多角色移交流程,返回最终回复。
chapter10/multi-role-transfer/orchestrator.py:257
↓ 7 callersFunctionrun_generation
Drive the real ``generate_with_streaming`` with a scripted model.
chapter2/attention_visualization/test_streaming.py:86
↓ 7 callersFunctionrun_parallel
(agents: SpawnedAgents, bus: MessageBus)
chapter10/autonomous-phone-registration/orchestration.py:395
↓ 7 callersMethodsanitize_conversation
Sanitize a single conversation and collect metrics Returns: Dictionary with sanitized conversation and metrics
chapter3/log-sanitization/agent.py:272
↓ 7 callersMethodsay
(self, speaker: str, text: str, round_no: int, *, allow_barge_in: bool = False)
chapter10/voice-werewolf/werewolf/human.py:128
↓ 7 callersMethodsearch
Search for documents matching the query Returns list of (doc_id, score, debug_info) tuples
chapter3/sparse-embedding/bm25_engine.py:345
↓ 7 callersFunctionsourceLabels
(source, figure, expectedLabels, expectedShape)
web-astro/scripts/training-foundations-figures.mjs:5
↓ 7 callersMethodtext
(self, x, y, content, size=FS_BODY, bold=False, anchor='middle', fill='text', baseline='central', max_width=No
book-en/svg_lib.py:340
↓ 7 callersFunctiontext_nodes
(root)
book-vi/fix_svg_text_layout.py:118
↓ 7 callersFunctiontitle
(ids)
web-astro/scripts/computer-use-layout.mjs:4
↓ 7 callersMethodtype_with_custom_actions
Extend actions with custom actions
chapter9/browser-use-rpa/browser-use/browser_use/agent/views.py:179
↓ 7 callersFunctionvalidate_run
Validate one retained run and return a deterministic validation report.
chapter10/autonomous-phone-registration/validate_acceptance.py:123
↓ 6 callersMethod_api_call
( self, models: list[AnyModel], datapoint: Datapoint, sampling_strategy: SamplingStrategy )
chapter2/prompt-engineering/tau_bench/model_utils/api/api.py:229
↓ 6 callersFunction_apply_edits_from_args
Apply edits; null edits → []; skip non-dict entries with a warning.
chapter9/prompt-auto-optimization/coding_agent.py:63
↓ 6 callersMethod_cdp_navigate
Navigate to URL using CDP Page.navigate.
chapter9/browser-use-rpa/browser-use/browser_use/browser/session.py:2044
↓ 6 callersMethod_check_permission
Evaluate permission filter chain. First match wins.
chapter5/permission-embedded-data-objects/pedo/core/store.py:371
↓ 6 callersFunction_compute_stats
(latencies: list[float], label: str)
chapter5/permission-embedded-data-objects/pedo/eval/benchmark_overhead.py:321
↓ 6 callersFunction_create_position
(store, ctx, status="open")
chapter5/permission-embedded-data-objects/tests/test_scenarios.py:43
↓ 6 callersMethod_dispatch_tool
执行普通工具(非阶段转换工具),返回给模型的工具结果字符串。
chapter10/staged-system-prompt/agent.py:192
↓ 6 callersFunction_escape
(s)
book-en/svg_lib.py:53
↓ 6 callersFunction_escape
(s)
book-tr/svg_lib.py:53
↓ 6 callersFunction_escape
(s)
book-ar/svg_lib.py:57
↓ 6 callersFunction_escape
(s)
book-ru/svg_lib.py:53
↓ 6 callersFunction_escape
(s)
book-es/svg_lib.py:53
↓ 6 callersFunction_escape
(s)
book-mn/svg_lib.py:53
↓ 6 callersFunction_escape
(s)
book-id/svg_lib.py:53
↓ 6 callersFunction_get_current_board_state
Get the current board state in a structured format.
chapter4/collaboration-tools/src/chess_tools.py:51
↓ 6 callersMethod_get_node_id
Get DOM node ID from backend node ID.
chapter9/browser-use-rpa/browser-use/browser_use/actor/element.py:75
↓ 6 callersMethod_get_type
(self, type_name: str)
chapter5/permission-embedded-data-objects/pedo/core/store.py:720
↓ 6 callersFunction_json
(path: Path)
chapter4/perception-tools/test_real_experiment_4_2_evidence.py:14
↓ 6 callersFunction_normalize
(raw, charge, factors)
chapter3/structured-knowledge-extraction/extractor.py:85
↓ 6 callersFunction_notices
(caplog)
chapter1/context/tests/test_openrouter_notice.py:29
↓ 6 callersFunction_now
()
chapter6/phone-agent/webrtc_app.py:42
↓ 6 callersFunction_parse_only
把 '1,5,10' 解析成 {1,5,10};空/None 表示全部题目。
chapter5/erp-agent/demo.py:180
↓ 6 callersFunction_print_result
统一以 JSON 打印工具返回结果。
chapter4/execution-tools/cli.py:92
↓ 6 callersFunction_protocol
()
chapter4/perception-tools/test_experiment_4_2.py:19
↓ 6 callersMethod_route_to_servers
Stage 1: Route request to top-k relevant servers. Args: request: Tool request description top_k: Num
chapter4/active-tool-selection/semantic_router.py:136
↓ 6 callersMethod_row_to_object
(self, row: dict)
chapter5/permission-embedded-data-objects/pedo/core/store.py:683
↓ 6 callersFunction_rule
(rule_id="rule-worth-noting", sources=None)
chapter9/ai-style-skill/test_pipeline.py:14
↓ 6 callersFunction_save_timers
Save timer state to storage.
chapter4/collaboration-tools/src/timer_tools.py:399
↓ 6 callersFunction_slide_contract_issues
Return deterministic density/page-count failures before rendering. Vision remains the authority for pixel-level quality. This inexpensive so
chapter5/paper-to-ppt/agents.py:213
↓ 6 callersMethodadd
(self, other: "Usage")
chapter7/user-memory-system-evaluation/experiment.py:58
↓ 6 callersMethodadd
(self, source: str, event: str, **details: Any)
chapter6/async-agent/run_real_experiment.py:73
↓ 6 callersMethodadd_card
Add a new memory card. Args: card: The memory card to add Returns: Memory ID in
chapter3/contextual-retrieval-for-user-memory/advanced_memory_manager.py:141
↓ 6 callersMethodadd_chunks
Add conversation chunks to the index Args: chunks: List of conversation chunks to index rebuild: Whe
chapter3/contextual-retrieval-for-user-memory/indexer.py:83
↓ 6 callersMethodadd_memory
Add a new memory
chapter3/memobase/agent.py:134
↓ 6 callersMethodadd_worker
(self, worker: WorkerAgent)
chapter10/parallel-web-research/agents.py:236
↓ 6 callersFunctionaggregate_episodes
Aggregates real episode records by arm.
chapter7/android-world/experiment_core.py:49
↓ 6 callersMethodainvoke
(self, messages: list[BaseMessage], output_format: None = None)
chapter9/browser-use-rpa/browser-use/browser_use/llm/google/chat.py:158
↓ 6 callersMethodappend_file
Append content to file using file-specific append method
chapter9/browser-use-rpa/browser-use/browser_use/filesystem/file_system.py:332
↓ 6 callersFunctionaudit_translation
Standalone module-level entrypoint for auditing translation consistency.
chapter10/book-translation/consistency_auditor.py:458
↓ 6 callersMethodauthenticate
Authenticate with the cloud service
chapter9/browser-use-rpa/browser-use/browser_use/sync/service.py:199
↓ 6 callersMethodbox
(self, x, y, w, h, label, fill='light', sublabel=None, bold=False, font_size=FS_BODY)
book-tr/svg_lib.py:297
↓ 6 callersMethodbox
(self, x, y, w, h, label, fill='light', sublabel=None, bold=False, font_size=FS_BODY)
book-ar/svg_lib.py:323
↓ 6 callersMethodbox
(self, x, y, w, h, label, fill='light', sublabel=None, bold=False, font_size=FS_BODY)
book-ru/svg_lib.py:297
↓ 6 callersMethodbox
(self, x, y, w, h, label, fill='light', sublabel=None, bold=False, font_size=FS_BODY)
book-es/svg_lib.py:297
↓ 6 callersMethodbox
(self, x, y, w, h, label, fill='light', sublabel=None, bold=False, font_size=FS_BODY)
book-mn/svg_lib.py:297
↓ 6 callersMethodbox
(self, x, y, w, h, label, fill='light', sublabel=None, bold=False, font_size=FS_BODY)
book-id/svg_lib.py:297
↓ 6 callersFunctioncalculate_statistics
Calculate statistics for a list of rewards
chapter2/prompt-engineering/analyze_results.py:91
↓ 6 callersFunctioncanonical_provider
Normalise a provider name, resolving aliases. Args: provider: A provider name or alias, e.g. ``"moonshot"`` or ``"Kimi"``. Ca
agentbook/providers/registry.py:197
↓ 6 callersMethodchat
发起一次被追踪的 chat.completions 调用。 kwargs 原样透传给 openai client(model / messages / temperature 等)。 tool_ctx_tokens:本轮输入里工具返回结果占用的累计 token(可选
chapter7/agent-cost-analysis/tracer.py:81
↓ 6 callersMethodchat
Have a conversation with the user Args: message: User message Returns: Assistan
chapter3/user-memory/conversational_agent.py:197
↓ 6 callersMethodchat_stream
Stream a message to the model and handle tool calls in a ReAct loop Yields chunks that include: - type: 'thinking',
chapter2/local_llm_serving/agent.py:340
↓ 6 callersMethodcomplete
( self, messages: List[Dict[str, Any]], tools: Optional[List[Dict[str, Any]]] = None,
chapter7/user-memory-system-evaluation/experiment.py:245
↓ 6 callersMethodcopy
(self)
chapter6/gemini-xlerobot-navigation/desktop_planner.py:41
↓ 6 callersFunctioncreate_players
创建一局游戏(默认 7 人:2 狼人 + 1 预言家 + 1 女巫 + 3 村民,控成本)。 身份随机洗牌后分配给 P1~Pn,保证每局身份分布不同但可用 seed 复现。 offline=True 时每个 Agent 用规则策略代替 LLM(零成本、可复现);每个 Agent
chapter10/voice-werewolf/werewolf/game.py:41
↓ 6 callersFunctiondescribe
(values: Iterable[float | int | None])
chapter7/model-benchmark/analysis.py:45
↓ 6 callersFunctionedge
(name, drawing)
web-astro/scripts/computer-use-layout.mjs:7
↓ 6 callersFunctionedge
(name, content, from = '', to = '')
web-astro/scripts/memory-foundation-layout.mjs:34
↓ 6 callersMethodedit_file
Edit a file by searching and replacing content. Args: path: File path search: Text to search for
chapter4/execution-tools/file_tools.py:108
↓ 6 callersFunctionenforce_scope_claims
Sets completion gates from direct episode evidence, never from counters.
chapter7/android-world/experiment_core.py:334
↓ 6 callersMethoderrors
Get all errors from history, with None for steps without errors
chapter9/browser-use-rpa/browser-use/browser_use/agent/views.py:471
↓ 6 callersMethodevaluate_field_visibility
Evaluates field visibility boundaries to prevent unauthorized field leakage.
chapter5/permission-embedded-data-objects/run_live_security_eval.py:561
↓ 6 callersMethodevaluate_test_case
Evaluate a single test case Args: test_id: The test case ID to evaluate Returns:
chapter3/agentic-rag-for-user-memory/evaluator.py:290
↓ 6 callersFunctionevaluator_without_network
()
chapter3/user-memory-evaluation/test_structured_rubric.py:8
↓ 6 callersMethodexecute
Execute a command in the persistent native shell.
chapter5/coding-agent/tools/shell_session.py:256
↓ 6 callersFunctionflatten_nav
(data, title_label, toc_label, rtl=False, language="ar")
flatten_epub_toc.py:32
↓ 6 callersMethodfrom_state
Restore file system from serializable state at the exact same location
chapter9/browser-use-rpa/browser-use/browser_use/filesystem/file_system.py:474
↓ 6 callersMethodgenerate
Stream one raw request and retain every credential-free chunk.
chapter2/local_llm_serving/run_experiment.py:80
↓ 6 callersMethodget_current_page
Get the current page as an actor Page.
chapter9/browser-use-rpa/browser-use/browser_use/browser/session.py:899
↓ 6 callersFunctionget_game_status
Get the current game status. Returns: Dictionary with game status information
chapter4/collaboration-tools/src/chess_tools.py:276
↓ 6 callersMethodget_messages
Get all messages in the correct order: system -> state -> contextual
chapter9/browser-use-rpa/browser-use/browser_use/agent/message_manager/views.py:76
↓ 6 callersFunctionget_model
允许用 LLM_MODEL 覆盖默认模型;OpenRouter 兜底路径下映射模型名。
chapter9/prompt-auto-optimization/config.py:108
↓ 6 callersMethodget_posting_list
Get document IDs containing the term
chapter3/sparse-embedding/bm25_engine.py:203
↓ 6 callersFunctionget_stock_quote
Get current stock quote information. Args: symbol: Stock ticker symbol (e.g., AAPL, MSFT) Returns: TextCont
chapter4/perception-tools/src/yahoo_finance_tools.py:35
↓ 6 callersMethodget_system_hint
Generate system hint message to append to context
chapter5/coding-agent/system_state.py:26
↓ 6 callersMethodgoto
Navigate this target to a URL.
chapter9/browser-use-rpa/browser-use/browser_use/actor/page.py:277
↓ 6 callersFunctionheading
(ids)
web-astro/scripts/computer-use-layout.mjs:3
↓ 6 callersMethodindex_document
Index a new document and return its ID
chapter3/sparse-embedding/bm25_engine.py:426
↓ 6 callersMethodjson_call
(self, *, provider: str, purpose: str, messages: List[Dict[str, str]], max_tokens: int, key: str)
chapter3/structured-knowledge-extraction/campaign.py:157
↓ 6 callersFunctionload_eval_items
(path: Path = EVAL_PATH)
chapter8/premature-completion-dpo/evaluate.py:80
↓ 6 callersMethodload_test_cases
Load test cases from YAML files Args: category: Optional category filter (layer1, layer2, layer3)
chapter3/contextual-retrieval-for-user-memory/evaluator.py:157
↓ 6 callersFunctionmachineLanguage
(url: URL, base?: string)
web-astro/src/lib/machine-language.ts:4
↓ 6 callersFunctionmake_choice
Build a minimal SDK-shaped chat choice for deterministic Agent tests.
chapter1/web-search-agent/tests/conftest.py:61
↓ 6 callersFunctionmake_llm
按环境变量构造 LLM 客户端(OpenAI 直连优先,缺 Key 时 OpenRouter 兜底)。
chapter9/browser-use-rpa/llm_factory.py:35
↓ 6 callersMethodmark_validated
(self)
chapter9/browser-use-rpa/learning_agent/workflow.py:257
↓ 6 callersMethodmatches
(self, accessor: AccessContext, privilege: PrivilegeType, now: float)
chapter5/permission-embedded-data-objects/pedo/core/models.py:45
← previousnext →401–500 of 13,003, ranked by callers