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
↓ 1,751 callers
Method
append
(self, content: str, path: Path)
chapter9/browser-use-rpa/browser-use/browser_use/filesystem/file_system.py:63
↓ 1,237 callers
Method
get
(self, url: str, **kwargs: Any)
chapter4/perception-tools/test_xquik_tools.py:52
↓ 369 callers
Function
open
(record: Annotation)
web-astro/src/scripts/note-editor.ts:155
↓ 362 callers
Function
set
(tag, values)
web-astro/scripts/context-flow-figures.mjs:4
↓ 355 callers
Method
resolve
Resolve the effective (provider, api_key, base_url, model). Applies the OpenRouter universal fallback: if the requested direct provid
chapter5/coding-agent/config.py:100
↓ 286 callers
Function
round
(index, y)
web-astro/scripts/trajectory-figure.mjs:33
↓ 250 callers
Method
execute
Execute the tool with given parameters Args: params: Tool input parameters Returns:
chapter5/coding-agent/tools/base.py:41
↓ 243 callers
Method
get
Read a single object. Permission check only (no validators/reactions).
chapter5/permission-embedded-data-objects/pedo/core/store.py:136
↓ 226 callers
Method
get
(self)
chapter10/parallel-web-research/message_bus.py:81
↓ 197 callers
Method
encode
(self, texts: List[str], batch_size: int = 16)
chapter3/dense-embedding/cli.py:103
↓ 180 callers
Method
update
Update an object. Full pipeline.
chapter5/permission-embedded-data-objects/pedo/core/store.py:251
↓ 175 callers
Method
run
Execute the task with maximum number of steps
chapter9/browser-use-rpa/browser-use/browser_use/agent/service.py:1399
↓ 157 callers
Method
get
(self, object_id, accessor)
tests/test_ch5_pedo_live_security_eval.py:317
↓ 144 callers
Method
search
(self, **kwargs)
chapter3/mem0/test_agent_v3.py:10
↓ 137 callers
Method
run
按顺序处理若干条用户消息(支持多轮,用于记忆注入场景)。
chapter2/prompt-injection/agent.py:312
↓ 135 callers
Method
open
(self)
chapter10/autonomous-phone-registration/browser.py:32
↓ 131 callers
Method
get
(self, key, default=None)
chapter7/model-action-threshold/tasks/cache_contract/repo/cachelib/cache.py:5
↓ 126 callers
Method
read
(self, _block)
chapter10/voice-werewolf/test_live_human.py:262
↓ 117 callers
Method
stat
(self, attr: str, kind: str)
chapter7/model-benchmark/benchmark.py:262
↓ 113 callers
Method
save
(self, name)
scripts/book_figures/introduction.py:31
↓ 106 callers
Method
write
(self, data)
chapter10/voice-werewolf/demo.py:41
↓ 104 callers
Method
path
(self, points, arrow=False)
scripts/book_figures/introduction.py:27
↓ 94 callers
Method
decode
(self, token_ids, skip_special_tokens=False)
chapter2/attention_visualization/test_streaming.py:60
↓ 94 callers
Method
load
Load configuration from JSON file
chapter3/agentic-rag-for-user-memory/config.py:292
↓ 88 callers
Method
model_dump
(self, **_kwargs)
chapter6/phone-agent/test_agent.py:9
↓ 87 callers
Method
analyze_trajectory
Analyze a full trajectory into an :class:`EfficiencyReport`.
chapter7/agent-cost-analysis/cost_efficiency_analyzer.py:276
↓ 81 callers
Function
resolve_backend
Resolve a provider name into a usable backend. Resolution order: 1. ``gpt-5*`` ids route through OpenRouter when a key is available, because
agentbook/providers/resolution.py:128
↓ 81 callers
Method
text
(self, x, y, value, size=22, bold=False)
scripts/book_figures/introduction.py:23
↓ 75 callers
Method
copy
Create a deep copy of the current rating system.
chapter7/elo-leaderboard/elo_rating.py:162
↓ 73 callers
Method
json
(self)
chapter4/perception-tools/test_pubchem_async.py:17
↓ 73 callers
Method
start
Start the browser session.
chapter9/browser-use-rpa/browser-use/browser_use/browser/session.py:457
↓ 72 callers
Method
commit
(self)
tests/test_ch5_pedo_atomic_delete.py:77
↓ 71 callers
Method
get_or_create_cdp_session
Get or create a CDP session for a target. Args: target_id: Target ID to get session for. If None, uses current agent focus. focus: If True,
chapter9/browser-use-rpa/browser-use/browser_use/browser/session.py:962
↓ 64 callers
Method
log
(self, source: str, text: str)
chapter6/async-agent/runtime.py:138
↓ 64 callers
Function
panel
(f, x, y, w, title, lines, h=None)
scripts/book_figures/chapter5.py:5
↓ 62 callers
Method
cursor
(self, cursor_factory=None)
tests/test_ch5_pedo_atomic_delete.py:74
↓ 61 callers
Method
box
(self, x, y, w, h, fill='#f2f2f2')
scripts/book_figures/introduction.py:20
↓ 61 callers
Method
resolve
( cls, backend: Optional[str] = None, model: Optional[str] = None )
chapter1/search-codegen/config.py:52
↓ 60 callers
Method
close
(self)
chapter7/model-benchmark/campaign.py:292
↓ 58 callers
Method
get
(self, object_id: str, accessor: AccessContext)
chapter5/permission-embedded-data-objects/pedo/eval/dataguardbench/agentspec_wrap.py:177
↓ 55 callers
Method
audit_lines
Audit an in-memory list of parsed JSONL examples.
chapter8/cot-distillation/sft_data_auditor.py:139
↓ 55 callers
Method
json
(self)
chapter3/contextual-retrieval-for-user-memory/test_top_k.py:26
↓ 55 callers
Method
kill
Kill the browser session and reset all state.
chapter9/browser-use-rpa/browser-use/browser_use/browser/session.py:464
↓ 54 callers
Method
find
Find files matching a pattern (similar to Unix find command) Args: pattern: File name pattern (supports wildcard
chapter2/kv-cache/agent.py:181
↓ 48 callers
Method
resolve
解析实际使用的 (api_key, base_url, model, 是否经 OpenRouter)。 仅「OpenAI 原生」条目(base_url 为空)参与回退;带专属 base_url 的条目 (如 Kimi/豆包)保持不变。回退规则:
chapter7/model-benchmark/benchmark.py:72
↓ 47 callers
Method
__new__
(cls)
chapter10/generative-agents/run_campaign.py:46
↓ 47 callers
Function
down
(f, x, start, end)
scripts/book_figures/chapter5.py:15
↓ 47 callers
Method
get_browser_state_summary
( self, cache_clickable_elements_hashes: bool = True, include_screenshot: bool = True, cached: bool =
chapter9/browser-use-rpa/browser-use/browser_use/browser/session.py:1046
↓ 46 callers
Method
act
Execute an action
chapter9/browser-use-rpa/browser-use/browser_use/tools/service.py:1244
↓ 45 callers
Method
connect
Connect to the MCP server.
chapter4/collaboration-tools/client_example.py:22
↓ 43 callers
Method
fetchone
(self)
tests/test_ch5_pedo_atomic_delete.py:47
↓ 42 callers
Function
_turn
( step: str = "turn-1", *, tool: str | None = "query_order", prompt_tokens: int = 100, cac
tests/test_ch6_cost_efficiency_analyzer.py:34
↓ 42 callers
Function
_turn
( step: str = "turn-1", *, tool: str | None = "query_order", prompt_tokens: int = 100, cac
tests/test_ch7_cost_efficiency_analyzer.py:34
↓ 42 callers
Method
model_dump
Custom serialization handling circular references and filtering sensitive data
chapter9/browser-use-rpa/browser-use/browser_use/agent/views.py:326
↓ 42 callers
Method
parse
( self, text: str, typ: type[T] | dict[str, Any], examples: list[ParseDatapoin
chapter2/prompt-engineering/tau_bench/model_utils/api/api.py:292
↓ 41 callers
Method
create
Create a new object. Full pipeline.
chapter5/permission-embedded-data-objects/pedo/core/store.py:206
↓ 40 callers
Method
evaluate
Execute JavaScript in the target. Args: page_function: JavaScript code that MUST start with (...args) => format *args: Arguments to pass to t
chapter9/browser-use-rpa/browser-use/browser_use/actor/page.py:101
↓ 39 callers
Method
get_current_page_url
Get the URL of the current page using CDP.
chapter9/browser-use-rpa/browser-use/browser_use/browser/session.py:1594
↓ 38 callers
Method
ok
(self)
chapter5/agent-creator/validator.py:48
↓ 38 callers
Method
validate_tool_call
Inspect and validate a tool call against security rules and confirmation policies.
chapter9/harness-safety-gate/safety_policy_gate.py:322
↓ 37 callers
Method
format
(self, record)
chapter9/browser-use-rpa/browser-use/browser_use/logging_config.py:95
↓ 36 callers
Method
run
启动所有触发器,运行 duration 秒后停止。
chapter6/agent-with-event-trigger/event_loop_demo.py:188
↓ 35 callers
Function
_get_timeout
Safely parse environment variable timeout values with robust error handling. Args: env_var: Environment variable name (e.g. 'TIMEOUT_NavigateToU
chapter9/browser-use-rpa/browser-use/browser_use/browser/events.py:16
↓ 35 callers
Function
test
(name, fn)
tests/js/auto-translate.test.js:123
↓ 34 callers
Method
check_trajectory
Run all consistency checks and return a structured report.
chapter9/trajectory-verifier/consistency_checker.py:153
↓ 34 callers
Method
write
(self, content: str, path: Path)
chapter9/browser-use-rpa/browser-use/browser_use/filesystem/file_system.py:59
↓ 33 callers
Method
cancel
(self, task_id: str)
chapter6/async-agent/tasks.py:230
↓ 33 callers
Method
raise_for_status
(self)
chapter1/web-search-agent/tests/test_agent.py:25
↓ 31 callers
Method
raise_for_status
(self)
chapter3/contextual-retrieval-for-user-memory/test_top_k.py:29
↓ 30 callers
Method
add
(self, resp)
chapter5/video-edit/agents.py:117
↓ 30 callers
Method
create
(self, *, purpose: str, **request: Any)
chapter4/multimodal-agent/campaign.py:71
↓ 30 callers
Method
read
(self)
chapter9/browser-use-rpa/browser-use/browser_use/filesystem/file_system.py:67
↓ 30 callers
Method
run
Run agent with streaming output Args: user_message: User's input message max_iterations: Maximum num
chapter5/coding-agent/agent.py:122
↓ 29 callers
Method
create
(inner_self, *, purpose: str, **request: Any)
chapter3/user-memory/run_evaluation.py:281
↓ 29 callers
Method
stop
Stop the agent
chapter9/browser-use-rpa/browser-use/browser_use/agent/service.py:1978
↓ 29 callers
Method
wait
(seconds: int = 3)
chapter9/browser-use-rpa/browser-use/browser_use/tools/service.py:260
↓ 27 callers
Function
figureKit
(labels, { rtl = false } = {})
web-astro/scripts/chapter3-figure-kit.mjs:68
↓ 27 callers
Method
render
(self)
book-en/svg_lib.py:522
↓ 27 callers
Method
save
Save configuration to JSON file
chapter3/agentic-rag-for-user-memory/config.py:251
↓ 27 callers
Method
start
(self, command: str)
chapter6/async-agent/tasks.py:106
↓ 26 callers
Method
clear
(self)
chapter1/search-codegen/agent.py:395
↓ 26 callers
Method
clear_all
Clear all data (for testing).
chapter5/permission-embedded-data-objects/pedo/core/store.py:727
↓ 26 callers
Method
get_selector_map
Get the current selector map from cached state or DOM watchdog. Returns: Dictionary mapping element indices to EnhancedDOMTreeNode objects
chapter9/browser-use-rpa/browser-use/browser_use/browser/session.py:1710
↓ 25 callers
Method
analyze_code
Analyze a single code snippet and return a risk assessment.
chapter5/coding-agent/sandbox_evaluator.py:178
↓ 24 callers
Function
compute_mle_elo
Compute Elo ratings using Bradley-Terry model with Maximum Likelihood Estimation. This is the official method used by Chatbot Arena for
chapter7/elo-leaderboard/bradley_terry.py:12
↓ 24 callers
Method
dispatch_and_wait
Dispatch notification and wait for HITL decision or timeout fallback execution.
chapter4/collaboration-tools/src/notification_dispatcher.py:437
↓ 24 callers
Method
execute_action
Execute a registered action with simplified parameter handling
chapter9/browser-use-rpa/browser-use/browser_use/tools/registry/service.py:311
↓ 24 callers
Method
put
(self, key, value)
chapter7/model-action-threshold/tasks/cache_contract/repo/cachelib/cache.py:8
↓ 24 callers
Method
raise_for_status
(self)
chapter4/perception-tools/test_arxiv_request_bounds.py:77
↓ 24 callers
Method
retrieve
Retrieve and rank hybrid results using Reciprocal Rank Fusion (RRF). Args: query: The search query string. top_k: Num
chapter3/structured-index/hybrid_retriever.py:433
↓ 23 callers
Method
arrow
(self, x1, y1, x2, y2, label=None, dash=False, color='border')
book-en/svg_lib.py:424
↓ 23 callers
Method
fetchall
(self)
tests/test_ch5_pedo_atomic_delete.py:51
↓ 22 callers
Method
add
(self, doc_id: str, text: str)
chapter3/agentic-rag-for-user-memory/indexer.py:56
↓ 22 callers
Method
add_raptor_node
Add a RAPTOR tree summary node to the index.
chapter3/structured-index/hybrid_retriever.py:99
↓ 22 callers
Method
delete
Delete a complete cascade atomically, then publish its reactions.
chapter5/permission-embedded-data-objects/pedo/core/store.py:301
↓ 22 callers
Method
from_env
Create configuration from environment variables
chapter3/contextual-retrieval-for-user-memory/config.py:221
↓ 22 callers
Method
send
(self, payload: dict[str, Any])
chapter9/browser-use-rpa/local_mail_sandbox.py:41
↓ 21 callers
Function
_example
(user: str, assistant: str)
tests/test_ch8_sft_data_auditor.py:32
↓ 21 callers
Function
_example
(user: str, assistant: str)
tests/test_ch7_sft_data_auditor.py:32
↓ 21 callers
Method
create
(self, **kwargs)
chapter10/voice-werewolf/test_live_human.py:205
next →
1–100 of 13,003, ranked by callers