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 callers
Method
to_dict
(self)
chapter3/agentic-rag-for-user-memory/indexer.py:105
↓ 1 callers
Method
to_dict
(self)
chapter3/agentic-rag-for-user-memory/chunker.py:47
↓ 1 callers
Method
to_dict
Convert to dictionary
chapter3/user-memory/locomo_benchmark.py:32
↓ 1 callers
Method
to_dict
Convert to dictionary
chapter3/user-memory/memory_manager.py:37
↓ 1 callers
Method
to_dict
Convert to dictionary
chapter3/user-memory/conversation_history.py:26
↓ 1 callers
Method
to_dict
(self)
chapter3/contextual-retrieval-for-user-memory/indexer.py:31
↓ 1 callers
Method
to_dict
(self)
chapter3/contextual-retrieval-for-user-memory/contextual_agent.py:57
↓ 1 callers
Method
to_dict
(self)
chapter3/contextual-retrieval-for-user-memory/chunker.py:47
↓ 1 callers
Method
to_dict_recursive
(self)
chapter10/generative-agents/tests/test_provider_adapter.py:11
↓ 1 callers
Function
to_hashable
(item: ToHashable)
chapter2/prompt-engineering/tau_bench/envs/base.py:27
↓ 1 callers
Function
to_openrouter_model
(model: str)
chapter9/browser-use-rpa/llm_factory.py:23
↓ 1 callers
Method
to_records
导出每一步的原始 token 用量(用于落盘成 canned trace,供离线复用)。
chapter7/agent-cost-analysis/tracer.py:163
↓ 1 callers
Function
to_sft_sample
把验证通过的轨迹转成 SFT 训练样本(messages 格式,思考包在 <think> 标签里)。
chapter8/cot-distillation/generate_data.py:192
↓ 1 callers
Function
toc_item
(identifier, href, label)
flatten_epub_toc.py:25
↓ 1 callers
Function
toc_table_columns
主 README 内容速览表第一个数据行的列数。
scripts/check_i18n_consistency.py:71
↓ 1 callers
Function
token_usage
(arms: List[Dict[str, Any]])
chapter1/context/run_experiment_1_1.py:415
↓ 1 callers
Function
token_usage
(receipts: List[Dict[str, Any]])
chapter3/memory_rag_campaign.py:483
↓ 1 callers
Function
token_usage
(receipts: List[Dict[str, Any]])
chapter3/contextual-retrieval/campaign.py:154
↓ 1 callers
Function
token_usage
(receipts: Iterable[Dict[str, Any]])
chapter3/structured-knowledge-extraction/campaign.py:515
↓ 1 callers
Function
tokenise_audio
(waveform)
chapter8/orpheus/orpheus_sft_unsloth.py:111
↓ 1 callers
Function
tool_call_dict
(call: Any)
chapter1/context/run_experiment_1_1.py:127
↓ 1 callers
Function
tool_read_skill
(catalog: dict, name: str)
chapter2/agent-skills-ppt/demo.py:107
↓ 1 callers
Function
tool_read_skill_file
(catalog: dict, name: str, rel_path: str)
chapter2/agent-skills-ppt/demo.py:117
↓ 1 callers
Function
tool_response_spans
(marker_prefix: str)
chapter2/attention_visualization/run_status_bar_experiment.py:195
↓ 1 callers
Function
tool_run_skill_script
(catalog: dict, name: str, script: str, payload: str, out_path: Path)
chapter2/agent-skills-ppt/demo.py:133
↓ 1 callers
Method
tool_specs
(self)
chapter2/prompt-injection/agent.py:165
↓ 1 callers
Function
tool_version
(command: list[str])
chapter4/multimodal-agent/campaign.py:234
↓ 1 callers
Function
tools
()
chapter2/attention_visualization/run_status_bar_experiment.py:35
↓ 1 callers
Function
tools_for
(suite: str, features: set[str])
chapter2/system-hint/run_experiment_2_8.py:180
↓ 1 callers
Function
tools_loop
()
scripts/book_figures/chapter8.py:243
↓ 1 callers
Method
total
(self)
chapter5/video-edit/agents.py:123
↓ 1 callers
Method
total_latency
(self)
chapter7/agent-cost-analysis/tracer.py:191
↓ 1 callers
Method
total_uncached_prompt_tokens
(self)
chapter7/agent-cost-analysis/tracer.py:185
↓ 1 callers
Function
total_usage
(results: Iterable[Dict[str, Any] | None])
chapter1/search-codegen/run_experiment_1_3.py:192
↓ 1 callers
Function
town
()
scripts/book_figures/chapter10.py:173
↓ 1 callers
Function
tracker_receipt
(tracker)
chapter10/book-translation/run_official_experiment.py:450
↓ 1 callers
Function
train
(args)
chapter8/premature-completion-dpo/train_dpo.py:61
↓ 1 callers
Method
train_episode
Train the agent for one episode. Returns: Total reward, number of steps, victory status
chapter1/learning-from-experience/rl_agent.py:126
↓ 1 callers
Function
train_model
使用 SFTTrainer 训练模型 Args: model: 配置了 LoRA 的模型 tokenizer: 分词器 dataset: 训练数据集 output_dir: 输出目录 batc
chapter8/MultilingualReasoning/gpt_oss_20b_sft.py:209
↓ 1 callers
Function
train_model
Train the model using TRL SFTTrainer. Hyperparameters are based on the OpenAI Cookbook gpt-oss-20b example, which provides good defa
chapter8/prompt-distillation/train_sft_trl.py:145
↓ 1 callers
Function
train_policy
(images: torch.Tensor, labels: torch.Tensor, device: torch.device, seed: int, epochs: int)
chapter6/rgb-sim2real-grasping/pipeline.py:111
↓ 1 callers
Function
train_student
(run_dir: Path, epochs: int, batch_size: int, learning_rate: float, seed: int)
chapter8/prompt-distillation/run_experiment_8_8.py:376
↓ 1 callers
Function
train_world_model
(device: torch.device, seed: int, epochs: int = 160)
chapter6/gemini-xlerobot-navigation/desktop_planner.py:138
↓ 1 callers
Method
transcribe
(self, path: Path)
chapter6/streaming-speech/whisper_baseline.py:93
↓ 1 callers
Method
transcribe
(self, audio_path: str | Path)
chapter6/end-to-end-speech/speech_model.py:161
↓ 1 callers
Method
transcribe
(self, audio: bytes, mime: str)
chapter10/autonomous-phone-registration/webrtc_channel.py:227
↓ 1 callers
Method
transcribe_array
(self, audio: Any, sample_rate: int)
chapter6/streaming-speech/qwen2_streaming.py:115
↓ 1 callers
Function
transcribe_audio_whisper
Transcribe audio file using OpenAI Whisper (local). Note: Requires whisper package installed. Args: file_path: Path to audio
chapter4/perception-tools/src/media_processing_tools.py:113
↓ 1 callers
Function
transfer
(sender, recipient, amount, subject)
chapter5/permission-embedded-data-objects/pedo/eval/case_studies.py:180
↓ 1 callers
Function
transformValue
(value: number)
chapter2/attention_visualization/frontend/components/AttentionPreview.tsx:54
↓ 1 callers
Function
transition
(state: DesktopState, action: int)
chapter6/gemini-xlerobot-navigation/desktop_planner.py:116
↓ 1 callers
Function
translateChromeValue
(value, pairs)
extras/lang-switcher.js:226
↓ 1 callers
Function
translation
()
scripts/book_figures/chapter10.py:67
↓ 1 callers
Function
translationPairs
(targetCode)
extras/lang-switcher.js:203
↓ 1 callers
Function
translation_agent
Translation Agent:接收「当前章节 + 术语表 + 翻译指南」,翻成流畅译文。 每个实例都是独立上下文(只看到自己这一章 + 术语表,不看到别的章节译文)。 feedback:可选,Manager 依据审校报告发回的针对本章的修订意见。
chapter10/book-translation/agents.py:366
↓ 1 callers
Function
translator
(locale: Locale)
web-astro/src/lib/i18n.ts:23
↓ 1 callers
Function
treasure
()
scripts/book_figures/chapter8.py:93
↓ 1 callers
Method
trigger_pdf_download
Trigger download of a PDF from Chrome's PDF viewer. Returns the download path if successful, None otherwise.
chapter9/browser-use-rpa/browser-use/browser_use/browser/watchdogs/downloads_watchdog.py:742
↓ 1 callers
Function
trim_audio
Trim audio file to specified time range using ffmpeg. Args: audio_path: Path to audio file start_time: Start time in sec
chapter4/perception-tools/src/media_processing_tools.py:688
↓ 1 callers
Function
truncate
(text: str, width: int = 42)
chapter8/prompt-distillation/compare.py:105
↓ 1 callers
Function
try_decode
Safely decode bytes to string.
chapter4/execution-tools/multilang_executor.py:23
↓ 1 callers
Function
try_parse_all
尝试解析一批日志,打印结果;返回 (是否全部成功, 成功解析出的结构化记录列表)。
chapter5/adaptive-log-parser/demo.py:76
↓ 1 callers
Function
try_parse_groq_failed_generation
Extract JSON from model output, handling both plain JSON and code-block-wrapped JSON.
chapter9/browser-use-rpa/browser-use/browser_use/llm/groq/parser.py:18
↓ 1 callers
Function
turnPanel
( kind, first, x, fill, )
web-astro/scripts/training-sequences-figures.mjs:79
↓ 1 callers
Function
turns
()
scripts/book_figures/chapter8.py:209
↓ 1 callers
Function
two_round_tools
()
scripts/book_figures/chapter2.py:98
↓ 1 callers
Function
typeset
(source, name)
scripts/book_figures/typography.py:129
↓ 1 callers
Function
union_search
(index: BM25Memory, queries: List[str], top_k: int)
chapter3/memory_rag_campaign.py:300
↓ 1 callers
Function
units
(text, bold = false)
web-astro/scripts/chapter3-figure-kit.mjs:41
↓ 1 callers
Method
unregister
Unregister signal handlers and restore original handlers if possible.
chapter9/browser-use-rpa/browser-use/browser_use/utils.py:127
↓ 1 callers
Function
unwrap
(result: Any)
chapter4/collaboration-tools/run_experiment_4_5.py:209
↓ 1 callers
Function
unwrap
(result: Any)
chapter4/execution-tools/run_experiment_4_4.py:41
↓ 1 callers
Function
unwrap_mcp_result
(result: Any)
chapter4/perception-tools/run_experiment_4_2.py:272
↓ 1 callers
Function
unwrap_pandoc_cover
Expose the cover bitmap directly on readers without inline SVG support.
scripts/kindle_epub_patcher.py:52
↓ 1 callers
Function
update
()
web-astro/src/scripts/reading-position.ts:135
↓ 1 callers
Function
update
(repo: str, start: datetime, count: int, created_at: datetime, token: str)
scripts/gen_star_history.py:393
↓ 1 callers
Function
update_billing
(role, bid, **fields)
chapter5/permission-embedded-data-objects/pedo/eval/case_studies.py:445
↓ 1 callers
Method
update_browser_panel
Update browser information panel with details about the browser.
chapter9/browser-use-rpa/browser-use/browser_use/cli.py:1097
↓ 1 callers
Method
update_cached_selector_map
Update the cached selector map with new DOM state. This should be called by the DOM watchdog after rebuilding the DOM. Args: selector_map: Th
chapter9/browser-use-rpa/browser-use/browser_use/browser/session.py:1642
↓ 1 callers
Method
update_document_embedding
Update the embedding for a document. Args: doc_id: Document ID embedding: Embedding vector
chapter3/dense-embedding/document_store.py:174
↓ 1 callers
Method
update_email_folders
(self, email_id: str, folders: list[str])
chapter6/agent-with-event-trigger/unipile_mailbox_experiment.py:218
↓ 1 callers
Method
update_file_content
Update a specific line in file. Args: file_path: File path line_number: Line number to update (1-ind
chapter4/execution-tools/terminal_controller.py:418
↓ 1 callers
Method
update_info_panels
Update all information panels with current state.
chapter9/browser-use-rpa/browser-use/browser_use/cli.py:1083
↓ 1 callers
Method
update_model_panel
Update model information panel with details about the LLM.
chapter9/browser-use-rpa/browser-use/browser_use/cli.py:1186
↓ 1 callers
Method
update_tasks_panel
Update tasks information panel with details about the tasks and steps hierarchy.
chapter9/browser-use-rpa/browser-use/browser_use/cli.py:1239
↓ 1 callers
Method
update_workflow_metrics
Update performance metrics for a workflow after execution. Args: workflow_id: ID of the workflow that was execut
chapter9/browser-use-rpa/learning_agent/knowledge_base.py:260
↓ 1 callers
Function
usage
(turns: List[Dict[str, Any]])
chapter1/web-search-agent/run_experiment_1_2.py:70
↓ 1 callers
Function
usage
(calls: Iterable[Dict[str, Any]])
chapter3/agentic-rag/campaign.py:71
↓ 1 callers
Method
usage
(self)
chapter10/staged-system-prompt/evidence.py:75
↓ 1 callers
Function
usage_cost
(usage: dict[str, Any])
chapter8/prompt-distillation/run_experiment_8_8.py:194
↓ 1 callers
Function
usage_summary
()
chapter9/prompt-auto-optimization/config.py:183
↓ 1 callers
Method
usage_summary
(self)
chapter9/trajectory-verifier/test_real_campaign.py:13
↓ 1 callers
Method
use_structured_output_action
(self, output_model: type[T])
chapter9/browser-use-rpa/browser-use/browser_use/tools/service.py:1229
↓ 1 callers
Function
utc_now
()
chapter5/paper-to-video/campaign.py:27
↓ 1 callers
Function
utc_now
()
chapter8/MiniMind-pretrain/validation/run_training_report_audit.py:112
↓ 1 callers
Function
utc_now
()
chapter8/MiniMind-pretrain/validation/run_vlm_training_report_audit.py:232
↓ 1 callers
Function
utc_now
()
chapter8/continued-pretraining/validation/run_report_audit.py:96
↓ 1 callers
Function
utc_now
()
chapter6/streaming-speech/run_official_experiment.py:47
↓ 1 callers
Function
utc_now
()
chapter1/context/run_experiment_1_1.py:57
↓ 1 callers
Function
utc_timestamp
Return ISO 8601 formatted UTC timestamp.
chapter7/model-benchmark/rate_ramp_benchmark.py:16
← previous
next →
7,301–7,400 of 13,003, ranked by callers