MCPcopy Create free account

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

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

↓ 1 callersMethod_read_text
Read text file
chapter5/coding-agent/tools/read_tool.py:52
↓ 1 callersMethod_rebuild_without_deleted
Rebuild the index without deleted items.
chapter3/dense-embedding/indexing.py:135
↓ 1 callersMethod_redistribute_codes
Redistribute flattened codes back into SNAC's 3-layer format. Terminates early if invalid codes are detected (out of range 0
chapter7/orpheus/inference.py:196
↓ 1 callersMethod_register_default_tools
Register default tools from local_llm_serving
chapter2/attention_visualization/tools.py:22
↓ 1 callersMethod_register_default_tools
Register default tools
chapter2/local_llm_serving/tools.py:23
↓ 1 callersMethod_remap_messages
(self, messages: list[dict[str, str]])
chapter2/prompt-engineering/tau_bench/model_utils/model/claude.py:80
↓ 1 callersMethod_rule_based_summary
Create a rule-based summary when LLM is not available. Args: question: The original question respons
chapter8/gaia-experience/trajectory_summarizer.py:166
↓ 1 callersMethod_run_anthropic_iteration
Run one iteration with Anthropic API
chapter5/coding-agent/agent.py:175
↓ 1 callersMethod_run_multi_session_test
Run a multi-session test
chapter3/user-memory/locomo_benchmark.py:358
↓ 1 callersMethod_run_openai_iteration
Run one iteration with OpenAI/OpenRouter API
chapter5/coding-agent/agent.py:294
↓ 1 callersFunction_run_recurring_timer
Internal function to run a recurring timer.
chapter4/collaboration-tools/src/timer_tools.py:336
↓ 1 callersMethod_run_single_session_test
Run a single session test
chapter3/user-memory/locomo_benchmark.py:271
↓ 1 callersMethod_run_with_learning
Run task with browser-use agent and capture workflow. Args: max_steps: Maximum steps for agent
chapter8/browser-use-rpa/learning_agent/agent.py:361
↓ 1 callersMethod_run_with_replay
Run task using a learned workflow. Args: workflow: The workflow to replay Returns:
chapter8/browser-use-rpa/learning_agent/agent.py:329
↓ 1 callersMethod_run_with_sampling_strategy
( self, models: list[AnyModel], datapoint: Datapoint, sampling_strategy: Sampl
chapter2/prompt-engineering/tau_bench/model_utils/api/api.py:161
↓ 1 callersMethod_save_experiences
Save experiences to file.
chapter8/gaia-experience/experience_agent.py:77
↓ 1 callersMethod_save_index
Save index to disk.
chapter8/gaia-experience/knowledge_base.py:93
↓ 1 callersMethod_save_indexes
Save BM25 indexes to disk
chapter3/contextual-retrieval/contextual_tools.py:554
↓ 1 callersMethod_save_learned_workflow
Save the captured workflow to knowledge base.
chapter8/browser-use-rpa/learning_agent/agent.py:415
↓ 1 callersMethod_save_results
Save results to JSON file
chapter2/context-compression/experiment.py:197
↓ 1 callersMethod_save_results
Save benchmark results
chapter3/user-memory/locomo_benchmark.py:497
↓ 1 callersMethod_save_trajectory
Save current trajectory to JSON file for debugging
chapter2/system-hint/agent.py:199
↓ 1 callersMethod_save_trajectory
Save current trajectory to JSON file for debugging
chapter4/agent-with-event-trigger/agent.py:411
↓ 1 callersMethod_save_trajectory
Save current trajectory to file for debugging
chapter3/user-memory/agent.py:543
↓ 1 callersMethod_search_bm25
Perform BM25 search. Educational Note: BM25 excels at finding exact term matches and handles technical terms
chapter3/contextual-retrieval/contextual_tools.py:278
↓ 1 callersMethod_search_content
Search and return matching lines with context
chapter5/coding-agent/tools/grep_tool.py:235
↓ 1 callersMethod_search_count
Count matches per file
chapter5/coding-agent/tools/grep_tool.py:201
↓ 1 callersMethod_search_dify
Search using Dify API
chapter3/contextual-retrieval/tools.py:158
↓ 1 callersMethod_search_dify
Search using Dify API
chapter3/agentic-rag/tools.py:134
↓ 1 callersMethod_search_embeddings
Perform semantic search using embeddings. Educational Note: Embedding search captures semantic meaning and relations
chapter3/contextual-retrieval/contextual_tools.py:330
↓ 1 callersMethod_search_files_with_matches
Search and return files that have matches
chapter5/coding-agent/tools/grep_tool.py:167
↓ 1 callersMethod_search_graphrag
Search using GraphRAG knowledge graph index
chapter3/contextual-retrieval/tools.py:251
↓ 1 callersMethod_search_graphrag
Search using GraphRAG knowledge graph index
chapter3/agentic-rag/tools.py:227
↓ 1 callersMethod_search_local
Search using local retrieval pipeline
chapter3/contextual-retrieval/tools.py:87
↓ 1 callersMethod_search_local
Search using local retrieval pipeline
chapter3/agentic-rag/tools.py:82
↓ 1 callersMethod_search_raptor
Search using RAPTOR tree-based index
chapter3/contextual-retrieval/tools.py:208
↓ 1 callersMethod_search_raptor
Search using RAPTOR tree-based index
chapter3/agentic-rag/tools.py:184
↓ 1 callersFunction_send_email_sendgrid
Send email using SendGrid API.
chapter4/collaboration-tools/src/notification_tools.py:131
↓ 1 callersFunction_send_email_smtp
Send email using SMTP.
chapter4/collaboration-tools/src/notification_tools.py:62
↓ 1 callersMethod_split_into_sentences
Split text into sentences
chapter3/contextual-retrieval/contextual_chunking.py:252
↓ 1 callersMethod_split_into_sentences
Split text into sentences (simple implementation)
chapter3/contextual-retrieval/chunking.py:118
↓ 1 callersMethod_split_into_sentences
Split text into sentences (simple implementation)
chapter3/agentic-rag/chunking.py:118
↓ 1 callersMethod_store_document
Store full document locally
chapter3/contextual-retrieval/chunking.py:345
↓ 1 callersMethod_store_document
Store full document locally
chapter3/agentic-rag/chunking.py:345
↓ 1 callersMethod_stream_gemini_response
Stream response from Gemini with thinking mode for debugging
chapter3/multimodal-agent/agent.py:795
↓ 1 callersMethod_stream_openai_response
Stream response from OpenAI-compatible API
chapter3/multimodal-agent/agent.py:901
↓ 1 callersMethod_stream_response
Stream response content
chapter3/agentic-rag-for-user-memory/agent.py:348
↓ 1 callersMethod_stream_response
Stream response content
chapter3/contextual-retrieval-for-user-memory/agent.py:348
↓ 1 callersMethod_take_item
Pick up an item.
chapter1/learning-from-experience/game_environment.py:305
↓ 1 callersMethod_tool_add_memory
Add a new memory
chapter3/user-memory/agent.py:400
↓ 1 callersMethod_tool_code_interpreter
Execute Python code in restricted environment
chapter4/agent-with-event-trigger/agent.py:880
↓ 1 callersMethod_tool_delete_memory
Delete a memory
chapter3/user-memory/agent.py:535
↓ 1 callersMethod_tool_execute_command
Execute shell command
chapter4/agent-with-event-trigger/agent.py:903
↓ 1 callersMethod_tool_read_file
Read file contents with optional line-based reading
chapter4/agent-with-event-trigger/agent.py:775
↓ 1 callersMethod_tool_rewrite_todo_list
Rewrite TODO list with new pending items
chapter4/agent-with-event-trigger/agent.py:949
↓ 1 callersMethod_tool_update_memory
Update an existing memory
chapter3/user-memory/agent.py:474
↓ 1 callersMethod_tool_update_todo_status
Update status of TODO items
chapter4/agent-with-event-trigger/agent.py:974
↓ 1 callersMethod_tool_write_file
Write content to file
chapter4/agent-with-event-trigger/agent.py:860
↓ 1 callersMethod_truncate_value
Truncate long values for display. Args: value: Value to truncate max_length: Maximum length
chapter8/gaia-experience/trajectory_summarizer.py:234
↓ 1 callersMethod_try_crafting
Try to craft items (hidden mechanic).
chapter1/learning-from-experience/game_environment.py:410
↓ 1 callersMethod_update_statistics
Update index statistics
chapter3/sparse-embedding/bm25_engine.py:181
↓ 1 callersMethod_use_item
Use an item.
chapter1/learning-from-experience/game_environment.py:344
↓ 1 callersFunction_wait_for_admin_response
Wait for admin to respond to approval request.
chapter4/collaboration-tools/src/hitl_tools.py:151
↓ 1 callersMethod_wait_for_ready
Wait for server to be ready
chapter2/local_llm_serving/server.py:101
↓ 1 callersMethodadd_document
Add a document to the store.
chapter3/retrieval-pipeline/document_store.py:17
↓ 1 callersMethodadd_document
Add a document to the local store
chapter3/contextual-retrieval/tools.py:470
↓ 1 callersMethodadd_document
Add a document to the store. Args: text: Document text doc_id: Optional document ID (will be generat
chapter3/dense-embedding/document_store.py:36
↓ 1 callersMethodadd_document
Add a document to the local store
chapter3/agentic-rag/tools.py:446
↓ 1 callersMethodadd_item
Add an item to the ANNOY index.
chapter3/dense-embedding/indexing.py:76
↓ 1 callersFunctionadd_md_tag
(prompt: str)
chapter2/prompt-engineering/tau_bench/model_utils/model/utils.py:149
↓ 1 callersMethodadd_metric
Add a new metric to the collection
chapter2/log-sanitization/metrics.py:56
↓ 1 callersMethodadd_step
Add a step to the chain Args: request: Request for this step **kwargs: Additional parameters for pro
chapter1/search-codegen/agent.py:347
↓ 1 callersFunctionagent_factory
( tools_info: List[Dict[str, Any]], wiki, config: RunConfig )
chapter2/prompt-engineering/tau_bench/run.py:124
↓ 1 callersFunctionanalyze_ablation_impact
Analyze the impact of each ablation factor
chapter2/prompt-engineering/analyze_results.py:153
↓ 1 callersMethodanalyze_audio
Analyze audio with a specific query
chapter3/multimodal-agent/agent.py:97
↓ 1 callersFunctionanalyze_image_ai
Analyze image using AI (OpenAI Vision API). Args: image_path: Path to image file prompt: Prompt for AI analysis
chapter4/perception-tools/src/media_processing_tools.py:274
↓ 1 callersMethodanalyze_pdf
Analyze a PDF document with a specific query
chapter3/multimodal-agent/agent.py:108
↓ 1 callersMethodanalyze_results
Analyze ablation study results Args: results: List of test results Returns: Ana
chapter1/context/main.py:196
↓ 1 callersFunctionanalyze_video_ai
Analyze video content using AI vision on keyframes. Args: video_path: Path to video file num_frames: Number of frames to
chapter4/perception-tools/src/media_processing_tools.py:450
↓ 1 callersMethodapply_memory_updates
Apply memory updates to the memory manager Args: updates: List of memory updates to apply R
chapter3/user-memory/background_memory_processor.py:163
↓ 1 callersMethodbatch_search
批量搜索多个问题 Args: questions: 问题列表 Returns: 答案列表
chapter1/web-search-agent/examples.py:21
↓ 1 callersFunctionbatch_token_analysis
(dps: list[Datapoint], encoding_for_model: str = "gpt-4o")
chapter2/prompt-engineering/tau_bench/model_utils/api/tokens.py:22
↓ 1 callersFunctionbenchmark_basic_elo
Benchmark the basic Elo implementation.
chapter6/elo-leaderboard/benchmark.py:12
↓ 1 callersFunctionbenchmark_optimized_elo
Benchmark the NumPy + Numba optimized implementation.
chapter6/elo-leaderboard/benchmark.py:37
↓ 1 callersFunctionbrowser_execute_task
Execute a high-level browser task using the browser-use agent. Args: task: Natural language description of the task to perform
chapter4/collaboration-tools/src/browser_tools.py:150
↓ 1 callersFunctionbrowser_get_content
Get content from the current page. Args: selector: Optional CSS selector to extract specific content Returns: Di
chapter4/collaboration-tools/src/browser_tools.py:102
↓ 1 callersFunctionbrowser_list_tabs
List all open browser tabs. Returns: Dictionary with list of tabs
chapter4/collaboration-tools/src/browser_tools.py:250
↓ 1 callersFunctionbrowser_navigate
Navigate to a URL in the browser. Args: url: The URL to navigate to new_tab: Whether to open in a new tab Return
chapter4/collaboration-tools/src/browser_tools.py:67
↓ 1 callersFunctionbrowser_screenshot
Take a screenshot of the current page. Args: full_page: Whether to capture the full page or just viewport Returns:
chapter4/collaboration-tools/src/browser_tools.py:209
↓ 1 callersMethodbufferToFloat32Array
* Convert Buffer to Float32Array for Silero VAD * @param {Buffer} buffer - PCM 16-bit audio buffer * @returns {Float32Array} Normalized audio sa
chapter9/live-audio/backend/utils/vad.js:86
↓ 1 callersFunctionbuild_classify_prompts
( dps: list[ClassifyDatapoint], suffix_strategy: PromptSuffixStrategy | None = None, )
chapter2/prompt-engineering/tau_bench/model_utils/model/chat.py:506
↓ 1 callersFunctionbuild_classify_prompts
( dps: list[ClassifyDatapoint], include_response: bool = True, )
chapter2/prompt-engineering/tau_bench/model_utils/model/completion.py:419
↓ 1 callersFunctionbuild_confusion_matrix
Build confusion matrix and identify problematic languages. Returns: Dict with confusion matrix, per-language stats, and error ex
chapter8/prompt-distillation/evaluate.py:171
↓ 1 callersMethodbuild_dataset
Build and save the complete dataset
chapter3/contextual-retrieval/evaluation/dataset_builder.py:154
↓ 1 callersMethodbuild_dataset
Build and save the complete dataset
chapter3/agentic-rag/evaluation/dataset_builder.py:154
↓ 1 callersMethodbuild_generate_message_state
( self, messages: list[Message], )
chapter2/prompt-engineering/tau_bench/model_utils/model/claude.py:108
↓ 1 callersFunctionbuild_index
Build RAPTOR and/or GraphRAG index from text or file.
chapter3/structured-index/api_service.py:121
↓ 1 callersFunctionbuild_indexes
Build RAPTOR and/or GraphRAG indexes from a document.
chapter3/structured-index/main.py:18
↓ 1 callersFunctionbuild_leaderboard
Build Elo leaderboard from voting data. Args: df: DataFrame with columns 'model_a', 'model_b', 'winner' initial_rating:
chapter6/elo-leaderboard/leaderboard.py:11
↓ 1 callersFunctionbuild_prompts
(dps: list[Datapoint], include_response: bool = True)
chapter2/prompt-engineering/tau_bench/model_utils/model/completion.py:355
← previousnext →801–900 of 2,925, ranked by callers