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
↓ 3 callers
Function
run_capture
(argv: list[str], cwd: Path | None = None)
chapter7/openvla-robotwin2-eval/experiment.py:59
↓ 3 callers
Method
run_llm_experiment
Run experiment with LLM-based in-context learning agent. Args: num_training_episodes: Number of episodes to trai
chapter1/learning-from-experience/experiment.py:156
↓ 3 callers
Function
run_python
在子进程沙箱中执行 Python 代码,返回 stdout/stderr 文本。 参数: code: 待执行的 Python 源码(模型生成)。 timeout: 超时秒数,超过则终止子进程。 返回: 执行输出(合并 stdout 与
chapter5/code-for-math/sandbox.py:25
↓ 3 callers
Method
run_rl_experiment
Run experiment with traditional Q-learning agent. Args: num_training_episodes: Number of episodes to train n
chapter1/learning-from-experience/experiment.py:43
↓ 3 callers
Method
run_single_task
Runs an agent on a single task and returns TaskResult.
chapter9/hermes-self-evolution/run_downstream_ablation.py:206
↓ 3 callers
Function
safe_task_decomp_generate
Use raw output when valid, otherwise clean deterministic task rows.
chapter10/generative-agents/run_campaign.py:125
↓ 3 callers
Method
save_experiences
Save experiences to file for analysis.
chapter1/learning-from-experience/llm_agent.py:615
↓ 3 callers
Method
save_index
Save the RAPTOR tree index to disk.
chapter3/structured-index/raptor_indexer.py:268
↓ 3 callers
Function
save_report
( path: Path, experiment: str, records: Sequence[RunRecord], config: Optional[Dict[str, Any]]
chapter7/user-memory-system-evaluation/experiment.py:1782
↓ 3 callers
Method
save_trajectory
Save a trajectory to frontend/public/ with unique filename
chapter2/attention_visualization/agent.py:265
↓ 3 callers
Function
scalar_baseline
Simulates the information loss of returning one overall number.
chapter9/trajectory-verifier/verifier.py:428
↓ 3 callers
Function
scrub
(text: str)
chapter7/user-memory-system-evaluation/probe_candidates.py:28
↓ 3 callers
Method
search
Search the knowledge graph. Args: query: Search query top_k: Number of results to return
chapter3/structured-index/graphrag_indexer.py:389
↓ 3 callers
Method
search
Search the index for relevant chunks using retrieval pipeline Args: query: Search query top_k: Numbe
chapter3/contextual-retrieval-for-user-memory/indexer.py:272
↓ 3 callers
Method
search_and_analyze
( self, topic: str, analysis_code: Optional[str] = None )
chapter1/search-codegen/agent.py:352
↓ 3 callers
Method
search_files
Search for files matching a pattern. Args: pattern: Glob pattern (e.g., "*.py", "test_*.txt") direct
chapter4/execution-tools/filesystem_enhanced.py:297
↓ 3 callers
Function
search_knowledge_base
Search a local knowledge base using simple text matching. Args: query: Search query knowledge_base_path: Path to knowled
chapter4/perception-tools/src/search_tools.py:343
↓ 3 callers
Method
search_memories
Search memories by content similarity
chapter3/memobase/agent.py:175
↓ 3 callers
Method
search_memory
Search user memory for relevant information Args: query: Natural language search query top_k: Number
chapter3/agentic-rag-for-user-memory/tools.py:46
↓ 3 callers
Function
search_similar_compounds
Find structurally similar compounds. Args: cid: Reference compound CID similarity_threshold: Minimum similarity (0.0-1.0
chapter4/perception-tools/src/pubchem_tools.py:454
↓ 3 callers
Method
search_tools
按名称/描述做关键词检索,返回命中的工具(用于复用)。
chapter9/self-evolving-tools/tool_manager.py:105
↓ 3 callers
Function
search_wikipedia
Search Wikipedia and get article summary. Args: query: Search query language: Wikipedia language (en, zh, etc.)
chapter4/perception-tools/src/public_data_tools.py:299
↓ 3 callers
Method
search_with_context
Search both contextual chunks and memory cards. Args: query: Search query top_k: Number of results
chapter3/contextual-retrieval-for-user-memory/contextual_indexer.py:422
↓ 3 callers
Function
seed
(store, *objects)
tests/test_ch5_pedo_atomic_delete.py:115
↓ 3 callers
Function
seed_everything
Seed every local RNG used by the self-contained experiments.
chapter6/robotics_lab_common.py:21
↓ 3 callers
Function
select
(language)
extras/auto-translate.js:51
↓ 3 callers
Function
select_core_cards
(cards: Sequence[Dict[str, Any]], test_id: str)
chapter7/user-memory-system-evaluation/experiment.py:611
↓ 3 callers
Function
select_device
Prefer CUDA, then Apple MPS, and optionally reject CPU fallback.
chapter6/robotics_lab_common.py:32
↓ 3 callers
Method
select_option
Select option(s) in a select element.
chapter9/browser-use-rpa/browser-use/browser_use/actor/element.py:530
↓ 3 callers
Function
send_email
Send an email notification. Args: to_email: Recipient email address subject: Email subject body: Email body content
chapter4/collaboration-tools/src/notification_tools.py:12
↓ 3 callers
Method
send_email
(self, account_id: str, recipient: str, subject: str, body: str)
chapter6/agent-with-event-trigger/unipile_mailbox_experiment.py:225
↓ 3 callers
Method
send_event
Send an event to the agent Args: event_type: Type of event (e.g., 'web_message', 'im_message') conte
chapter6/agent-with-event-trigger/client.py:25
↓ 3 callers
Function
send_telegram_message
Send a Telegram message. Args: message: Message text to send chat_id: Optional Telegram chat ID (uses default if not provided
chapter4/collaboration-tools/src/notification_tools.py:199
↓ 3 callers
Function
sequence_client
(payloads)
chapter5/agent-creator/test_creator.py:50
↓ 3 callers
Method
serialize_messages
Convert a list of BaseMessages to Google format, extracting system message. Google handles system instructions separately from the conversation,
chapter9/browser-use-rpa/browser-use/browser_use/llm/google/serializer.py:17
↓ 3 callers
Function
setup_raw_test_data
Create test data in raw database and return IDs.
chapter5/permission-embedded-data-objects/pedo/eval/benchmark_safety_final.py:140
↓ 3 callers
Function
sha256
(path: Path)
chapter6/robotics_lab_common.py:56
↓ 3 callers
Function
sha256
(path: Path)
chapter6/streaming-speech/demo.py:47
↓ 3 callers
Function
sha256_bytes
(value: bytes)
chapter10/parallel-web-research/test_official_experiment.py:11
↓ 3 callers
Function
sha256_bytes
(value: bytes)
chapter10/multi-role-transfer/run_official_experiment.py:57
↓ 3 callers
Function
sha256_file
(path: Path)
chapter5/paper-to-video/campaign.py:35
↓ 3 callers
Function
sha256_file
(path)
chapter5/cad-vs-diffusion/receipts.py:17
↓ 3 callers
Function
sha256_file
(path: Path)
chapter2/system-hint/run_experiment_2_8.py:35
↓ 3 callers
Function
sha256_text
(text: str)
chapter2/local_llm_serving/run_experiment.py:39
↓ 3 callers
Function
sha256_text
(text: str)
chapter10/book-translation/run_official_experiment.py:38
↓ 3 callers
Method
snapshot
(self)
chapter9/browser-use-rpa/local_mail_sandbox.py:55
↓ 3 callers
Function
solve
用 python-constraint 求解,返回所有满足约束的赋值(dict name->bool)列表。 names : 居民名字列表 structs : dict name -> 该居民陈述的结构化 DSL
chapter5/code-for-logic/csp_solver.py:59
↓ 3 callers
Method
solve
( self, env: Env, task_index: Optional[int] = None, max_num_steps: int = 30 )
chapter2/prompt-engineering/tau_bench/agents/base.py:11
↓ 3 callers
Function
sourceEntries
(source, figure, expectedLabels, expectedShape)
web-astro/scripts/evolution-flow-figures.mjs:9
↓ 3 callers
Function
sourceLabels
(source, figure)
web-astro/scripts/evaluation-overview-figures.mjs:34
↓ 3 callers
Function
splitIntoGroups
(entries, figure, classify, requiredGroups)
web-astro/scripts/evolution-flow-figures.mjs:61
↓ 3 callers
Function
stack
(entries, x, y, width, height, options = {})
web-astro/scripts/evolution-flow-figures.mjs:95
↓ 3 callers
Method
start
Start the vLLM server Args: wait_for_ready: Wait for server to be ready timeout: Maximum time to wai
chapter2/local_llm_serving/server.py:65
↓ 3 callers
Method
start_device_authorization
Start the device authorization flow. Returns device authorization details including user code and verification URL.
chapter9/browser-use-rpa/browser-use/browser_use/sync/auth.py:123
↓ 3 callers
Method
start_session
Start a new interactive session.
chapter3/mem0/main.py:32
↓ 3 callers
Function
stopRecording
()
chapter6/live-audio/frontend/pages/index.tsx:455
↓ 3 callers
Function
str_equal
(s1: str, s2: str)
chapter2/prompt-engineering/tau_bench/model_utils/api/datapoint.py:93
↓ 3 callers
Function
strategy_acceptance_passes
(result)
chapter10/voice-werewolf/werewolf/strategy_audit.py:62
↓ 3 callers
Function
stream_once
发起一次流式请求,返回 TTFT、总时长、输出 token 数与解码吞吐。 - ttft:从发起请求到收到第一个内容或推理分片的时间(秒) - total:整个响应的墙钟时间(秒) - output_tokens:优先取服务端返回的 usage.completion_tok
chapter2/local_llm_serving/benchmark.py:86
↓ 3 callers
Method
submit_and_evaluate
Submit an agent's response and get evaluation result. Args: test_id: The test case ID agent_response
chapter3/user-memory-evaluation/framework.py:206
↓ 3 callers
Method
sync_to_disk
(self, path: Path)
chapter9/browser-use-rpa/browser-use/browser_use/filesystem/file_system.py:154
↓ 3 callers
Function
tag
(element, attributes)
web-astro/scripts/tool-cache-layout.mjs:28
↓ 3 callers
Function
tag
(element, attributes)
web-astro/scripts/coding-production-layout.mjs:54
↓ 3 callers
Function
timing_evidence
(bus: MessageBus)
chapter10/autonomous-phone-registration/orchestration.py:428
↓ 3 callers
Method
to_dict
Convert to dictionary
chapter5/coding-agent/tools/base.py:19
↓ 3 callers
Method
to_dict
(self)
chapter2/attention_visualization/main.py:32
↓ 3 callers
Method
to_dict
(self)
chapter9/browser-use-rpa/browser-use/browser_use/dom/views.py:220
↓ 3 callers
Method
to_dict
(self)
chapter3/agentic-rag-for-user-memory/agent.py:52
↓ 3 callers
Method
to_dict
Convert to dictionary for storage
chapter3/contextual-retrieval-for-user-memory/advanced_memory_manager.py:40
↓ 3 callers
Method
to_dict
(self)
chapter3/contextual-retrieval-for-user-memory/agent.py:52
↓ 3 callers
Method
to_json
(self)
chapter5/provider-failover/neutral_trace.py:100
↓ 3 callers
Method
tool_result
(self, call_id: str, name: str, content: str)
chapter5/provider-failover/neutral_trace.py:76
↓ 3 callers
Method
total_completion_tokens
(self)
chapter7/agent-cost-analysis/tracer.py:182
↓ 3 callers
Method
total_cost
(self)
chapter7/agent-cost-analysis/tracer.py:173
↓ 3 callers
Method
total_duration_seconds
Get total duration of all steps in seconds
chapter9/browser-use-rpa/browser-use/browser_use/agent/views.py:376
↓ 3 callers
Method
total_prompt_tokens
(self)
chapter7/agent-cost-analysis/tracer.py:176
↓ 3 callers
Method
total_tool_ctx_tokens
(self)
chapter7/agent-cost-analysis/tracer.py:188
↓ 3 callers
Method
train
Train the agent for multiple episodes. Args: num_episodes: Number of episodes to train verbose: Whet
chapter1/learning-from-experience/rl_agent.py:173
↓ 3 callers
Function
translatePath
(cleanPath, fromCode, toCode)
extras/lang-switcher.js:94
↓ 3 callers
Function
translation_guide
按目标语言生成翻译指南。默认中文,保持与旧行为一致。
chapter10/book-translation/agents.py:311
↓ 3 callers
Method
trigger_rollback
Trigger automated state rollback by invoking all registered rollback handlers.
chapter9/harness-safety-gate/safety_policy_gate.py:130
↓ 3 callers
Method
update_memory
Update an existing memory item
chapter3/user-memory/memory_manager.py:100
↓ 3 callers
Method
update_q_value
Update Q-value using the Q-learning update rule. Q(s,a) <- Q(s,a) + α[r + γ max Q(s',a') - Q(s,a)]
chapter1/learning-from-experience/rl_agent.py:99
↓ 3 callers
Method
use_openrouter
True when a model's own provider key is missing but OpenRouter is available -> the call should be routed through OpenRouter.
chapter4/multimodal-agent/config.py:148
↓ 3 callers
Function
utc_now
()
chapter8/prompt-distillation/run_experiment_8_8.py:85
↓ 3 callers
Function
utc_now
()
chapter6/computer-use-open-model/main.py:26
↓ 3 callers
Function
utc_now
()
chapter10/parallel-web-research/run_official_experiment.py:51
↓ 3 callers
Function
utc_now
()
chapter10/multi-role-transfer/run_official_experiment.py:47
↓ 3 callers
Function
utc_now
()
chapter3/experiment_utils.py:24
↓ 3 callers
Function
valid_checkpoint
( path: Path, test_id: str, experiment: str, expected_records: int, required_ok_cells: Opt
chapter7/user-memory-system-evaluation/run_full.py:34
↓ 3 callers
Function
validate
(data: dict[str, Any], evidence_dir: Path | None = None)
chapter6/rgb-sim2real-grasping/validate_evidence.py:22
↓ 3 callers
Function
validate
(data: dict[str, Any], evidence_dir: Path | None = None)
chapter6/xlerobot-teleoperation/validate_evidence.py:22
↓ 3 callers
Function
validate
(data: dict[str, Any], evidence_dir: Path | None = None)
chapter6/gemini-xlerobot-navigation/validate_evidence.py:24
↓ 3 callers
Function
validate
(payload: Dict[str, Any])
chapter1/web-search-agent/run_experiment_1_2.py:91
↓ 3 callers
Method
validate
Validate required configuration Returns: True if configuration is valid
chapter2/context-compression/config.py:62
↓ 3 callers
Function
validate_and_display_output
Validate the JSON output against the schema and display results. Args: output: Raw JSON string from the task schema_model: Pydantic mode
chapter9/browser-use-rpa/browser-use/examples/cloud/03_structured_output.py:181
↓ 3 callers
Function
validate_asean
( result: Dict[str, Any], reference: Optional[Dict[str, Any]] = None )
chapter1/search-codegen/run_experiment_1_3.py:129
↓ 3 callers
Function
validate_candidate
(workflow: Workflow)
chapter9/browser-use-rpa/workflow_validation_demo.py:139
↓ 3 callers
Method
validate_credentials_format
Validate that the credentials file has the correct format. Returns (is_valid, error_message)
chapter9/browser-use-rpa/browser-use/examples/integrations/gmail_2fa_integration.py:58
↓ 3 callers
Function
validate_judge_response
(payload: dict[str, Any])
chapter10/book-translation/run_official_experiment.py:180
← previous
next →
1,501–1,600 of 13,003, ranked by callers