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
↓ 2 callers
Function
_source_then_target
源厂商(Kimi)完成前两次工具调用,之后切到目标厂商并让它失败。
chapter5/provider-failover/tests/test_offline.py:221
↓ 2 callers
Function
_spec
()
chapter5/agent-creator/reference_agent/domain_tools.py:13
↓ 2 callers
Method
_split_diff
r""" Return list of up to 4 rectangles = a \ b. Assumes a intersects b.
chapter9/browser-use-rpa/browser-use/browser_use/dom/serializer/paint_order.py:47
↓ 2 callers
Function
_split_paragraphs
按空行切出正文段落,剔除标题行与表格/图片,供脚本化排版使用。
chapter5/paper-to-ppt/demo.py:209
↓ 2 callers
Function
_ss_pedo_user_id
(store, username)
chapter5/permission-embedded-data-objects/pedo/eval/baxbench_adapter/reference_impls.py:170
↓ 2 callers
Method
_start_session
Start a new session
chapter3/user-memory/agent.py:158
↓ 2 callers
Function
_static_prefix_hashes
Hash the system+tools prefix as a mechanism proxy, not a cache claim.
chapter10/multi-role-transfer/run_comparison.py:58
↓ 2 callers
Function
_stats
(latencies)
chapter5/permission-embedded-data-objects/pedo/eval/benchmark_reactions.py:398
↓ 2 callers
Method
_stats_from_calls
( calls: list[dict[str, Any]], *, strategy: str, repair_attempts: int = 0 )
chapter5/agent-creator/creator.py:753
↓ 2 callers
Method
_step
()
extras/agent-lab/agent-trajectory.js:406
↓ 2 callers
Method
_stop_monitoring
Stop the monitoring loop.
chapter9/browser-use-rpa/browser-use/browser_use/browser/watchdogs/crash_watchdog.py:214
↓ 2 callers
Method
_store_object
(self, obj: DataObject)
chapter5/permission-embedded-data-objects/pedo/core/store.py:635
↓ 2 callers
Method
_stream_response
Stream response from the model Args: messages: Conversation messages Returns: C
chapter2/context-compression/agent.py:353
↓ 2 callers
Method
_stream_response
Stream response from the model
chapter4/multimodal-agent/agent.py:874
↓ 2 callers
Method
_stream_response
Stream response content
chapter3/contextual-retrieval/agent.py:290
↓ 2 callers
Method
_stream_response
Stream response content
chapter3/agentic-rag/agent.py:365
↓ 2 callers
Function
_strip_code
去掉围栏代码块与行内代码:代码按翻译指南原样保留英文,不应计入术语一致性统计。
chapter10/book-translation/consistency.py:30
↓ 2 callers
Method
_strip_code
Remove code blocks and inline code from text before terminology check.
chapter10/book-translation/consistency_auditor.py:175
↓ 2 callers
Function
_structural_check
(root: Path)
chapter5/agent-creator/validator.py:81
↓ 2 callers
Function
_stub_gemini
(monkeypatch, payload: dict)
chapter7/tts-quality-eval/tests/test_judge_robustness.py:87
↓ 2 callers
Function
_stub_judge
(monkeypatch, payload: dict)
chapter7/tts-quality-eval/tests/test_judge_robustness.py:46
↓ 2 callers
Function
_successful_calls
(trajectory: Dict[str, Any])
chapter9/trajectory-verifier/verifier.py:36
↓ 2 callers
Function
_synthetic_values
()
chapter10/autonomous-phone-registration/run_acceptance.py:106
↓ 2 callers
Method
_system_prompt
(self, players: List[str])
chapter10/voice-werewolf/werewolf/agent.py:124
↓ 2 callers
Function
_temp_for
推理模型(gpt-5 / o 系列等)不接受 temperature=0。
chapter5/dynamic-form/demo.py:102
↓ 2 callers
Method
_temporary_dir
Create an execution directory inside the configured workspace.
chapter4/execution-tools/multilang_executor.py:309
↓ 2 callers
Function
_temporary_recovery
(namespace: dict[str, Any])
chapter9/self-modifying-agent/sandbox_runner.py:38
↓ 2 callers
Function
_text_response
(*, success: bool, message: Any, metadata: dict[str, Any])
chapter4/perception-tools/src/xquik_tools.py:17
↓ 2 callers
Method
_tf
(text: str)
chapter3/structured-index/structured_vs_flat_demo.py:112
↓ 2 callers
Function
_timeout_error
()
chapter1/web-search-agent/tests/test_agent.py:295
↓ 2 callers
Function
_to_openrouter_model
把模型名映射到 OpenRouter 命名空间(用于无 OPENAI_API_KEY 的回退路径)。
chapter10/voice-werewolf/werewolf/agent.py:31
↓ 2 callers
Function
_tokenize
Lowercase alphanumeric tokens of length > 1.
chapter9/trajectory-verifier/consistency_checker.py:106
↓ 2 callers
Function
_tokenize
Lightweight tokenizer shared by the local backend (alphanumeric + CJK).
chapter3/agentic-rag-for-user-memory/indexer.py:26
↓ 2 callers
Function
_tokenize
Tokenise mixed Chinese/English text. Prefers jieba; otherwise emits ASCII words plus Chinese character uni- and bi-grams, which is enough for
chapter3/agentic-rag/offline_retriever.py:30
↓ 2 callers
Method
_tool_add_memory
Add a new memory
chapter3/user-memory/agent.py:428
↓ 2 callers
Function
_tool_call
(name, **arguments)
tests/test_ch2_ollama_native_nonstream_react_loop.py:32
↓ 2 callers
Method
_tool_call
(self, *, tool_name: str, description: str, properties: dict, required: List[str], instruct
chapter10/voice-werewolf/werewolf/simulator.py:298
↓ 2 callers
Method
_tool_code_interpreter
Execute Python code in restricted environment
chapter6/agent-with-event-trigger/agent.py:941
↓ 2 callers
Method
_tool_code_interpreter
Execute Python code in restricted environment
chapter2/system-hint/agent.py:692
↓ 2 callers
Method
_tool_execute_command
Execute shell command
chapter2/system-hint/agent.py:722
↓ 2 callers
Method
_tool_items
(response: Dict[str, Any])
chapter1/search-codegen/agent.py:133
↓ 2 callers
Function
_traj_path
(data_dir)
chapter5/log-diagnosis/demo.py:72
↓ 2 callers
Method
_transcribe
(self, wav_path: Path, *, kind: str)
chapter10/voice-werewolf/werewolf/human.py:73
↓ 2 callers
Method
_transition_result
计算阶段转换工具要回给模型的 tool 结果字符串,并返回一个 descriptor 描述“稍后要执行的切换动作”。此函数只记录日志,不改动 history / 阶段。 返回 (tool_result_str, descriptor_dict)。
chapter10/staged-system-prompt/agent.py:388
↓ 2 callers
Function
_try_call
(func, test_data)
chapter5/permission-embedded-data-objects/pedo/eval/benchmark_safety_v2.py:243
↓ 2 callers
Function
_unwrap
工具返回 TextContent(JSON) 或裸 JSON 字符串,统一解析成 dict。
chapter4/perception-tools/cli.py:231
↓ 2 callers
Method
_update_object
(self, obj: DataObject)
chapter5/permission-embedded-data-objects/pedo/core/store.py:658
↓ 2 callers
Method
_update_session_activity
Update the last activity time for a session.
chapter9/browser-use-rpa/browser-use/browser_use/mcp/server.py:921
↓ 2 callers
Function
_usage_cost
(usage: dict[str, Any], pricing: dict[str, Any])
chapter5/agent-creator/creator.py:170
↓ 2 callers
Function
_usage_dict
(value)
chapter10/voice-werewolf/werewolf/simulator.py:32
↓ 2 callers
Function
_utc_now
()
chapter1/image-gen-workflow/pipeline.py:83
↓ 2 callers
Function
_validated_currency
(value: str)
chapter7/user-memory-system-evaluation/experiment.py:80
↓ 2 callers
Function
_validated_iso_date
(value: str, field_name: str)
chapter7/user-memory-system-evaluation/experiment.py:72
↓ 2 callers
Function
_validated_source_url
(value: str)
chapter7/user-memory-system-evaluation/experiment.py:87
↓ 2 callers
Function
_webrtc_answer_plan
(raw: str, fields)
chapter10/autonomous-phone-registration/demo.py:96
↓ 2 callers
Method
_witch_act
(self, killed: Optional[str])
chapter10/voice-werewolf/werewolf/game.py:279
↓ 2 callers
Method
_wolves_act
(self)
chapter10/voice-werewolf/werewolf/game.py:209
↓ 2 callers
Function
_workbook
(path: Path, n_rows: int)
chapter4/collaboration-tools/src/test_excel_max_rows_all_sheets.py:12
↓ 2 callers
Method
_wrap_external
第 3 层防御:给外部内容打上来源标记,做数据/指令通道分离。
chapter2/prompt-injection/agent.py:230
↓ 2 callers
Function
_wrap_line
Greedy word-wrap of one logical line to fit avail_w pixels.
book-en/svg_lib.py:146
↓ 2 callers
Function
_wrap_line
Greedy word-wrap of one logical line to fit avail_w pixels.
book-tr/svg_lib.py:146
↓ 2 callers
Function
_wrap_line
Greedy word-wrap of one logical line to fit avail_w pixels.
book-ru/svg_lib.py:146
↓ 2 callers
Function
_wrap_line
Greedy word-wrap of one logical line to fit avail_w pixels.
book-es/svg_lib.py:146
↓ 2 callers
Function
_wrap_line
Нэг логик мөрийг avail_w пикселд багтаан үгээр нь тасална.
book-mn/svg_lib.py:146
↓ 2 callers
Function
_wrap_line
Greedy word-wrap of one logical line to fit avail_w pixels.
book-id/svg_lib.py:146
↓ 2 callers
Function
_wrap_text
Wrap text to fit within a given width. Args: text: Text to wrap font: Font to use for text max_width: Maximum width in pixels Ret
chapter9/browser-use-rpa/browser-use/browser_use/agent/gif.py:392
↓ 2 callers
Function
_write_evidence
(path: Path, payload: Any, *, forbidden_secret: str)
chapter5/agent-creator/creator.py:1505
↓ 2 callers
Function
_write_index
(site: Path, locations)
tests/test_split_search_index.py:69
↓ 2 callers
Function
_write_json
(path: Path, value: Any)
chapter5/video-edit/campaign.py:48
↓ 2 callers
Function
_write_json
(path: Path, value: Any)
chapter5/log-diagnosis/campaign.py:53
↓ 2 callers
Function
_write_output
(path, mode, today, passed, total, results)
chapter5/erp-agent/demo.py:214
↓ 2 callers
Function
_write_trace
(tmp_path, scenarios)
chapter7/agent-cost-analysis/tests/test_trace_offline.py:70
↓ 2 callers
Method
_write_wav
(self, frames, path: Path)
chapter10/voice-werewolf/werewolf/human.py:85
↓ 2 callers
Function
_ym
(d: date)
chapter5/erp-agent/reference.py:20
↓ 2 callers
Function
acceptance
Multi-provider policy: any eligible backend may close the experiment.
chapter1/search-codegen/run_experiment_1_3.py:261
↓ 2 callers
Method
acceptance_receipt
Return only transport metadata; no prompt, answer, audio, or transcript.
chapter10/autonomous-phone-registration/webrtc_channel.py:628
↓ 2 callers
Function
accepted_receipt
(call: dict)
chapter2/system-hint/run_experiment_2_8.py:445
↓ 2 callers
Function
accepted_receipt
(call: dict[str, Any], model: str)
chapter2/prompt-injection/run_campaign.py:51
↓ 2 callers
Method
accepts
(self, env: Envelope)
chapter10/parallel-web-research/message_bus.py:78
↓ 2 callers
Function
account_email
Find an email-looking account identity without exposing it in receipts.
chapter6/agent-with-event-trigger/unipile_mailbox_experiment.py:264
↓ 2 callers
Method
action
Decorator for registering custom actions @param description: Describe the LLM what the function does (better description == better function calling
chapter9/browser-use-rpa/browser-use/browser_use/tools/service.py:1234
↓ 2 callers
Function
addLog
(message: string, type: LogEntry['type'] = 'info')
chapter6/live-audio/frontend/pages/index.tsx:96
↓ 2 callers
Function
addLoggingLevel
Comprehensively adds a new logging level to the `logging` module and the currently configured logging class. `levelName` becomes an attribute of
chapter9/browser-use-rpa/browser-use/browser_use/logging_config.py:13
↓ 2 callers
Method
add_batch
(self, payload: dict[str, Any])
chapter7/model-benchmark/campaign.py:338
↓ 2 callers
Method
add_rule
(self, rule: AgentSpecRule)
chapter5/permission-embedded-data-objects/pedo/eval/dataguardbench/agentspec_baseline.py:52
↓ 2 callers
Method
advise
(self, known)
chapter3/structured-knowledge-extraction/advisor_agent.py:59
↓ 2 callers
Method
ainvoke
(self, messages: list[BaseMessage], output_format: None = None)
chapter9/browser-use-rpa/browser-use/browser_use/llm/openrouter/chat.py:116
↓ 2 callers
Method
all_states
(self)
chapter6/async-agent/tasks.py:249
↓ 2 callers
Function
analyze
(db: Path, config_path: Path, campaign_id: str)
chapter7/model-benchmark/analysis.py:699
↓ 2 callers
Function
analyze_ablation_impact
Analyze the impact of each ablation factor
chapter2/prompt-engineering/analyze_results.py:164
↓ 2 callers
Method
analyze_image
Analyze an image with a specific query
chapter4/multimodal-agent/agent.py:97
↓ 2 callers
Method
analyze_landing_page
(self, url: str, mode: str = 'instagram')
chapter9/browser-use-rpa/browser-use/examples/apps/ad-use/ad_generator.py:52
↓ 2 callers
Function
analyze_rating_changes
Analyze rating changes over time for top models. Args: history_df: DataFrame from get_rating_history top_n: Number of to
chapter7/elo-leaderboard/leaderboard.py:192
↓ 2 callers
Function
anchor
( text: string, item: Annotation, )
web-astro/src/lib/annotations.ts:15
↓ 2 callers
Method
answer_question
Answer a question about user conversation history using RAG Args: question: The question to answer t
chapter3/agentic-rag-for-user-memory/agent.py:198
↓ 2 callers
Method
answer_question
Answer a question using dual memory system Args: question: The question to answer test_id: Test case
chapter3/contextual-retrieval-for-user-memory/contextual_agent.py:268
↓ 2 callers
Function
answer_sections
(path)
tests/test_reference_answer_coverage.py:8
↓ 2 callers
Function
answer_vision
(recorder: CheckpointRecorder, model: str, image: Path, question: str, purpose: str)
chapter4/multimodal-agent/campaign.py:123
↓ 2 callers
Method
api_key
(self)
chapter7/model-benchmark/benchmark.py:66
↓ 2 callers
Method
api_key
(self)
chapter7/user-memory-system-evaluation/experiment.py:198
← previous
next →
1,901–2,000 of 13,003, ranked by callers