MCPcopy Create free account

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

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

Method__init__
Initialize the client.
chapter3/dense-embedding/test_client.py:12
Method__init__
(self, logger: logging.Logger, show_embeddings: bool = False)
chapter3/dense-embedding/logger.py:96
Method__init__
Initialize the document store. Args: logger: Logger instance for educational output
chapter3/dense-embedding/document_store.py:23
Method__init__
Initialize the embedding service with BGE-M3 model. Args: model_name: Name of the BGE-M3 model use_f
chapter3/dense-embedding/embedding_service.py:14
Method__init__
Initialize ANNOY index. Args: dimension: Dimension of vectors n_trees: Number of trees for ANNOY (af
chapter3/dense-embedding/indexing.py:44
Method__init__
Initialize HNSW index. Args: dimension: Dimension of vectors max_elements: Maximum number of element
chapter3/dense-embedding/indexing.py:232
Method__init__
(self)
chapter3/sparse-embedding/bm25_engine.py:24
Method__init__
(self)
chapter3/sparse-embedding/bm25_engine.py:119
Method__init__
Initialize BM25 with tuning parameters k1: controls term frequency saturation (typically 1.2 to 2.0) b: controls length norma
chapter3/sparse-embedding/bm25_engine.py:239
Method__init__
(self)
chapter3/sparse-embedding/bm25_engine.py:368
Method__init__
(self, config: Optional[ChunkingConfig] = None)
chapter3/agentic-rag/chunking.py:21
Method__init__
(self, kb_config: Optional[KnowledgeBaseConfig] = None, chunking_config: Op
chapter3/agentic-rag/chunking.py:153
Method__init__
Initialize the agent
chapter3/agentic-rag/agent.py:31
Method__init__
(self, config: KnowledgeBaseConfig)
chapter3/agentic-rag/tools.py:36
Method__init__
(self, laws_dir: Path = LAWS_DIR, pipeline_url: str = RETRIEVAL_PIPELINE_URL)
chapter3/agentic-rag/index_local_laws.py:49
Method__init__
(self)
chapter3/agentic-rag/evaluation/dataset_builder.py:16
Method__init__
(self, config: Optional[Config] = None)
chapter3/agentic-rag/evaluation/evaluate.py:23
Method__init__
(self)
chapter3/multimodal-agent/config.py:37
Method__init__
(self, agent: 'MultimodalAgent')
chapter3/multimodal-agent/agent.py:80
Method__init__
( self, model: Optional[str] = None, mode: Optional[ExtractionMode] = None, en
chapter3/multimodal-agent/agent.py:283
Method__init__
Initialize the contextual memory indexer. Args: user_id: User identifier index_config: Index configu
chapter3/contextual-retrieval-for-user-memory/contextual_indexer.py:52
Method__init__
Initialize the advanced memory manager. Args: user_id: Unique user identifier storage_dir: Directory
chapter3/contextual-retrieval-for-user-memory/advanced_memory_manager.py:78
Method__init__
Initialize the contextual conversation chunker. Args: chunking_config: Configuration for chunking parameters
chapter3/contextual-retrieval-for-user-memory/contextual_chunking.py:104
Method__init__
Initialize the indexer Args: config: Index configuration
chapter3/contextual-retrieval-for-user-memory/indexer.py:46
Method__init__
Initialize the evaluator Args: config: Configuration object
chapter3/contextual-retrieval-for-user-memory/evaluator.py:122
Method__init__
Initialize the agent Args: indexer: The memory indexer with loaded conversations config: Configurati
chapter3/contextual-retrieval-for-user-memory/agent.py:61
Method__init__
Initialize the contextual agent Args: indexer: The contextual memory indexer memory_manager: Advance
chapter3/contextual-retrieval-for-user-memory/contextual_agent.py:67
Method__init__
Initialize memory tools Args: indexer: The memory indexer instance
chapter3/contextual-retrieval-for-user-memory/tools.py:36
Method__init__
Initialize the evaluator Args: config: Configuration object
chapter3/contextual-retrieval-for-user-memory/contextual_evaluator.py:126
Method__init__
Initialize the chunker Args: config: Chunking configuration
chapter3/contextual-retrieval-for-user-memory/chunker.py:93
Method__init__
Initialize the interactive system
chapter3/contextual-retrieval-for-user-memory/main.py:43
Method__post_init__
(self)
chapter2/log-sanitization/metrics.py:38
Method__post_init__
(self)
chapter2/attention_visualization/agent.py:62
Method_background_processing_loop
Background loop for automatic memory processing based on conversation count
chapter3/user-memory/background_memory_processor.py:497
Method_capture_attention_hook
Hook to capture attention weights from model layers
chapter2/attention_visualization/agent.py:216
Method_evaluate_with_llm
Use LLM to evaluate if the answer meets criteria
chapter3/contextual-retrieval-for-user-memory/contextual_evaluator.py:541
Method_execute_impl
Perform multiple edits on a file - Built on top of Edit tool - All edits are applied in sequence, in the order they
chapter5/coding-agent/tools/multi_edit_tool.py:18
Method_execute_impl
Exit plan mode - Use this tool when you are in plan mode and have finished presenting your plan - This will prompt t
chapter5/coding-agent/tools/exit_plan_mode_tool.py:16
Method_execute_impl
Read file contents - The file_path parameter must be an absolute path - By default, reads up to 2000 lines from the
chapter5/coding-agent/tools/read_tool.py:18
Method_execute_impl
Fetch content from URL - Fetches content from a specified URL and processes it using an AI model - Takes a URL and a
chapter5/coding-agent/tools/web_fetch_tool.py:16
Method_execute_impl
Execute bash command in persistent shell - Commands execute in a persistent shell session - Working directory change
chapter5/coding-agent/tools/bash_tool.py:19
Method_execute_impl
Get output from background bash job - Retrieves output from a running or completed background bash shell - Takes a b
chapter5/coding-agent/tools/bash_output_tool.py:18
Method_execute_impl
Find files matching glob pattern - Fast file pattern matching tool that works with any codebase size - Supports glob
chapter5/coding-agent/tools/glob_tool.py:18
Method_execute_impl
Search for patterns in files using pure Python regex Supports: - Full regex syntax - Case insensitive search
chapter5/coding-agent/tools/grep_tool.py:21
Method_execute_impl
Write content to file - This tool will overwrite the existing file if there is one at the provided path - ALWAYS pre
chapter5/coding-agent/tools/write_tool.py:18
Method_execute_impl
Search the web - Allows Claude to search the web and use the results to inform responses - Provides up-to-date infor
chapter5/coding-agent/tools/web_search_tool.py:16
Method_execute_impl
Edit Jupyter notebook cell - Completely replaces the contents of a specific cell - The notebook_path parameter must
chapter5/coding-agent/tools/notebook_edit_tool.py:18
Method_execute_impl
List directory contents - The path parameter must be an absolute path - You can optionally provide an array of glob
chapter5/coding-agent/tools/ls_tool.py:19
Method_execute_impl
Update TODO list - Use this tool to create and manage a structured task list - Track progress, organize complex task
chapter5/coding-agent/tools/todo_write_tool.py:16
Method_execute_impl
Kill a shell session - Kills a running background bash shell by its ID - Takes a shell_id parameter identifying the
chapter5/coding-agent/tools/kill_bash_tool.py:16
Method_execute_impl
Launch sub-agent - Launch a new agent to handle complex, multi-step tasks autonomously - Available agent types: gene
chapter5/coding-agent/tools/task_tool.py:16
Method_execute_impl
Edit file using search and replace - You must use Read tool at least once before editing - Ensure you preserve exact
chapter5/coding-agent/tools/edit_tool.py:18
Method_execute_tool
Execute tool with enhanced logging for educational purposes. This override adds detailed logging to show how contextual
chapter3/contextual-retrieval/contextual_agent.py:98
Method_generate_document_summary
DEPRECATED: Not used in Anthropic's Contextual Retrieval approach. Educational Note: Anthropic's research shows that
chapter3/contextual-retrieval/contextual_chunking.py:362
Method_get_git_status
Get git status
chapter5/coding-agent/agent_new.py:86
Method_get_system_prompt
Enhanced system prompt that leverages contextual information
chapter3/contextual-retrieval/contextual_agent.py:73
Function_invoke_w_o_llm_error
(invocable: Callable[[], T])
chapter2/prompt-engineering/tau_bench/model_utils/api/exception.py:50
Method_load_conversations
Load conversations from a JSON file
chapter3/contextual-retrieval-for-user-memory/contextual_evaluator.py:496
Function_pill
Rounded pill / tag shape.
book/gen_ch3_figs.py:36
Function_run
(idx: int)
chapter2/prompt-engineering/run_ablation.py:276
Function_run
(idx: int)
chapter2/prompt-engineering/tau_bench/run.py:66
Method_run_bash
Execute Bash script.
chapter4/execution-tools/multilang_executor.py:580
Method_run_cpp
Execute C++ code.
chapter4/execution-tools/multilang_executor.py:451
Method_run_datapoint
(model: AnyModel, temp: float | None = None)
chapter2/prompt-engineering/tau_bench/model_utils/api/api.py:169
Method_run_go
Execute Go code.
chapter4/execution-tools/multilang_executor.py:345
Method_run_java
Execute Java code.
chapter4/execution-tools/multilang_executor.py:394
Method_run_javascript
Execute JavaScript code with Node.js.
chapter4/execution-tools/multilang_executor.py:282
Method_run_php
Execute PHP code.
chapter4/execution-tools/multilang_executor.py:550
Method_run_python
Execute Python code.
chapter4/execution-tools/multilang_executor.py:257
Method_run_rust
Execute Rust code.
chapter4/execution-tools/multilang_executor.py:505
Method_run_typescript
Execute TypeScript code with tsx.
chapter4/execution-tools/multilang_executor.py:317
Function_seq_msg
Draw a sequence diagram message arrow with label.
book/gen_ch4_figs.py:37
Method_wrapped_step
Wrapped step method that captures workflow information.
chapter8/browser-use-rpa/learning_agent/agent.py:108
Functionadd_codes
(example)
chapter7/orpheus/orpheus_sft_unsloth.py:132
Methodadd_custom_tool
Add a custom tool to the registry Args: name: Tool name function: Callable function desc
chapter2/local_llm_serving/agent.py:434
Methodadd_item
Add an item to the index.
chapter3/dense-embedding/indexing.py:16
Methodadd_memory
Add a new note
chapter3/user-memory/memory_manager.py:149
Methodadd_memory
Add a new memory card Args: content: Dictionary with 'category', 'subcategory', 'key', and 'value' s
chapter3/user-memory/memory_manager.py:295
Methodadd_memory
Add a new memory card Args: content: Dictionary with 'category', 'card_key', and 'card' (complete memory card ob
chapter3/user-memory/memory_manager.py:473
Methodagent
Lazy initialization of browser-use agent.
chapter8/browser-use-rpa/learning_agent/agent.py:89
Methodanalyze_error
Analyze error output and provide suggestions. Args: tool_name: Name of the tool that produced the error
chapter4/execution-tools/llm_helper.py:129
Methodanalyze_mode
Combined search and analysis mode
chapter1/search-codegen/main.py:136
Functionanalyze_rating_changes
Analyze rating changes over time for top models. Args: history_df: DataFrame from get_rating_history top_n: Number of to
chapter6/elo-leaderboard/leaderboard.py:186
Functionapi_parser
()
chapter2/prompt-engineering/tau_bench/model_utils/args.py:6
Functionapply_filters
(chunk)
chapter6/elo-leaderboard/parallel_processing.py:231
Functionapprox_latency_for_datapoint
(dp: Datapoint, latency_ms_per_output_token: float)
chapter2/prompt-engineering/tau_bench/model_utils/model/completion.py:522
Functionarxiv_categories
Get ArXiv categories.
chapter4/perception-tools/src/main.py:572
Functionarxiv_download
Download ArXiv paper.
chapter4/perception-tools/src/main.py:563
Functionarxiv_paper_details
Get paper details.
chapter4/perception-tools/src/main.py:555
Functionarxiv_search
Search ArXiv.
chapter4/perception-tools/src/main.py:240
Functionaudio_metadata
Extract audio metadata.
chapter4/perception-tools/src/main.py:411
Functionaudio_transcribe
Transcribe audio to text.
chapter4/perception-tools/src/main.py:401
Functionaudio_trim
Trim audio file.
chapter4/perception-tools/src/main.py:456
Methodbatch_rerank
Rerank multiple queries in batch. Args: queries: List of queries documents_list: List of document lists (one
chapter3/retrieval-pipeline/reranker.py:244
Methodbinary_classify
( self, instruction: str, text: str, examples: list[BinaryClassifyDatapoint] |
chapter2/prompt-engineering/tau_bench/model_utils/model/model.py:67
Methodbinary_classify
( self, instruction: str, text: str, examples: list[BinaryClassifyDatapoint] |
chapter2/prompt-engineering/tau_bench/model_utils/model/general_model.py:53
Functionbuild_binary_classify_prompts
( dps: list[BinaryClassifyDatapoint], suffix_strategy: PromptSuffixStrategy | None = None, )
chapter2/prompt-engineering/tau_bench/model_utils/model/chat.py:488
Functionbuild_binary_classify_prompts
( dps: list[BinaryClassifyDatapoint], include_response: bool = True, )
chapter2/prompt-engineering/tau_bench/model_utils/model/completion.py:401
Functionbuild_generate_prompts
(dps: list[GenerateDatapoint])
chapter2/prompt-engineering/tau_bench/model_utils/model/chat.py:570
Functionbuild_generate_prompts
( dps: list[GenerateDatapoint], include_response: bool = True )
chapter2/prompt-engineering/tau_bench/model_utils/model/completion.py:471
← previousnext →1,901–2,000 of 2,925, ranked by callers