Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bojieli/ai-agent-book
/ functions
Functions
13,003 in github.com/bojieli/ai-agent-book
⨍
Functions
13,003
◇
Types & classes
1,574
↳
Endpoints
161
↓ 4 callers
Method
save_memory
Save advanced JSON memory cards to storage
chapter3/user-memory/memory_manager.py:569
↓ 4 callers
Method
save_memory
Save memory cards to storage
chapter3/contextual-retrieval-for-user-memory/advanced_memory_manager.py:118
↓ 4 callers
Method
search
(self, query: str, top_k: int = 3)
chapter3/structured-index/structured_vs_flat_demo.py:118
↓ 4 callers
Method
search
Search for documents matching the query
chapter3/sparse-embedding/bm25_engine.py:465
↓ 4 callers
Function
selected
()
extras/auto-translate.js:40
↓ 4 callers
Function
send_slack_message
Send a Slack message via webhook. Args: message: Message text to send webhook_url: Optional Slack webhook URL (uses default i
chapter4/collaboration-tools/src/notification_tools.py:264
↓ 4 callers
Function
separator
(x1, y1, x2, y2)
web-astro/scripts/collaboration-context-figures.mjs:79
↓ 4 callers
Function
setState
(state)
extras/auto-translate.js:303
↓ 4 callers
Method
set_path
(self, path: Path)
chapter10/generative-agents/provider_adapter.py:65
↓ 4 callers
Method
setup
Initialize Playwright and browser.
chapter9/browser-use-rpa/learning_agent/replay.py:48
↓ 4 callers
Function
setup_logging
Setup logging configuration for browser-use. Args: stream: Output stream for logs (default: sys.stdout). Can be sys.stderr for MCP mode. log_lev
chapter9/browser-use-rpa/browser-use/browser_use/logging_config.py:64
↓ 4 callers
Function
sha256
(path: Path)
chapter7/openvla-robotwin2-eval/finalize_evidence.py:30
↓ 4 callers
Function
sha256
(path: Path)
chapter2/agent-skills-ppt/validate_official_run.py:23
↓ 4 callers
Function
sha256_bytes
(value: bytes)
chapter2/system-hint/run_experiment_2_8.py:31
↓ 4 callers
Function
sha256_bytes
(value: bytes)
chapter10/parallel-web-research/run_official_experiment.py:61
↓ 4 callers
Function
sha256_bytes
(value: bytes)
chapter10/multi-role-transfer/test_official_experiment.py:11
↓ 4 callers
Function
sha256_file
(path: Path)
chapter8/MiniMind-pretrain/validation/run_training_report_audit.py:96
↓ 4 callers
Function
sha256_file
(path: Path)
chapter8/continued-pretraining/validation/run_report_audit.py:80
↓ 4 callers
Function
shapes
(root)
book-vi/fix_svg_text_layout.py:209
↓ 4 callers
Function
simple_search
Search Google and extract content from multiple top results. Args: query: Search query to process max_websites: Number of websites to pr
chapter9/browser-use-rpa/browser-use/examples/cloud/05_search_api.py:41
↓ 4 callers
Function
siteBasePath
()
extras/lang-switcher.js:330
↓ 4 callers
Method
start
(self)
chapter10/autonomous-phone-registration/webrtc_channel.py:534
↓ 4 callers
Function
state
(store)
tests/test_ch5_pedo_atomic_delete.py:121
↓ 4 callers
Method
stop_browser
Stop a cloud browser session. Args: session_id: Session ID to stop. If None, uses current session. Returns: CloudBrowserResponse: Updated
chapter9/browser-use-rpa/browser-use/browser_use/browser/cloud.py:127
↓ 4 callers
Method
stop_playback
Mark TTS playback as inactive and clear pending audio stream.
chapter6/streaming-speech/interruption_manager.py:95
↓ 4 callers
Method
submit_user_message
提交一条用户消息(demo 用它模拟用户输入)。
chapter6/async-agent/runtime.py:156
↓ 4 callers
Function
summarize_arm
( mode: ContextMode, result: Dict[str, Any], elapsed: float, task_text: str = CANONICAL_TASK,
chapter1/context/run_experiment_1_1.py:358
↓ 4 callers
Function
summarize_offline
离线路径:不调用 LLM,用确定性模板把提交 JSON 解析成订票摘要。 这一步只是字符串格式化(不是伪造 LLM 输出),用来演示"解析 JSON → 继续任务" 的闭环;在线模式下这段由 continue_task() 交给模型完成。
chapter5/dynamic-form/demo.py:525
↓ 4 callers
Method
sync_to_disk_sync
(self, path: Path)
chapter9/browser-use-rpa/browser-use/browser_use/filesystem/file_system.py:122
↓ 4 callers
Function
task_receipt
(state: TaskState)
chapter6/async-agent/run_real_experiment.py:42
↓ 4 callers
Function
text_of
(node)
book-vi/fix_svg_text_layout.py:166
↓ 4 callers
Method
to_dict
(self)
chapter3/contextual-retrieval/tools.py:23
↓ 4 callers
Method
to_dict
(self)
chapter3/agentic-rag/tools.py:23
↓ 4 callers
Method
total_cached_tokens
(self)
chapter7/agent-cost-analysis/tracer.py:179
↓ 4 callers
Method
total_tokens
(self)
chapter10/book-translation/agents.py:223
↓ 4 callers
Method
transcribe
(audioBuffer, options = {})
chapter6/live-audio/backend/utils/providers/asrProviders.js:55
↓ 4 callers
Function
undo_move
Undo the last move. Returns: Dictionary with board state after undo
chapter4/collaboration-tools/src/chess_tools.py:330
↓ 4 callers
Method
update_content
(self, content: str)
chapter9/browser-use-rpa/browser-use/browser_use/filesystem/file_system.py:47
↓ 4 callers
Method
urls
Get all unique URLs from history
chapter9/browser-use-rpa/browser-use/browser_use/agent/views.py:506
↓ 4 callers
Method
user
(self, text: str)
chapter5/provider-failover/neutral_trace.py:73
↓ 4 callers
Function
utc_now
()
chapter7/openvla-robotwin2-eval/experiment.py:37
↓ 4 callers
Function
utc_now
()
chapter7/model-action-threshold/experiment.py:141
↓ 4 callers
Function
utc_now
()
chapter2/local_llm_serving/run_experiment.py:43
↓ 4 callers
Method
validate
Validate configuration (fallback-aware).
chapter5/coding-agent/config.py:158
↓ 4 callers
Function
validate_manifest
缺键或结构不符即抛 AssertionError。
chapter5/cad-vs-diffusion/validate_manifest.py:34
↓ 4 callers
Method
vote
(self, candidates: List[str], players: List[str])
chapter10/voice-werewolf/werewolf/simulator.py:445
↓ 4 callers
Function
wait_for_completion
Wait for task completion and return results.
chapter9/browser-use-rpa/browser-use/examples/cloud/04_proxy_usage.py:166
↓ 4 callers
Method
wait_until_idle
阻塞直到系统持续空闲 stable 秒(或超时)。
chapter6/async-agent/runtime.py:347
↓ 4 callers
Function
write_excel_data
Write data to Excel file. Args: file_path: Path to Excel file data: Dictionary of {sheet_name: [rows]} overwrite
chapter4/collaboration-tools/src/excel_tools.py:77
↓ 4 callers
Function
write_json
(path: Path, value: object)
chapter8/MiniMind-pretrain/validation/test_training_report_audit.py:18
↓ 4 callers
Function
write_json
(path: Path, value: Any)
chapter6/computer-use-open-model/evidence.py:21
↓ 4 callers
Function
write_jsonl
(path: Path, rows: Iterable[dict[str, Any]])
chapter8/prompt-distillation/run_experiment_8_8.py:107
↓ 3 callers
Method
__init__
(self, model: str, provider: str, seed: Optional[int] = None)
chapter2/prompt-engineering/tau_bench/envs/user.py:41
↓ 3 callers
Method
__init__
Initialize memory manager Args: user_id: Unique identifier for the user verbose: Whether to print de
chapter3/user-memory/memory_manager.py:71
↓ 3 callers
Method
__json__
(self)
chapter9/browser-use-rpa/browser-use/browser_use/dom/views.py:228
↓ 3 callers
Function
_all_receipts
()
chapter4/perception-tools/test_experiment_4_2.py:38
↓ 3 callers
Method
_append
把事件追加到轨迹,并打印轨迹留痕。
chapter6/async-agent/runtime.py:141
↓ 3 callers
Function
_arm_result
(final_answer, *, mode=ContextMode.NO_TOOL_CALLS, iterations=1)
chapter1/context/test_experiment_1_1.py:77
↓ 3 callers
Function
_assert_no_symlinks
(path: Path)
chapter4/perception-tools/src/filesystem_tools.py:109
↓ 3 callers
Function
_assistant_text
(trajectory: Dict[str, Any])
chapter9/trajectory-verifier/verifier.py:64
↓ 3 callers
Method
_audit_code_blocks
Audit code block synchronization matching source.
chapter10/book-translation/consistency_auditor.py:268
↓ 3 callers
Method
_audit_link_targets
Audit link targets across translated Markdown files.
chapter10/book-translation/consistency_auditor.py:411
↓ 3 callers
Function
_bare_agent
()
chapter10/staged-system-prompt/tests/test_null_tool_args.py:14
↓ 3 callers
Method
_build_command_script
Wrap a command with platform-specific completion markers.
chapter5/coding-agent/tools/shell_session.py:111
↓ 3 callers
Method
_build_messages
Build messages for the LLM including conversation history
chapter3/contextual-retrieval/agent.py:154
↓ 3 callers
Method
_build_messages
Build messages for the LLM including conversation history
chapter3/agentic-rag/agent.py:213
↓ 3 callers
Method
_build_responses_request
( self, input_text: str, *, use_tools: bool = True, tool_choice: Liter
chapter1/search-codegen/agent.py:78
↓ 3 callers
Function
_carried_text
(step)
chapter5/provider-failover/renderers.py:30
↓ 3 callers
Method
_cdp_close_page
Close a page/tab using CDP Target.closeTarget.
chapter9/browser-use-rpa/browser-use/browser_use/browser/session.py:1855
↓ 3 callers
Method
_cdp_get_cookies
Get cookies using CDP Network.getCookies.
chapter9/browser-use-rpa/browser-use/browser_use/browser/session.py:1859
↓ 3 callers
Function
_char_w
(ch, mono=False)
book-ar/svg_lib.py:110
↓ 3 callers
Method
_clean_cache_messages
Clean cache settings so only the last cache=True message remains cached. Because of how Claude caching works, only the last cache message matters.
chapter9/browser-use-rpa/browser-use/browser_use/llm/anthropic/serializer.py:243
↓ 3 callers
Function
_client
构造 OpenAI 客户端。端点、key 与模型名映射统一由 agentbook 的 provider 注册表维护。 PPT_PROVIDER / --provider 是读者的显式选择,注册表会原样尊重;auto 只是本 实验的默认策略,因此 chosen_by_read
chapter5/paper-to-ppt/agents.py:109
↓ 3 callers
Function
_client_and_model
Build an OpenAI-compatible client + model, with OpenRouter fallback. Uses OPENAI_API_KEY directly when present; otherwise routes through OPEN
chapter4/collaboration-tools/src/intelligence_tools.py:20
↓ 3 callers
Method
_close_session
Close a specific browser session.
chapter9/browser-use-rpa/browser-use/browser_use/mcp/server.py:953
↓ 3 callers
Function
_commit
(repository: Path, message: str, date: str)
tests/test_git_revision_dates.py:173
↓ 3 callers
Function
_compute_ratings
(df: pd.DataFrame, method: str, k: float, init_rating: float, bootstrap: int)
chapter7/elo-leaderboard/cli.py:100
↓ 3 callers
Function
_counts
(values: Iterable[str])
chapter7/model-benchmark/analysis.py:117
↓ 3 callers
Function
_create_mock_agent
(execute_return_value)
tests/test_ch1_ch2_system_hint_tool_error_null.py:16
↓ 3 callers
Function
_derive_claims_and_promises
(messages: list[dict[str, Any]], tool_calls: list[dict[str, Any]])
chapter9/trajectory-verifier/customer_service_env.py:184
↓ 3 callers
Function
_email
(kind: str, date: str, suffix: str)
chapter6/agent-with-event-trigger/test_unipile_mailbox_experiment.py:23
↓ 3 callers
Method
_enforce
(self, tool: str, args: dict, ctx: dict)
chapter5/permission-embedded-data-objects/pedo/eval/dataguardbench/agentspec_wrap.py:192
↓ 3 callers
Function
_ensure_all_loggers_use_stderr
Ensure ALL loggers only output to stderr, not stdout.
chapter9/browser-use-rpa/browser-use/browser_use/mcp/server.py:101
↓ 3 callers
Function
_error_hint
给 provider 故障补一句可操作的提示。 交互模式下最常见的两种失败是速率限制和请求超时,而且两者常常连在一起: 429 会被 SDK 自动重试,重试把超时预算耗完之后,用户只看到一句 "Request timed out",很容易误判成网络问题或模型能力问题。
chapter1/web-search-agent/agent.py:66
↓ 3 callers
Function
_eval_assertion
(assertion: Dict[str, Any], traj: Dict[str, Any])
chapter5/log-diagnosis/replay.py:52
↓ 3 callers
Method
_evaluate_generic
Generic evaluation for unspecified task types
chapter3/memobase/locomo_benchmark.py:392
↓ 3 callers
Method
_event
(self, type_: str, **data)
chapter10/voice-werewolf/werewolf/human.py:47
↓ 3 callers
Method
_execute_agent_query
Executes or parses ``agent_query_or_code`` against the real store. Returns a dict with: - ``executed``: whether the query was execu
chapter5/permission-embedded-data-objects/run_live_security_eval.py:267
↓ 3 callers
Method
_execute_tool_calls
Execute tool calls and return results in order. Multiple tool calls in the same turn are executed in parallel (they are indep
chapter2/local_llm_serving/ollama_native.py:76
↓ 3 callers
Function
_extract_added_memories
Return facts appended by mem0's v3 ADD-only extraction pass.
chapter3/mem0/agent.py:43
↓ 3 callers
Method
_extract_pdf_to_text
Extract PDF to text using OCR with thinking mode
chapter4/multimodal-agent/agent.py:622
↓ 3 callers
Method
_fetch_and_cache_pricing_data
Fetch pricing data from LiteLLM GitHub and cache it with timestamp
chapter9/browser-use-rpa/browser-use/browser_use/tokens/service.py:137
↓ 3 callers
Function
_fingerprint
Return a deterministic content receipt for one file or directory.
chapter4/perception-tools/src/filesystem_tools.py:118
↓ 3 callers
Function
_fixed_system_prompt
()
chapter10/multi-role-transfer/skill_orchestrator.py:115
↓ 3 callers
Method
_format_size
Format file size in human-readable format.
chapter4/execution-tools/filesystem_enhanced.py:670
↓ 3 callers
Method
_format_tokens
Format token count with k suffix for thousands
chapter9/browser-use-rpa/browser-use/browser_use/tokens/service.py:433
↓ 3 callers
Function
_frame_set
(source: Path, timestamps: list[float], directory: Path)
chapter5/video-edit/campaign.py:84
↓ 3 callers
Method
_get_db_config
Load and migrate config.json.
chapter9/browser-use-rpa/browser-use/browser_use/config.py:400
↓ 3 callers
Method
_get_detailed_error
Get detailed error information for debugging
chapter2/system-hint/agent.py:510
↓ 3 callers
Method
_get_memory_context
Get current memory context as a string
chapter3/user-memory/agent.py:299
← previous
next →
1,001–1,100 of 13,003, ranked by callers