MCPcopy Create free account

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

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

↓ 5 callersMethodanswer_question
Answer a question about user conversation history using RAG Args: question: The question to answer t
chapter3/contextual-retrieval-for-user-memory/agent.py:186
↓ 5 callersMethodchat
Send a message to the agent Args: message: User message use_tools: Whether to enable tool calling
chapter2/local_llm_serving/main.py:158
↓ 5 callersMethodchoose_action
Choose an action using epsilon-greedy strategy.
chapter1/learning-from-experience/rl_agent.py:67
↓ 5 callersMethodclear_history
Clear conversation history
chapter3/agentic-rag/agent.py:431
↓ 5 callersMethodcode_interpreter
Execute code in a sandboxed environment with multi-language support. Args: code: Code to execute lan
chapter4/execution-tools/execution_tools.py:22
↓ 5 callersMethodcount_tokens
Count the number of tokens in a text string.
chapter2/context-compression/compression_strategies.py:69
↓ 5 callersFunctioncreate_memory_manager
Factory function to create appropriate memory manager Args: user_id: User identifier mode: Memory mode (defaults to conf
chapter3/user-memory/memory_manager.py:621
↓ 5 callersFunctiondisplay_sample
(instr: str, t: str, min: int, max: int, response: int | None = None)
chapter2/prompt-engineering/tau_bench/model_utils/model/completion.py:61
↓ 5 callersMethodevaluate
Evaluate an agent's response against the test case criteria. Args: test_case: The test case being evaluated
chapter3/user-memory-evaluation/evaluator.py:40
↓ 5 callersMethodevaluate_test_case
Evaluate a single test case Args: test_id: The test case ID to evaluate Returns:
chapter3/contextual-retrieval-for-user-memory/evaluator.py:290
↓ 5 callersMethodgenerate_message
( self, messages: list[Message], force_json: bool, temperature: float | None = None )
chapter2/prompt-engineering/tau_bench/model_utils/model/chat.py:297
↓ 5 callersMethodget_api_key
Get API key for specified provider (or configured provider if not specified)
chapter5/coding-agent/config.py:43
↓ 5 callersMethodget_client_config
Get OpenAI client configuration
chapter3/contextual-retrieval-for-user-memory/config.py:87
↓ 5 callersFunctionget_company_info
Get company information and business details. Args: symbol: Stock ticker symbol Returns: TextContent with c
chapter4/perception-tools/src/yahoo_finance_tools.py:234
↓ 5 callersFunctionget_historical_data
Retrieve historical stock data. Args: symbol: Stock ticker symbol start: Start date (YYYY-MM-DD) end: End date (
chapter4/perception-tools/src/yahoo_finance_tools.py:135
↓ 5 callersMethodget_model_config
Get configuration for a specific model
chapter3/multimodal-agent/config.py:89
↓ 5 callersMethodget_provider
Get the configured provider
chapter5/coding-agent/config.py:38
↓ 5 callersMethodhandle_generate_message_response
( self, prompt: list[dict[str, str] | Message], content: str, force_json: bool )
chapter2/prompt-engineering/tau_bench/model_utils/model/chat.py:302
↓ 5 callersMethodincrement_conversation_count
Increment the conversation counter
chapter3/user-memory/background_memory_processor.py:488
↓ 5 callersFunctioninit_browser
Initialize browser session.
chapter4/collaboration-tools/src/browser_tools.py:15
↓ 5 callersMethodlogEvent
(type, details = {})
chapter9/live-audio/backend/server.js:208
↓ 5 callersMethodquery
Process a user query using the ReAct pattern. Args: user_query: The user's question stream: Whether
chapter3/contextual-retrieval/agent.py:162
↓ 5 callersMethodrequest_approval
Request LLM approval for a dangerous operation. Args: operation: The operation name details: Details
chapter4/execution-tools/llm_helper.py:24
↓ 5 callersMethodstep
(self, action: Action)
chapter2/prompt-engineering/tau_bench/envs/base.py:90
↓ 4 callersMethod_answer_with_context
Answer a query given extracted text context
chapter3/multimodal-agent/agent.py:703
↓ 4 callersMethod_get_element
Get element using stable selectors with fallback. Args: step: The step containing selector information
chapter8/browser-use-rpa/learning_agent/replay.py:176
↓ 4 callersMethod_get_state_hash
Create a hashable representation of the game state. This is crucial for tabular Q-learning.
chapter1/learning-from-experience/rl_agent.py:51
↓ 4 callersFunctionadd_md_close_tag
(prompt: str)
chapter2/prompt-engineering/tau_bench/model_utils/model/utils.py:145
↓ 4 callersMethodadd_turn
Add a conversation turn Args: session_id: Session identifier user_message: User's message
chapter3/user-memory/conversation_history.py:91
↓ 4 callersFunctionapply_suffix_strategy
(response: str, suffix_strategy: PromptSuffixStrategy)
chapter2/prompt-engineering/tau_bench/model_utils/model/chat.py:602
↓ 4 callersMethodbuild_generate_message_state
(self, messages: list[Message])
chapter2/prompt-engineering/tau_bench/model_utils/model/chat.py:324
↓ 4 callersFunctioncalculate_statistics
Calculate statistics for a list of rewards
chapter2/prompt-engineering/analyze_results.py:80
↓ 4 callersMethodcalculate_win_probability
Calculate win probability of model_a against model_b based on current ratings. Args: model_a: First model identi
chapter6/elo-leaderboard/elo_rating.py:118
↓ 4 callersMethodchat
Main chat interface with streaming support
chapter3/multimodal-agent/agent.py:755
↓ 4 callersMethodchunk_conversation
Chunk a single conversation into segments Args: conversation_id: Unique conversation identifier test
chapter3/contextual-retrieval-for-user-memory/chunker.py:105
↓ 4 callersMethodchunk_document
Chunk a document with optional contextual enhancement. Educational Note: This is the core innovation - each chunk ge
chapter3/contextual-retrieval/contextual_chunking.py:113
↓ 4 callersMethodcircle
(self, cx, cy, r, fill='light', label=None, font_size=FS_SMALL)
book/svg_lib.py:190
↓ 4 callersMethodclear
Clear the chain results
chapter1/search-codegen/agent.py:374
↓ 4 callersMethodclear
Clear all documents.
chapter3/retrieval-pipeline/demo.py:38
↓ 4 callersMethodcontextual_search
Perform contextual search using specified method. Args: query: Search query method: Search method -
chapter3/contextual-retrieval/contextual_tools.py:224
↓ 4 callersMethoddisconnect_all
Cleanup MCP manager (no persistent connections to close) Since we spawn fresh connections for each tool call, there'
chapter4/agent-with-event-trigger/agent.py:194
↓ 4 callersFunctiondisplay_sample
( instr: str, ty: type[T] | dict[str, Any], t: str | None = None, response: T
chapter2/prompt-engineering/tau_bench/model_utils/model/chat.py:94
↓ 4 callersFunctiondownload_file_from_url
Download file from URL to temporary location. Args: url: URL to download from timeout: Request timeout in seconds
chapter4/perception-tools/src/base.py:74
↓ 4 callersMethodevaluate_test_case
Evaluate a single test case with dual memory system Args: test_id: Test case ID Returns:
chapter3/contextual-retrieval-for-user-memory/contextual_evaluator.py:261
↓ 4 callersFunctionexecute_and_filter_model_errors
( funcs: list[Callable[[], T]], max_concurrency: int | None = None, )
chapter2/prompt-engineering/tau_bench/model_utils/api/exception.py:46
↓ 4 callersMethodexecute_research
Execute the research task Args: max_iterations: Maximum number of tool calls Returns:
chapter2/context-compression/agent.py:473
↓ 4 callersMethodgetHeaders
()
chapter9/live-audio/backend/utils/providers/llmProviders.js:141
↓ 4 callersMethodget_base_url
Get base URL for the configured provider
chapter5/coding-agent/config.py:64
↓ 4 callersFunctionget_client
Get or create the global PubChem client.
chapter4/perception-tools/src/pubchem_tools.py:112
↓ 4 callersFunctionget_compound_properties
Retrieve detailed chemical properties for a PubChem compound. Args: cid: PubChem Compound ID properties: List of propert
chapter4/perception-tools/src/pubchem_tools.py:239
↓ 4 callersFunctionget_env
( env_name: str, user_strategy: Union[str, UserStrategy], user_model: str, task_split: str,
chapter2/prompt-engineering/tau_bench/envs/__init__.py:8
↓ 4 callersMethodget_graph_statistics
Get statistics about the knowledge graph.
chapter3/structured-index/graphrag_indexer.py:505
↓ 4 callersFunctionget_graphrag_config
Get GraphRAG configuration from environment.
chapter3/structured-index/config.py:70
↓ 4 callersMethodget_hidden_rules
Return the hidden game rules (for debugging/analysis).
chapter1/learning-from-experience/game_environment.py:478
↓ 4 callersFunctionget_raptor_config
Get RAPTOR configuration from environment.
chapter3/structured-index/config.py:55
↓ 4 callersMethodget_rating
Get current rating for a model, initializing if necessary.
chapter6/elo-leaderboard/elo_rating.py:31
↓ 4 callersMethodget_statistics
Get chunking statistics
chapter3/contextual-retrieval/contextual_chunking.py:455
↓ 4 callersMethodget_statistics
Get comprehensive statistics
chapter3/contextual-retrieval-for-user-memory/contextual_indexer.py:649
↓ 4 callersMethodget_tree_statistics
Get statistics about the RAPTOR tree.
chapter3/structured-index/raptor_indexer.py:297
↓ 4 callersMethodgoogle_calendar_add
Add event to Google Calendar. Args: summary: Event title start_time: Start time (ISO 8601 format or
chapter4/execution-tools/external_tools.py:87
↓ 4 callersMethodhandle_event
Handle an incoming event and generate a response Args: event: The event to handle max_iterations: Ma
chapter4/agent-with-event-trigger/agent.py:995
↓ 4 callersFunctionis_url
Check if the given string is a URL. Args: path_or_url: String to check Returns: True if the string is a URL
chapter4/perception-tools/src/base.py:36
↓ 4 callersFunctionjson_response_to_obj_or_partial_obj
( response: dict[str, Any], typ: type[T] | dict[str, Any] )
chapter2/prompt-engineering/tau_bench/model_utils/model/utils.py:54
↓ 4 callersMethodkill
Terminate the shell session
chapter5/coding-agent/tools/shell_session.py:82
↓ 4 callersMethodload_test_cases
Load test cases from the evaluation framework
chapter3/agentic-rag-for-user-memory/main.py:100
↓ 4 callersMethodmake_request
Make a rate-limited request to PubChem API with retry for async operations.
chapter4/perception-tools/src/pubchem_tools.py:76
↓ 4 callersMethodparse_force_from_prompt
( self, prompt: str, typ: BaseModel | dict[str, Any], temperature: float | None = None )
chapter2/prompt-engineering/tau_bench/model_utils/model/completion.py:249
↓ 4 callersMethodplay_episode
Play one episode of the game.
chapter1/learning-from-experience/llm_agent.py:267
↓ 4 callersFunctionprint_result
Print formatted result
chapter2/system-hint/main.py:30
↓ 4 callersFunctionprint_section
Print a formatted section header
chapter2/system-hint/main.py:23
↓ 4 callersMethodprocess_conversation_history
Process conversation history with both contextual chunking and memory cards. Args: chunks: Basic conversation ch
chapter3/contextual-retrieval-for-user-memory/contextual_indexer.py:118
↓ 4 callersMethodread_text_file
Read a text file with size limits. Args: file_path: Path to the file encoding: File encoding
chapter4/execution-tools/filesystem_enhanced.py:43
↓ 4 callersMethodreset
(self, task_index: Optional[int] = None)
chapter2/prompt-engineering/tau_bench/envs/base.py:78
↓ 4 callersMethodreset_conversation
Reset conversation history
chapter2/local_llm_serving/main.py:176
↓ 4 callersMethodrun
Run the interactive CLI
chapter1/search-codegen/main.py:236
↓ 4 callersFunctionrun_and_catch_api_error
( callable: Callable[..., Any], response: Any, datapoint: dict[str, Any] )
chapter2/prompt-engineering/tau_bench/model_utils/api/datapoint.py:265
↓ 4 callersMethodsave_memory
Save notes to storage
chapter3/user-memory/memory_manager.py:133
↓ 4 callersMethodsave_memory
Save JSON memory cards to storage
chapter3/user-memory/memory_manager.py:279
↓ 4 callersMethodsave_memory
Save advanced JSON memory cards to storage
chapter3/user-memory/memory_manager.py:457
↓ 4 callersMethodsave_memory
Save memory cards to storage
chapter3/contextual-retrieval-for-user-memory/advanced_memory_manager.py:118
↓ 4 callersMethodsave_workflow
Save a workflow to persistent storage. Args: workflow: The workflow to save
chapter8/browser-use-rpa/learning_agent/knowledge_base.py:60
↓ 4 callersMethodsearch
Search the index for relevant chunks using retrieval pipeline Args: query: Search query top_k: Numbe
chapter3/agentic-rag-for-user-memory/indexer.py:272
↓ 4 callersMethodsearch
Search for documents matching the query
chapter3/sparse-embedding/bm25_engine.py:417
↓ 4 callersFunctionsend_slack_message
Send a Slack message via webhook. Args: message: Message text to send webhook_url: Optional Slack webhook URL (uses default i
chapter4/collaboration-tools/src/notification_tools.py:264
↓ 4 callersMethodsize
Get the number of documents.
chapter3/retrieval-pipeline/document_store.py:78
↓ 4 callersMethodstop
Stop the vLLM server
chapter2/local_llm_serving/server.py:132
↓ 4 callersMethodto_dict
Convert event to dictionary for JSON serialization
chapter4/agent-with-event-trigger/event_types.py:74
↓ 4 callersMethodto_dict
(self)
chapter3/contextual-retrieval/tools.py:23
↓ 4 callersMethodto_dict
(self)
chapter3/agentic-rag/tools.py:23
↓ 4 callersMethodtranscribe
(audioBuffer, options = {})
chapter9/live-audio/backend/utils/providers/asrProviders.js:55
↓ 4 callersFunctionundo_move
Undo the last move. Returns: Dictionary with board state after undo
chapter4/collaboration-tools/src/chess_tools.py:329
↓ 4 callersMethodvalidate
Validate configuration
chapter5/coding-agent/config.py:71
↓ 4 callersMethodvirtual_terminal
Execute shell command in a virtual terminal. Args: command: Shell command to execute timeout: Timeou
chapter4/execution-tools/execution_tools.py:127
↓ 4 callersFunctionwrite_excel_data
Write data to Excel file. Args: file_path: Path to Excel file data: Dictionary of {sheet_name: [rows]} overwrite
chapter4/collaboration-tools/src/excel_tools.py:77
↓ 3 callersMethod__init__
Initialize memory manager Args: user_id: Unique identifier for the user verbose: Whether to print de
chapter3/user-memory/memory_manager.py:62
↓ 3 callersMethod_extract_pdf_to_text
Extract PDF to text using OCR with thinking mode
chapter3/multimodal-agent/agent.py:553
↓ 3 callersMethod_extract_tools_from_trajectory
Extract unique tools used from trajectory. Args: trajectory: Execution trajectory Returns:
chapter8/gaia-experience/trajectory_summarizer.py:250
↓ 3 callersMethod_format_size
Format file size in human-readable format.
chapter4/execution-tools/filesystem_enhanced.py:670
↓ 3 callersMethod_init_system_prompt
Initialize the system prompt
chapter3/user-memory/conversational_agent.py:120
↓ 3 callersFunction_is_trace
(obj: dict[str, Any])
chapter2/prompt-engineering/tau_bench/model_utils/api/datapoint.py:18
← previousnext →101–200 of 2,925, ranked by callers