Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bojieli/ai-agent-book
/ functions
Functions
2,925 in github.com/bojieli/ai-agent-book
⨍
Functions
2,925
◇
Types & classes
570
↳
Endpoints
80
↓ 1 callers
Function
interactive_chat
Interactive chat session with the agent
chapter3/multimodal-agent/main.py:79
↓ 1 callers
Function
interactive_mode
Run interactive chat mode with optional streaming
chapter2/local_llm_serving/main.py:331
↓ 1 callers
Function
interactive_mode
Run the agent in interactive mode
chapter2/system-hint/main.py:127
↓ 1 callers
Function
interactive_mode
Run the agent in interactive mode Args: api_key: API key for the LLM provider provider: LLM provider to use mode
chapter1/context/main.py:686
↓ 1 callers
Function
interactive_mode
交互模式
chapter1/web-search-agent/quickstart.py:116
↓ 1 callers
Function
interactive_mode
Interactive mode for sending custom events
chapter4/agent-with-event-trigger/client.py:250
↓ 1 callers
Function
interactive_mode
Run the agent in interactive mode with separated architecture
chapter3/user-memory/main.py:92
↓ 1 callers
Method
invoke
(*args, **kwargs)
chapter2/prompt-engineering/tau_bench/envs/tool.py:7
↓ 1 callers
Method
isCompleteSentence
(sentence, isFirstSentence)
chapter9/live-audio/backend/server.js:526
↓ 1 callers
Function
is_successful
(reward: float)
chapter2/prompt-engineering/tau_bench/run.py:181
↓ 1 callers
Function
kill_process_tree
Kill process and all its children.
chapter4/execution-tools/multilang_executor.py:39
↓ 1 callers
Function
label_idx_to_label_json
(idx: int, decode_map: dict[str, int])
chapter2/prompt-engineering/tau_bench/model_utils/model/chat.py:510
↓ 1 callers
Function
label_idx_to_label_json
(idx: int, decode_map: dict[str, int])
chapter2/prompt-engineering/tau_bench/model_utils/model/completion.py:423
↓ 1 callers
Method
list_allowed_directories
List directories that are accessible. Returns: Dictionary with allowed directories
chapter4/execution-tools/filesystem_enhanced.py:657
↓ 1 callers
Method
list_directory
List contents of a directory. Args: directory: Directory to list (relative to current) Retu
chapter4/execution-tools/terminal_controller.py:153
↓ 1 callers
Method
list_directory_with_sizes
List directory contents with file sizes. Args: directory_path: Path to directory Returns:
chapter4/execution-tools/filesystem_enhanced.py:149
↓ 1 callers
Method
list_documents
List documents with pagination.
chapter3/retrieval-pipeline/document_store.py:67
↓ 1 callers
Method
list_documents
List documents in the store.
chapter3/dense-embedding/test_client.py:53
↓ 1 callers
Method
list_documents
List all documents in the store. Args: limit: Maximum number of documents to return Returns:
chapter3/dense-embedding/document_store.py:121
↓ 1 callers
Method
list_test_cases
List all available test cases. Args: category: Optional filter by category (layer1, layer2, layer3)
chapter3/user-memory-evaluation/framework.py:141
↓ 1 callers
Function
loadTrajectories
()
chapter2/attention_visualization/frontend/pages/index.tsx:68
↓ 1 callers
Method
load_all_workflows
Load all workflows from storage into memory.
chapter8/browser-use-rpa/learning_agent/knowledge_base.py:87
↓ 1 callers
Method
load_and_extract_content
Load and extract content if in extract mode
chapter3/multimodal-agent/agent.py:1019
↓ 1 callers
Method
load_and_index_conversations
Load and index conversation histories
chapter3/contextual-retrieval-for-user-memory/main.py:230
↓ 1 callers
Function
load_and_prepare_dataset
加载并准备多语言推理数据集 使用 HuggingFaceH4/Multilingual-Thinking 数据集,该数据集包含: - 多种语言的推理链(思维链) - 支持英语、西班牙语、法语、德语、意大利语等 Returns:
chapter7/MultilingualReasoning/gpt_oss_20b_sft.py:43
↓ 1 callers
Function
load_base_model
加载基础模型和分词器 使用 Mxfp4Config 进行量化,这是专门为 OpenAI 模型优化的 4-bit 浮点格式。 Args: model_name: 模型名称或路径 Returns: t
chapter7/MultilingualReasoning/gpt_oss_20b_sft.py:95
↓ 1 callers
Function
load_baseline_model
Load the original Mistral model (before any training)
chapter7/continued-pretraining/compare_models.py:29
↓ 1 callers
Method
load_config
Load configuration from YAML file.
chapter8/gaia-experience/demo.py:44
↓ 1 callers
Method
load_dataset
Load LOCOMO dataset
chapter3/user-memory/locomo_benchmark.py:52
↓ 1 callers
Method
load_dataset
Load evaluation dataset
chapter3/contextual-retrieval/evaluation/evaluate.py:31
↓ 1 callers
Method
load_dataset
Load evaluation dataset
chapter3/agentic-rag/evaluation/evaluate.py:31
↓ 1 callers
Function
load_dataset_for_context
Load the dataset for voice context examples.
chapter7/sesame/batch_inference.py:73
↓ 1 callers
Function
load_dataset_for_context
Load the dataset for voice context examples. Args: dataset_name: Name of the dataset split: Dataset split to use
chapter7/sesame/inference.py:47
↓ 1 callers
Method
load_experiences
Load experiences from file.
chapter1/learning-from-experience/llm_agent.py:465
↓ 1 callers
Function
load_gsm8k_answers
加载 GSM8K 数据集的金标答案 返回一个字典,键是数据集中的原始索引(0-1318),值是标准化后的答案
chapter7/Intuitor/evaluate_from_cache.py:121
↓ 1 callers
Method
load_history
Load conversation history from storage
chapter3/user-memory/conversation_history.py:59
↓ 1 callers
Method
load_index
Load chunks from disk and re-index in retrieval pipeline Args: path: Path to load index from (uses config defaul
chapter3/agentic-rag-for-user-memory/indexer.py:401
↓ 1 callers
Method
load_index
Load chunks from disk and re-index in retrieval pipeline Args: path: Path to load index from (uses config defaul
chapter3/contextual-retrieval-for-user-memory/indexer.py:401
↓ 1 callers
Function
load_jsonl_dataset
Load training data from JSONL file. Args: file_path: Path to JSONL file with messages format Returns: Datas
chapter8/prompt-distillation/train_sft_trl.py:22
↓ 1 callers
Function
load_mcp_config
Load MCP configuration.
chapter8/gaia-experience/run_with_experience.py:152
↓ 1 callers
Function
load_mcp_tools_async
Load MCP tools asynchronously
chapter4/agent-with-event-trigger/server_fastapi.py:155
↓ 1 callers
Function
load_mcp_tools_async
Load MCP tools asynchronously
chapter4/agent-with-event-trigger/server.py:155
↓ 1 callers
Method
load_memory
Load memory cards from storage
chapter3/contextual-retrieval-for-user-memory/advanced_memory_manager.py:96
↓ 1 callers
Function
load_model
Load a trained LoRA model
chapter7/continued-pretraining/compare_models.py:40
↓ 1 callers
Function
load_model
Load the saved LoRA model
chapter7/continued-pretraining/evaluate_model.py:31
↓ 1 callers
Function
load_model
Load the base model and optionally apply LoRA adapters.
chapter7/sesame/batch_inference.py:22
↓ 1 callers
Function
load_model
Load the base model and optionally apply LoRA adapters. Args: base_model_name: Name or path of the base model lora_path:
chapter7/sesame/inference.py:19
↓ 1 callers
Function
load_model
Load the fine-tuned model with LoRA adapters.
chapter8/prompt-distillation/evaluate.py:26
↓ 1 callers
Function
load_results
Load all results from the results directory Returns: Dictionary mapping experiment names to lists of rewards
chapter2/prompt-engineering/analyze_results.py:14
↓ 1 callers
Function
load_texts_from_file
Load texts from a JSON file. Expected format: [ {"text": "Hello world", "speaker_id": 0, "output": "hello.wav"}, {"t
chapter7/sesame/batch_inference.py:40
↓ 1 callers
Function
load_trained_model
加载训练好的模型进行推理 Args: base_model_name: 基础模型名称 peft_model_path: LoRA 权重路径 Returns: tuple: (model, token
chapter7/MultilingualReasoning/gpt_oss_20b_sft.py:313
↓ 1 callers
Function
load_user
( user_strategy: Union[str, UserStrategy], model: Optional[str] = "gpt-4o", provider: Optional[str
chapter2/prompt-engineering/tau_bench/envs/user.py:320
↓ 1 callers
Method
log_deletion
Log document deletion.
chapter3/dense-embedding/logger.py:142
↓ 1 callers
Method
log_embedding_generation
Log embedding generation details.
chapter3/dense-embedding/logger.py:108
↓ 1 callers
Method
log_index_update
Log index update operations.
chapter3/dense-embedding/logger.py:121
↓ 1 callers
Method
log_indexing_start
Log the start of document indexing.
chapter3/dense-embedding/logger.py:100
↓ 1 callers
Function
log_report_to_disk
(report: dict[str, Any], path: str)
chapter2/prompt-engineering/tau_bench/model_utils/api/exception.py:23
↓ 1 callers
Method
log_search_results
Log search results with detailed information.
chapter3/dense-embedding/logger.py:134
↓ 1 callers
Method
log_search_start
Log the start of search operation.
chapter3/dense-embedding/logger.py:127
↓ 1 callers
Function
longest_valid_string
(s: str, options: list[str])
chapter2/prompt-engineering/tau_bench/model_utils/model/utils.py:121
↓ 1 callers
Function
main
()
book/strip_titles.py:93
↓ 1 callers
Function
main
()
book/gen_ch4_figs.py:970
↓ 1 callers
Function
main
()
book/gen_ch5_figs.py:1079
↓ 1 callers
Function
main
()
book/gen_ch9_figs.py:1026
↓ 1 callers
Function
main
Main function for standalone execution.
chapter7/orpheus/inference.py:343
↓ 1 callers
Function
main
()
chapter7/Intuitor/evaluate_from_cache.py:256
↓ 1 callers
Function
main
主函数:完整的训练流程
chapter7/MultilingualReasoning/gpt_oss_20b_sft.py:453
↓ 1 callers
Function
main
()
chapter7/continued-pretraining/compare_models.py:121
↓ 1 callers
Function
main
()
chapter7/continued-pretraining/evaluate_model.py:178
↓ 1 callers
Function
main
()
chapter7/sesame/batch_inference.py:160
↓ 1 callers
Function
main
()
chapter7/sesame/inference.py:149
↓ 1 callers
Function
main
()
chapter5/coding-agent/hello_world.py:10
↓ 1 callers
Function
main
Example usage
chapter5/coding-agent/agent.py:486
↓ 1 callers
Function
main
Run a simple coding agent interaction
chapter5/coding-agent/quickstart.py:11
↓ 1 callers
Function
main
Entry point
chapter5/coding-agent/main.py:348
↓ 1 callers
Function
main
Example usage
chapter5/coding-agent/agent_new.py:264
↓ 1 callers
Function
main
()
chapter8/prompt-distillation/train_sft_trl.py:296
↓ 1 callers
Function
main
()
chapter8/prompt-distillation/create_data.py:356
↓ 1 callers
Function
main
()
chapter8/prompt-distillation/evaluate.py:314
↓ 1 callers
Function
main
Main entry point.
chapter8/browser-use-rpa/demo_email.py:249
↓ 1 callers
Function
main
Main entry point.
chapter8/browser-use-rpa/test_validation.py:349
↓ 1 callers
Function
main
Main menu.
chapter8/browser-use-rpa/quickstart.py:121
↓ 1 callers
Function
main
Main entry point.
chapter8/gaia-experience/run_with_experience.py:375
↓ 1 callers
Function
main
Main entry point for demo.
chapter8/gaia-experience/demo.py:343
↓ 1 callers
Function
main
Run benchmark comparison.
chapter6/elo-leaderboard/benchmark.py:64
↓ 1 callers
Function
main
Run model leaderboard calculation. Args: method: 'bradley-terry' (default, official) or 'online-elo' (simple)
chapter6/elo-leaderboard/main.py:60
↓ 1 callers
Function
main
()
chapter2/prompt-engineering/run.py:96
↓ 1 callers
Function
main
Main analysis function
chapter2/prompt-engineering/analyze_results.py:305
↓ 1 callers
Function
main
Main entry point
chapter2/prompt-engineering/test_ablation.py:260
↓ 1 callers
Function
main
()
chapter2/prompt-engineering/run_ablation.py:359
↓ 1 callers
Function
main
Run a quick demo comparing correct vs incorrect implementation
chapter2/kv-cache/demo_quick.py:11
↓ 1 callers
Function
main
Main entry point
chapter2/kv-cache/main.py:302
↓ 1 callers
Function
main
Main function to run log sanitization Args: test_id: Specific test case ID to process (optional) limit: Maximum number o
chapter2/log-sanitization/main.py:16
↓ 1 callers
Function
main
()
chapter2/log-sanitization/test_loader_debug.py:6
↓ 1 callers
Function
main
Main entry point
chapter2/context-compression/run_all_strategies.py:353
↓ 1 callers
Function
main
Main entry point
chapter2/context-compression/quickstart.py:81
↓ 1 callers
Function
main
Main entry point
chapter2/context-compression/experiment.py:264
↓ 1 callers
Function
main
Main entry point
chapter2/context-compression/main.py:163
↓ 1 callers
Function
main
Main function to start vLLM server
chapter2/local_llm_serving/server.py:191
↓ 1 callers
Function
main
Main compatibility check
chapter2/local_llm_serving/check_compatibility.py:138
← previous
next →
1,201–1,300 of 2,925, ranked by callers