MCPcopy Create free account

hub / github.com/bojieli/ai-agent-book / functions

Functions2,925 in github.com/bojieli/ai-agent-book

↓ 2 callersMethoddelete_memory
Delete a memory item
chapter3/user-memory/memory_manager.py:96
↓ 2 callersMethoddemo_mode
Run a quick demo with a simple test case
chapter3/agentic-rag-for-user-memory/main.py:530
↓ 2 callersMethoddemo_mode
Run a quick demo with sample data
chapter3/contextual-retrieval-for-user-memory/main.py:102
↓ 2 callersMethoddemo_workflow
Demonstrate complete workflow.
chapter8/gaia-experience/demo.py:276
↓ 2 callersMethoddetect_communities
Detect communities in the knowledge graph.
chapter3/structured-index/graphrag_indexer.py:224
↓ 2 callersMethoddiamond
(self, cx, cy, w, h, fill='light', label=None, font_size=FS_SMALL)
book/svg_lib.py:203
↓ 2 callersMethoddirectory_tree
Generate a tree structure of directory contents. Args: directory_path: Path to directory max_depth:
chapter4/execution-tools/filesystem_enhanced.py:222
↓ 2 callersMethoddisplay
Display current configuration (hiding sensitive data)
chapter1/search-codegen/config.py:61
↓ 2 callersFunctiondisplay_choices
(choices: list[str])
chapter2/prompt-engineering/tau_bench/model_utils/model/utils.py:18
↓ 2 callersFunctiondisplay_metrics
(results: List[EnvRunResult])
chapter2/prompt-engineering/tau_bench/run.py:180
↓ 2 callersMethoddisplay_test_case_summary
Display a summary of all test cases. Args: show_full_titles: If True, show complete titles without truncation
chapter3/user-memory-evaluation/framework.py:297
↓ 2 callersMethodencode_text
Encode a single text into embeddings. Args: text: Input text to encode return_sparse: Whether to ret
chapter3/dense-embedding/embedding_service.py:69
↓ 2 callersMethodevaluate
Evaluate the agent's performance using accumulated experiences. Args: num_episodes: Number of episodes to evalua
chapter1/learning-from-experience/llm_agent.py:415
↓ 2 callersMethodevaluate_batch
Evaluate multiple test cases in batch. Args: agent_responses: Dictionary mapping test_id to agent response
chapter3/user-memory-evaluation/framework.py:241
↓ 2 callersMethodevaluate_batch
Evaluate multiple test cases Args: test_ids: List of test IDs to evaluate (evaluates all if None) ca
chapter3/agentic-rag-for-user-memory/evaluator.py:472
↓ 2 callersMethodexecute_code
Execute code in the specified language. Args: code: Code to execute language: Programming language
chapter4/execution-tools/multilang_executor.py:79
↓ 2 callersMethodexecute_task
Execute a task with experience learning/application. Args: task: The task to execute Return
chapter8/gaia-experience/experience_agent.py:89
↓ 2 callersMethodexecute_task
Execute a task using React pattern with tool calls and streaming support Args: task: The task/message from user
chapter3/user-memory/agent.py:578
↓ 2 callersFunctionextract_answer_from_gsm8k_format
从 #### number 格式中提取答案
chapter7/Intuitor/evaluate_from_cache.py:34
↓ 2 callersFunctionextract_csv_content
Extract and parse CSV file content. Args: file_path: Path to CSV file max_rows: Maximum rows to read Return
chapter4/perception-tools/src/document_processing_tools.py:249
↓ 2 callersFunctionextract_docx_content
Extract content from DOCX file. Args: file_path: Path to DOCX file Returns: TextContent with extracted cont
chapter4/perception-tools/src/document_processing_tools.py:102
↓ 2 callersFunctionextract_pptx_content
Extract content from PPTX file. Args: file_path: Path to PPTX file Returns: TextContent with extracted cont
chapter4/perception-tools/src/document_processing_tools.py:175
↓ 2 callersMethodfetch_webpage
Fetch a webpage and convert HTML to text Args: url: URL of the webpage to fetch Returns:
chapter2/context-compression/web_tools.py:112
↓ 2 callersFunctionfilter_data
Filter voting data based on various criteria (following official Chatbot Arena method). Args: df: Input DataFrame min_da
chapter6/elo-leaderboard/data_loader.py:122
↓ 2 callersMethodfind_workflow_for_task
Find the best matching workflow for a given task. Args: task_description: Natural language description of the ta
chapter8/browser-use-rpa/learning_agent/knowledge_base.py:110
↓ 2 callersMethodflush
(self)
chapter2/context-compression/run_all_strategies.py:147
↓ 2 callersMethodfrom_basic_chunk
Create from a basic ConversationChunk
chapter3/contextual-retrieval-for-user-memory/contextual_chunking.py:65
↓ 2 callersMethodfrom_dict
Create workflow from dictionary
chapter8/browser-use-rpa/learning_agent/workflow.py:144
↓ 2 callersMethodfrom_dict
Create event from dictionary
chapter4/agent-with-event-trigger/event_types.py:85
↓ 2 callersMethodgenerate
( self, instruction: str, text: str, examples: list[GenerateDatapoint] | None
chapter2/prompt-engineering/tau_bench/model_utils/api/api.py:314
↓ 2 callersMethodgenerate_document_id
Generate a semantically meaningful document ID from file name. Examples: - "宪法.md" -> "宪法" - "劳动法(2018-12-29
chapter3/contextual-retrieval/index_local_laws_contextual.py:153
↓ 2 callersMethodgenerate_next_message
(self, messages: List[Dict[str, Any]])
chapter2/prompt-engineering/tau_bench/envs/user.py:117
↓ 2 callersMethodgenerate_next_message
(self, messages: List[Dict[str, Any]])
chapter2/prompt-engineering/tau_bench/envs/user.py:163
↓ 2 callersMethodgenerate_next_message
(self, messages: List[Dict[str, Any]])
chapter2/prompt-engineering/tau_bench/envs/user.py:277
↓ 2 callersMethodgenerate_report
Generate evaluation report. Args: results: Dictionary of evaluation results output_file: Optional fi
chapter3/user-memory-evaluation/framework.py:269
↓ 2 callersMethodgenerate_report
Generate and save evaluation report
chapter3/agentic-rag-for-user-memory/main.py:508
↓ 2 callersMethodgenerate_with_attention
Generate text while tracking attention weights Args: prompt: Input prompt text max_new_tokens: Maxim
chapter2/attention_visualization/agent.py:337
↓ 2 callersMethodget_all_test_cases
Get all available test cases
chapter2/log-sanitization/test_loader.py:20
↓ 2 callersMethodget_api_key
Get API key for the specified provider.
chapter4/execution-tools/config.py:55
↓ 2 callersMethodget_api_key
Get API key from environment
chapter3/contextual-retrieval/config.py:81
↓ 2 callersMethodget_api_key
Get API key from environment
chapter3/agentic-rag/config.py:81
↓ 2 callersMethodget_by_category
Get all test cases in a specific category.
chapter3/user-memory-evaluation/models.py:104
↓ 2 callersMethodget_client_config
Get OpenAI client configuration
chapter3/contextual-retrieval/config.py:96
↓ 2 callersMethodget_conversation_context
Get surrounding context for a specific chunk Args: chunk_id: The chunk ID to get context for context
chapter3/agentic-rag-for-user-memory/tools.py:104
↓ 2 callersMethodget_conversation_context
Get surrounding context for a specific chunk Args: chunk_id: The chunk ID to get context for context
chapter3/contextual-retrieval-for-user-memory/tools.py:104
↓ 2 callersMethodget_conversation_history
Get conversation history in OpenAI format
chapter3/multimodal-agent/agent.py:1039
↓ 2 callersMethodget_default_model
Get default model for the specified provider Args: provider: Provider name (defaults to LLM_PROVIDER)
chapter1/context/config.py:91
↓ 2 callersMethodget_document
Retrieve the entire document from the knowledge base. Args: doc_id: Document ID Returns:
chapter3/contextual-retrieval/tools.py:308
↓ 2 callersMethodget_document
Retrieve the entire document from the knowledge base. Args: doc_id: Document ID Returns:
chapter3/agentic-rag/tools.py:284
↓ 2 callersMethodget_embedding_dimension
Get the dimension of the embeddings.
chapter3/dense-embedding/embedding_service.py:178
↓ 2 callersFunctionget_excel_metadata
Get Excel file metadata. Args: file_path: Path to Excel file Returns: Dictionary with metadata
chapter4/collaboration-tools/src/excel_tools.py:231
↓ 2 callersMethodget_file_info
Get detailed information about a file. Args: file_path: Path to the file Returns:
chapter4/execution-tools/filesystem_enhanced.py:369
↓ 2 callersMethodget_full_conversation
Retrieve all chunks from a specific conversation Args: conversation_id: Conversation identifier test
chapter3/agentic-rag-for-user-memory/tools.py:188
↓ 2 callersMethodget_full_conversation
Retrieve all chunks from a specific conversation Args: conversation_id: Conversation identifier test
chapter3/contextual-retrieval-for-user-memory/tools.py:188
↓ 2 callersMethodget_layer3_test_cases
Get only Layer 3 test cases (most complex)
chapter2/log-sanitization/test_loader.py:81
↓ 2 callersFunctionget_majority
(results: list[T])
chapter2/prompt-engineering/tau_bench/model_utils/api/sample.py:127
↓ 2 callersFunctionget_sample_task
Get the sample task for summarizing week1 and week2 projects
chapter2/system-hint/main.py:84
↓ 2 callersFunctionget_sample_tasks
Get sample tasks for demonstration
chapter2/local_llm_serving/main.py:182
↓ 2 callersMethodget_stats
Get service statistics.
chapter3/dense-embedding/test_client.py:48
↓ 2 callersMethodget_status
Get agent status
chapter4/agent-with-event-trigger/client.py:86
↓ 2 callersMethodget_test_case_conversations
Get detailed conversation histories for a specific test case
chapter2/log-sanitization/test_loader.py:86
↓ 2 callersFunctionget_timer_status
Get status of a specific timer. Args: timer_id: ID of the timer to check Returns: Dictionary with timer status
chapter4/collaboration-tools/src/timer_tools.py:236
↓ 2 callersFunctionget_tool_definitions
Get OpenAI function calling tool definitions Returns: List of tool definitions for OpenAI API
chapter3/agentic-rag-for-user-memory/tools.py:252
↓ 2 callersFunctionget_tool_definitions
Get OpenAI function calling tool definitions Returns: List of tool definitions for OpenAI API
chapter3/contextual-retrieval-for-user-memory/tools.py:252
↓ 2 callersMethodget_tool_schemas
Get OpenAI-compatible tool schemas
chapter2/attention_visualization/tools.py:110
↓ 2 callersFunctionget_weather
Get current weather information for a location using Open-Meteo API. Args: location: City name for display purposes lati
chapter4/perception-tools/src/public_data_tools.py:24
↓ 2 callersMethodgrep
Search for pattern in files (similar to Unix grep command) Args: pattern: Regular expression pattern to search f
chapter2/kv-cache/agent.py:223
↓ 2 callersMethodhandle_parse_force_response
(self, prompt: str, content: str)
chapter2/prompt-engineering/tau_bench/model_utils/model/completion.py:254
↓ 2 callersMethodhierarchical_summarization
Create hierarchical summaries of communities.
chapter3/structured-index/graphrag_indexer.py:301
↓ 2 callersMethodindex_contextual_chunks
Index contextual chunks for both BM25 and semantic search. Educational Note: This demonstrates the dual indexing str
chapter3/contextual-retrieval/contextual_tools.py:105
↓ 2 callersMethodindex_directory
Index all files in a directory. Args: dir_path: Directory path extensions: File extensions to includ
chapter3/contextual-retrieval/chunking.py:197
↓ 2 callersMethodindex_directory
Index all files in a directory. Args: dir_path: Directory path extensions: File extensions to includ
chapter3/agentic-rag/chunking.py:197
↓ 2 callersMethodindex_document
Index a document.
chapter3/retrieval-pipeline/test_client.py:20
↓ 2 callersMethodindex_document
Index a document.
chapter3/retrieval-pipeline/demo.py:20
↓ 2 callersMethodindex_document
Index a document.
chapter3/dense-embedding/test_client.py:16
↓ 2 callersMethodindex_gaia_validation
Index the GAIA validation file for experience retrieval. Args: validation_file: Path to gaia-validation.jsonl
chapter8/gaia-experience/knowledge_base.py:111
↓ 2 callersMethodis_running
Check if server is running
chapter2/local_llm_serving/server.py:147
↓ 2 callersMethodknowledge_base_search
Search the knowledge base with a natural language query. Args: query: Natural language query string
chapter3/contextual-retrieval/tools.py:57
↓ 2 callersMethodknowledge_base_search
Search the knowledge base with a natural language query. Args: query: Natural language query string
chapter3/agentic-rag/tools.py:57
↓ 2 callersFunctionlist_equal
(l1: list, l2: list)
chapter2/prompt-engineering/tau_bench/model_utils/api/datapoint.py:51
↓ 2 callersFunctionlist_pending_requests
List all pending approval requests. Returns: Dictionary with list of pending requests
chapter4/collaboration-tools/src/hitl_tools.py:260
↓ 2 callersFunctionlist_timers
List all timers, optionally filtered by status. Args: status: Optional status filter (active, expired, cancelled) Return
chapter4/collaboration-tools/src/timer_tools.py:202
↓ 2 callersMethodload
Load a saved Q-table and parameters.
chapter1/learning-from-experience/rl_agent.py:286
↓ 2 callersFunctionload_arena_data
Load and preprocess Chatbot Arena voting data. Expected columns: - model_a: Identifier for first model - model_b: Identifier for
chapter6/elo-leaderboard/data_loader.py:62
↓ 2 callersMethodload_index
Load RAPTOR tree index from disk.
chapter3/structured-index/raptor_indexer.py:279
↓ 2 callersMethodload_index
Load knowledge graph index from disk.
chapter3/structured-index/graphrag_indexer.py:476
↓ 2 callersMethodload_memory
Load memory from storage
chapter3/user-memory/memory_manager.py:76
↓ 2 callersFunctionload_randomized_wiki
Load pre-generated randomized wiki for the specified environment Args: env: Environment name ('airline' or 'retail') Re
chapter2/prompt-engineering/ablation_utils.py:84
↓ 2 callersMethodload_test_cases
Load test cases from YAML files Args: category: Optional category filter (layer1, layer2, layer3)
chapter3/agentic-rag-for-user-memory/evaluator.py:157
↓ 2 callersMethodlog_embedding_vector
Log embedding vector details for educational purposes.
chapter3/dense-embedding/logger.py:115
↓ 2 callersFunctionmain
Main function
chapter2/local_llm_serving/main.py:507
↓ 2 callersFunctionmain
Main function
chapter1/context/main.py:928
↓ 2 callersFunctionmap_role_label
(role: str)
chapter2/prompt-engineering/tau_bench/envs/user.py:197
↓ 2 callersFunctionmessage_to_action
( message: Dict[str, Any], )
chapter2/prompt-engineering/tau_bench/agents/tool_calling_agent.py:83
↓ 2 callersMethodmove_file
Move or rename a file/directory. Args: source: Source path destination: Destination path
chapter4/execution-tools/filesystem_enhanced.py:437
↓ 2 callersFunctionnormalize_number
标准化数字格式:去除逗号、空格、LaTeX 符号等
chapter7/Intuitor/evaluate_from_cache.py:54
↓ 2 callersMethodparse_force
( self, instruction: str, typ: type[T] | dict[str, Any], text: str | None = No
chapter2/prompt-engineering/tau_bench/model_utils/api/api.py:336
↓ 2 callersFunctionparse_json_or_json_markdown
(text: str)
chapter2/prompt-engineering/tau_bench/model_utils/model/utils.py:76
↓ 2 callersMethodprint_header
Print CLI header
chapter5/coding-agent/main.py:55
↓ 2 callersFunctionprint_section
Print a section header
chapter3/contextual-retrieval/demo.py:36
← previousnext →401–500 of 2,925, ranked by callers