MCPcopy Create free account

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

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

↓ 1 callersMethod_get_memory_context
Get current memory context as a string
chapter3/user-memory/conversational_agent.py:134
↓ 1 callersMethod_get_mock_search_results
Get mock search results for testing without API key Args: query: Search query Returns:
chapter2/context-compression/web_tools.py:194
↓ 1 callersMethod_get_num_layers
Get the number of transformer layers in the model
chapter2/attention_visualization/agent.py:208
↓ 1 callersMethod_get_recent_commits
Get recent commits
chapter5/coding-agent/agent.py:108
↓ 1 callersMethod_get_recent_commits
Get recent commits
chapter5/coding-agent/agent_new.py:94
↓ 1 callersMethod_get_response
Get non-streaming response
chapter3/multimodal-agent/agent.py:1007
↓ 1 callersMethod_get_system_hint
Get system hint content with current state
chapter2/system-hint/agent.py:274
↓ 1 callersMethod_get_system_hint
Get system hint content with current state
chapter4/agent-with-event-trigger/agent.py:485
↓ 1 callersMethod_get_system_prompt
Get system prompt based on mode
chapter2/kv-cache/agent.py:430
↓ 1 callersMethod_get_system_prompt
获取系统提示
chapter1/web-search-agent/agent.py:76
↓ 1 callersMethod_get_system_prompt
Generate the system prompt
chapter3/agentic-rag-for-user-memory/agent.py:102
↓ 1 callersMethod_get_system_prompt
Generate the system prompt
chapter3/contextual-retrieval/agent.py:65
↓ 1 callersMethod_get_system_prompt
Generate the system prompt
chapter3/agentic-rag/agent.py:65
↓ 1 callersMethod_get_system_prompt
Generate the system prompt
chapter3/contextual-retrieval-for-user-memory/agent.py:102
↓ 1 callersMethod_get_system_state
Get current system state information
chapter4/agent-with-event-trigger/agent.py:372
↓ 1 callersMethod_get_task_hash
Generate a hash for a question to use as key.
chapter8/gaia-experience/experience_agent.py:85
↓ 1 callersMethod_get_term_frequency_distribution
Get top N most frequent terms across all documents
chapter3/sparse-embedding/bm25_engine.py:203
↓ 1 callersMethod_get_tools
Get tool definitions based on mode
chapter2/kv-cache/agent.py:451
↓ 1 callersMethod_get_tools
定义可用的工具 根据 Kimi 文档,$web_search 是内置工具
chapter1/web-search-agent/agent.py:62
↓ 1 callersMethod_get_tools_description
Get tool descriptions for the model
chapter2/system-hint/agent.py:295
↓ 1 callersMethod_get_tools_description
Get tool descriptions for the model
chapter1/context/agent.py:372
↓ 1 callersMethod_get_tools_description
Get tool descriptions for the model
chapter4/agent-with-event-trigger/agent.py:506
↓ 1 callersMethod_get_tools_description
Get tool descriptions for the model
chapter3/user-memory/agent.py:298
↓ 1 callersMethod_get_user_profile_message
Get user profile message for dynamic profile mode
chapter2/kv-cache/agent.py:461
↓ 1 callersMethod_handle_classify_response
(self, res: Message, decode_map: dict[str, int])
chapter2/prompt-engineering/tau_bench/model_utils/model/chat.py:334
↓ 1 callersMethod_handle_classify_response
(self, res: dict[str, int], decode_map: dict[str, int])
chapter2/prompt-engineering/tau_bench/model_utils/model/completion.py:262
↓ 1 callersMethod_handle_parse_force_response
( self, res: Message, typ: type[T] | dict[str, Any] )
chapter2/prompt-engineering/tau_bench/model_utils/model/chat.py:380
↓ 1 callersMethod_handle_parse_force_response
(self, res: dict[str, Any], typ: type[T])
chapter2/prompt-engineering/tau_bench/model_utils/model/completion.py:306
↓ 1 callersMethod_handle_score_response
( self, res: Message, min: int, max: int, )
chapter2/prompt-engineering/tau_bench/model_utils/model/chat.py:406
↓ 1 callersMethod_handle_score_response
( self, res: dict[str, Any], min: int, max: int, )
chapter2/prompt-engineering/tau_bench/model_utils/model/completion.py:326
↓ 1 callersMethod_handle_windowed_compression
Apply windowed compression strategy to message history Only compresses when context usage exceeds 80% threshold Args
chapter2/context-compression/agent.py:218
↓ 1 callersMethod_index_chunks
Index chunks to the knowledge base
chapter3/contextual-retrieval/chunking.py:235
↓ 1 callersMethod_index_chunks
Index chunks to the knowledge base
chapter3/agentic-rag/chunking.py:235
↓ 1 callersMethod_index_chunks_to_pipeline
Index chunks to the retrieval pipeline
chapter3/contextual-retrieval/contextual_tools.py:183
↓ 1 callersMethod_index_to_dify
Index to Dify knowledge base
chapter3/contextual-retrieval/chunking.py:281
↓ 1 callersMethod_index_to_dify
Index to Dify knowledge base
chapter3/agentic-rag/chunking.py:281
↓ 1 callersMethod_index_to_local
Index to local retrieval pipeline
chapter3/contextual-retrieval/chunking.py:244
↓ 1 callersMethod_index_to_local
Index to local retrieval pipeline
chapter3/agentic-rag/chunking.py:244
↓ 1 callersMethod_infer_approach
Infer the approach based on action types. Args: action_types: Count of action types tools_used: List
chapter8/gaia-experience/trajectory_summarizer.py:305
↓ 1 callersMethod_init_llm_client
Initialize the LLM client based on provider
chapter3/agentic-rag-for-user-memory/agent.py:86
↓ 1 callersMethod_init_llm_client
Initialize LLM client for context generation
chapter3/contextual-retrieval/contextual_chunking.py:100
↓ 1 callersMethod_init_llm_client
Initialize the LLM client based on provider
chapter3/agentic-rag/agent.py:49
↓ 1 callersMethod_init_llm_client
Initialize LLM client for context generation
chapter3/contextual-retrieval-for-user-memory/contextual_chunking.py:139
↓ 1 callersMethod_init_llm_client
Initialize the LLM client based on provider
chapter3/contextual-retrieval-for-user-memory/agent.py:86
↓ 1 callersMethod_init_llm_client
Initialize the LLM client based on provider
chapter3/contextual-retrieval-for-user-memory/contextual_agent.py:99
↓ 1 callersMethod_init_vllm
Initialize vLLM backend
chapter2/local_llm_serving/main.py:67
↓ 1 callersMethod_initialize_backend
Initialize the selected backend
chapter2/local_llm_serving/main.py:60
↓ 1 callersMethod_initialize_model
Initialize the BGE-M3 model.
chapter3/dense-embedding/embedding_service.py:34
↓ 1 callersMethod_initialize_world
Create the game world with rooms and items - simplified for better learning.
chapter1/learning-from-experience/game_environment.py:90
↓ 1 callersMethod_is_base64
Check if string is base64 encoded.
chapter4/execution-tools/multilang_executor.py:247
↓ 1 callersMethod_is_similar
Simple similarity check between questions. Can be enhanced with semantic similarity using embeddings. Args:
chapter8/gaia-experience/experience_agent.py:154
↓ 1 callersMethod_is_successful
Determine if a task execution was successful. Args: response: The task response task: The original t
chapter8/gaia-experience/experience_agent.py:209
↓ 1 callersMethod_keyword_search
Simple keyword-based search fallback. Args: query: The search query top_k: Number of results to retu
chapter8/gaia-experience/knowledge_base.py:282
↓ 1 callersMethod_learn_from_success
Learn from a successful task execution. Args: question: The original question response: The successf
chapter8/gaia-experience/experience_agent.py:229
↓ 1 callersMethod_load_experiences
Load existing experiences from file.
chapter8/gaia-experience/experience_agent.py:67
↓ 1 callersMethod_load_index
Load existing index from disk.
chapter8/gaia-experience/knowledge_base.py:59
↓ 1 callersMethod_load_indexes
Load BM25 indexes from disk
chapter3/contextual-retrieval/contextual_tools.py:584
↓ 1 callersMethod_load_single_test_case
Load a single test case from a YAML file.
chapter3/user-memory-evaluation/framework.py:66
↓ 1 callersMethod_load_single_test_case
Load a single test case from YAML file
chapter3/agentic-rag-for-user-memory/evaluator.py:194
↓ 1 callersMethod_load_single_test_case
Load a single test case from YAML file
chapter3/contextual-retrieval-for-user-memory/evaluator.py:194
↓ 1 callersMethod_load_system_prompt
Load system prompt from system-prompt.md
chapter5/coding-agent/agent.py:64
↓ 1 callersMethod_load_system_prompt
Load system prompt from system-prompt.md
chapter5/coding-agent/agent_new.py:51
↓ 1 callersMethod_load_test_cases
Load all test cases from YAML files.
chapter3/user-memory-evaluation/framework.py:38
↓ 1 callersFunction_load_timers
Load timer state from storage.
chapter4/collaboration-tools/src/timer_tools.py:394
↓ 1 callersMethod_load_tools
Load tool definitions from tools.json
chapter5/coding-agent/agent.py:57
↓ 1 callersMethod_load_tools
Load tool definitions from tools.json
chapter5/coding-agent/agent_new.py:44
↓ 1 callersMethod_log_request_response
Log full request and response when in verbose mode Args: request_data: The request payload sent to the API
chapter1/context/agent.py:500
↓ 1 callersFunction_marker_def
()
book/svg_lib.py:55
↓ 1 callersMethod_move
Move to another room.
chapter1/learning-from-experience/game_environment.py:279
↓ 1 callersMethod_no_compression
Strategy 1: No compression - return all original content
chapter2/context-compression/compression_strategies.py:203
↓ 1 callersMethod_non_context_aware_combined_summary
Strategy 2B: Non-context-aware summarization - Concatenate all pages then summarize once
chapter2/context-compression/compression_strategies.py:321
↓ 1 callersMethod_non_context_aware_individual_summary
Strategy 2A: Non-context-aware summarization - Summarize each page individually then concatenate
chapter2/context-compression/compression_strategies.py:233
↓ 1 callersFunction_notify_admin_of_request
Notify admin about pending approval request.
chapter4/collaboration-tools/src/hitl_tools.py:76
↓ 1 callersMethod_output_operations
Output memory operations in a formatted way Args: results: Processing results with operations
chapter3/user-memory/background_memory_processor.py:530
↓ 1 callersMethod_parse_datetime
Parse datetime string in various formats.
chapter4/execution-tools/external_tools.py:286
↓ 1 callersMethod_parse_evaluation_response
Parse the LLM's evaluation response.
chapter3/user-memory-evaluation/evaluator.py:176
↓ 1 callersMethod_parse_llm_summary
Parse LLM response into structured summary. Args: response: LLM response object Returns:
chapter8/gaia-experience/trajectory_summarizer.py:130
↓ 1 callersMethod_parse_tool_calls
Parse tool calls from model output Extracts content between <tool_call> tags
chapter2/local_llm_serving/agent.py:64
↓ 1 callersMethod_prepare_assistant_message
Prepare assistant message for adding to messages list, filtering out reasoning_content if in NO_REASONING mode Args
chapter1/context/agent.py:453
↓ 1 callersMethod_prepare_data
Prepare NumPy arrays from DataFrame for fast processing. Args: df: DataFrame with columns 'model_a', 'model_b',
chapter6/elo-leaderboard/optimized_elo.py:122
↓ 1 callersMethod_prepare_inputs
Prepare input tensors for the model. Args: prompts: List of text prompts to convert to speech voice:
chapter7/orpheus/inference.py:93
↓ 1 callersMethod_prepare_memory_cards
Generate memory cards for a test case For Layer 3 tests, this creates cards that enable proactive service
chapter3/contextual-retrieval-for-user-memory/contextual_evaluator.py:205
↓ 1 callersMethod_print_analysis
Print analysis of the results
chapter2/context-compression/experiment.py:233
↓ 1 callersMethod_print_comparison
Print comparison table of all strategies
chapter2/context-compression/experiment.py:204
↓ 1 callersMethod_print_mode_summary
Print summary for a single mode
chapter3/contextual-retrieval/evaluation/evaluate.py:332
↓ 1 callersMethod_print_mode_summary
Print summary for a single mode
chapter3/agentic-rag/evaluation/evaluate.py:332
↓ 1 callersMethod_print_statistics
Print processing statistics
chapter3/contextual-retrieval/index_local_laws_contextual.py:420
↓ 1 callersMethod_print_statistics
Print processing statistics
chapter3/agentic-rag/index_local_laws.py:384
↓ 1 callersMethod_print_summary
Print a summary of the metrics
chapter2/context-compression/experiment.py:140
↓ 1 callersMethod_process_generation_attentions
Process attention weights from generation output
chapter2/attention_visualization/agent.py:452
↓ 1 callersMethod_process_native
Process using native multimodal capabilities
chapter3/multimodal-agent/agent.py:390
↓ 1 callersMethod_process_native_doubao
Process using Doubao's native multimodal API
chapter3/multimodal-agent/agent.py:495
↓ 1 callersMethod_process_native_openai
Process using OpenAI's native multimodal API
chapter3/multimodal-agent/agent.py:462
↓ 1 callersMethod_process_pdf_with_pdfplumber
Process PDF using pdfplumber for better structure preservation.
chapter3/structured-index/document_processor.py:63
↓ 1 callersMethod_process_pdf_with_pypdf
Fallback PDF processing using pypdf.
chapter3/structured-index/document_processor.py:93
↓ 1 callersMethod_rank_fusion
Combine BM25 and embedding results using reciprocal rank fusion. Educational Note: Rank fusion combines different re
chapter3/contextual-retrieval/contextual_tools.py:385
↓ 1 callersMethod_rate_limit
Enforce rate limiting to comply with PubChem usage policy.
chapter4/perception-tools/src/pubchem_tools.py:62
↓ 1 callersMethod_read_image
Read image file
chapter5/coding-agent/tools/read_tool.py:88
↓ 1 callersMethod_read_notebook
Read Jupyter notebook
chapter5/coding-agent/tools/read_tool.py:118
↓ 1 callersMethod_read_pdf
Read PDF file
chapter5/coding-agent/tools/read_tool.py:103
← previousnext →701–800 of 2,925, ranked by callers