Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bojieli/ai-agent-book
/ functions
Functions
2,925 in github.com/bojieli/ai-agent-book
⨍
Functions
2,925
◇
Types & classes
570
↳
Endpoints
80
↓ 1 callers
Method
from_env
Create configuration from environment variables
chapter2/system-hint/config.py:36
↓ 1 callers
Method
from_general_model
( cls, model: GeneralModel, sampling_strategy: SamplingStrategy | None = None,
chapter2/prompt-engineering/tau_bench/model_utils/api/api.py:84
↓ 1 callers
Method
from_json
Deserialize workflow from JSON string
chapter8/browser-use-rpa/learning_agent/workflow.py:158
↓ 1 callers
Method
from_trace
(cls, d: dict[str, Any])
chapter2/prompt-engineering/tau_bench/model_utils/api/datapoint.py:113
↓ 1 callers
Method
from_yaml
Create test case from YAML data
chapter3/contextual-retrieval-for-user-memory/contextual_evaluator.py:67
↓ 1 callers
Function
generate
(prompt, out)
book/gen_cover.py:75
↓ 1 callers
Method
generateAIResponse
()
chapter9/live-audio/backend/server.js:346
↓ 1 callers
Method
generateMessageId
()
chapter9/live-audio/backend/server.js:217
↓ 1 callers
Function
generate_conversation_round
Generate a single conversation round based on scenario
chapter3/user-memory-evaluation/generate_test_cases.py:207
↓ 1 callers
Function
generate_distillation_data
Generate prompt distillation training data. Args: input_file: Path to file containing sentences to classify (one per line)
chapter8/prompt-distillation/create_data.py:144
↓ 1 callers
Method
generate_from_prompt
(self, prompt: str, temperature: float | None = None)
chapter2/prompt-engineering/tau_bench/model_utils/model/completion.py:245
↓ 1 callers
Function
generate_html_animation
Generate standalone HTML file with D3.js bar chart race animation. Args: animation_data: Dictionary from prepare_animation_data
chapter6/elo-leaderboard/animation.py:58
↓ 1 callers
Method
generate_next_step
( self, messages: List[Dict[str, Any]] )
chapter2/prompt-engineering/tau_bench/agents/chat_react_agent.py:37
↓ 1 callers
Function
generate_openai
OpenAI Images API. Uses gpt-image-1 if available, else dall-e-3.
book/gen_cover.py:40
↓ 1 callers
Method
generate_report
Generate a comprehensive report of the ablation study Args: results: List of test results analysis:
chapter1/context/main.py:319
↓ 1 callers
Method
generate_report
Generate a summary report of evaluation results.
chapter3/user-memory-evaluation/evaluator.py:286
↓ 1 callers
Method
generate_report
Generate and save evaluation report.
chapter3/user-memory-evaluation/main.py:183
↓ 1 callers
Method
generate_report
Generate evaluation report Args: output_file: Optional file path to save report Returns:
chapter3/contextual-retrieval-for-user-memory/evaluator.py:521
↓ 1 callers
Method
generate_report
Generate evaluation report
chapter3/contextual-retrieval-for-user-memory/contextual_evaluator.py:644
↓ 1 callers
Function
generate_report_location
()
chapter2/prompt-engineering/tau_bench/model_utils/api/exception.py:28
↓ 1 callers
Function
generate_response
生成多语言推理响应 Args: model: 训练好的模型 tokenizer: 分词器 reasoning_language: 推理使用的语言 user_prompt: 用户提问 max_n
chapter7/MultilingualReasoning/gpt_oss_20b_sft.py:354
↓ 1 callers
Function
generate_speech
Generate speech from text. Args: model: The loaded model processor: The processor text: Text to convert to speec
chapter7/sesame/inference.py:66
↓ 1 callers
Function
generate_speech_batch
Generate speech for multiple texts.
chapter7/sesame/batch_inference.py:81
↓ 1 callers
Method
generate_summary
Generate and log a summary of all results
chapter2/context-compression/run_all_strategies.py:280
↓ 1 callers
Function
generate_summary_report
Generate a comprehensive summary report
chapter2/prompt-engineering/analyze_results.py:238
↓ 1 callers
Function
generate_test_case
Generate a complete test case structure
chapter3/user-memory-evaluation/generate_test_cases.py:242
↓ 1 callers
Function
generate_text
Generate text without streaming
chapter7/continued-pretraining/compare_models.py:51
↓ 1 callers
Method
generate_with_attention_streaming
Generate text with streaming output while tracking attention, returning GenerationResult format Args: prompt: In
chapter2/attention_visualization/main.py:207
↓ 1 callers
Method
generate_with_streaming
Generate text with token-by-token streaming and stop at EOS Args: prompt: Input prompt max_new_token
chapter2/attention_visualization/main.py:85
↓ 1 callers
Method
getHeaders
()
chapter9/live-audio/backend/utils/providers/llmProviders.js:90
↓ 1 callers
Method
getProviderInfo
* Get current provider information * @returns {Object} Current provider information
chapter9/live-audio/backend/utils/speechToText.js:133
↓ 1 callers
Method
get_all_legal_documents
Get all legal documents from local laws directory
chapter3/contextual-retrieval/index_local_laws_contextual.py:112
↓ 1 callers
Method
get_all_legal_documents
Get all legal documents from local laws directory
chapter3/agentic-rag/index_local_laws.py:98
↓ 1 callers
Function
get_api_config
Get API configuration from environment.
chapter3/structured-index/config.py:84
↓ 1 callers
Method
get_api_key
Get API key for the specified provider Args: provider: Provider name (defaults to LLM_PROVIDER)
chapter1/context/config.py:68
↓ 1 callers
Function
get_archived_content
Get content from archived webpage. Args: url: URL to retrieve timestamp: Wayback timestamp (YYYYMMDDhhmmss)
chapter4/perception-tools/src/wayback_enhanced.py:21
↓ 1 callers
Function
get_article_categories
Get categories for Wikipedia article. Args: title: Article title language: Language code Returns: T
chapter4/perception-tools/src/wiki_enhanced.py:83
↓ 1 callers
Function
get_article_content
Get full Wikipedia article content. Args: title: Article title language: Language code Returns: Tex
chapter4/perception-tools/src/wiki_enhanced.py:23
↓ 1 callers
Function
get_article_history
Get historical version of Wikipedia article. Args: title: Article title date: Target date (YYYY/MM/DD) language:
chapter4/perception-tools/src/wiki_enhanced.py:180
↓ 1 callers
Function
get_article_links
Get links from Wikipedia article. Args: title: Article title language: Language code Returns: TextC
chapter4/perception-tools/src/wiki_enhanced.py:131
↓ 1 callers
Function
get_arxiv_categories
Get list of ArXiv subject categories. Returns: TextContent with categories
chapter4/perception-tools/src/arxiv_enhanced.py:157
↓ 1 callers
Method
get_attention_steps
Convert cached data into AttentionStep objects
chapter2/attention_visualization/agent.py:131
↓ 1 callers
Function
get_bootstrap_result
Compute bootstrap confidence intervals for Elo ratings. Args: battles: DataFrame with battle data func_compute_elo: Func
chapter6/elo-leaderboard/bradley_terry.py:153
↓ 1 callers
Method
get_by_id
Get a specific test case by ID.
chapter3/user-memory-evaluation/models.py:108
↓ 1 callers
Function
get_calendar_events
Get events from Google Calendar. Args: start_date: Start date (ISO format, defaults to today) end_date: End date (ISO fo
chapter4/perception-tools/src/private_data_tools.py:20
↓ 1 callers
Method
get_capability
Return the capability of the model, a float between 0.0 and 1.0.
chapter2/prompt-engineering/tau_bench/model_utils/model/model.py:35
↓ 1 callers
Method
get_client_config
Get OpenAI client configuration
chapter3/agentic-rag-for-user-memory/config.py:87
↓ 1 callers
Method
get_client_config
Get OpenAI client configuration
chapter3/agentic-rag/config.py:96
↓ 1 callers
Method
get_command_history
Get recent command history. Args: count: Number of recent commands Returns: Dic
chapter4/execution-tools/terminal_controller.py:480
↓ 1 callers
Function
get_crypto_price
Get cryptocurrency price information using CoinGecko API (free, no API key required). Args: symbol: Cryptocurrency symbol or ID
chapter4/perception-tools/src/public_data_tools.py:539
↓ 1 callers
Method
get_current_directory
Get the current working directory. Returns: Dictionary with current directory path
chapter4/execution-tools/terminal_controller.py:92
↓ 1 callers
Method
get_data_hash
(self)
chapter2/prompt-engineering/tau_bench/envs/base.py:121
↓ 1 callers
Function
get_default_sampling_strategy
()
chapter2/prompt-engineering/tau_bench/model_utils/api/sample.py:231
↓ 1 callers
Method
get_documents_by_ids
Retrieve multiple documents by their IDs. Args: doc_ids: List of document IDs Returns:
chapter3/dense-embedding/document_store.py:153
↓ 1 callers
Method
get_evaluator_config
Get configuration for the specified evaluator.
chapter3/user-memory-evaluation/config.py:33
↓ 1 callers
Method
get_history
Get the current conversation history
chapter1/search-codegen/agent.py:315
↓ 1 callers
Function
get_image_metadata
Get detailed image metadata including EXIF data. Args: image_path: Path to image file Returns: TextContent
chapter4/perception-tools/src/media_processing_tools.py:654
↓ 1 callers
Method
get_index_info
Get comprehensive information about the index
chapter3/sparse-embedding/bm25_engine.py:465
↓ 1 callers
Method
get_index_structure
Get a visualization-friendly representation of the index
chapter3/sparse-embedding/bm25_engine.py:210
↓ 1 callers
Method
get_info
()
chapter2/prompt-engineering/tau_bench/envs/tool.py:11
↓ 1 callers
Method
get_llm_config
Get LLM configuration based on provider.
chapter4/execution-tools/config.py:81
↓ 1 callers
Method
get_output
(self)
chapter2/context-compression/run_all_strategies.py:156
↓ 1 callers
Function
get_output_non_blocking
Read output non-blocking to avoid hanging.
chapter4/execution-tools/multilang_executor.py:26
↓ 1 callers
Function
get_paper_details
Get detailed information about an ArXiv paper. Args: paper_id: ArXiv paper ID (e.g., '2301.07041') Returns:
chapter4/perception-tools/src/arxiv_enhanced.py:20
↓ 1 callers
Method
get_recent_turns
Get recent conversation turns Args: limit: Maximum number of turns to return Returns:
chapter3/user-memory/conversation_history.py:114
↓ 1 callers
Method
get_retrieval_metrics
Get detailed retrieval metrics for analysis
chapter3/contextual-retrieval/contextual_agent.py:285
↓ 1 callers
Method
get_session_id
Get the current session ID
chapter3/user-memory/conversational_agent.py:259
↓ 1 callers
Method
get_statistics
Get pipeline statistics. Returns: Statistics dictionary
chapter3/retrieval-pipeline/retrieval_pipeline.py:388
↓ 1 callers
Method
get_stats
Get store statistics.
chapter3/retrieval-pipeline/document_store.py:82
↓ 1 callers
Function
get_stock_price
Get stock price information. Args: symbol: Stock ticker symbol (e.g., AAPL, TSLA) interval: Data interval (1d, 1h, etc.)
chapter4/perception-tools/src/public_data_tools.py:149
↓ 1 callers
Function
get_tool_definitions
Get OpenAI-format tool definitions
chapter3/contextual-retrieval/tools.py:481
↓ 1 callers
Function
get_tool_definitions
Get OpenAI-format tool definitions
chapter3/agentic-rag/tools.py:457
↓ 1 callers
Method
get_total_cost
(self)
chapter2/prompt-engineering/tau_bench/envs/user.py:84
↓ 1 callers
Method
get_user_input
Get user input with a nice prompt
chapter5/coding-agent/main.py:289
↓ 1 callers
Function
google_search_api
Search Google using Custom Search API. Args: query: Search query num_results: Number of results (1-10) safe_sear
chapter4/perception-tools/src/google_search_enhanced.py:22
↓ 1 callers
Function
greet
Return a friendly greeting for the given name.
chapter5/coding-agent/hello_world.py:5
↓ 1 callers
Function
greet
(name)
chapter4/execution-tools/test_script.py:1
↓ 1 callers
Function
grep_search
Search for a pattern in files using grep-like functionality. Args: pattern: Regular expression pattern to search for dir
chapter4/perception-tools/src/filesystem_tools.py:87
↓ 1 callers
Function
handleInterrupt
()
chapter9/live-audio/frontend/pages/index.tsx:495
↓ 1 callers
Function
handleTrajectorySelect
(index: number)
chapter2/attention_visualization/frontend/pages/index.tsx:160
↓ 1 callers
Method
handle_command
Handle special commands. Returns True if it was a command, False otherwise.
chapter5/coding-agent/main.py:151
↓ 1 callers
Method
hasSufficientAudio
* Check if audio buffer has sufficient content for transcription * @param {Buffer} audioBuffer - Audio buffer to check * @returns {boolean} True
chapter9/live-audio/backend/utils/speechToText.js:110
↓ 1 callers
Function
hash_func_call
(func: Callable[..., Any], args: tuple[Any], kwargs: dict[str, Any])
chapter2/prompt-engineering/tau_bench/model_utils/api/cache.py:46
↓ 1 callers
Function
hash_item
(item: Any)
chapter2/prompt-engineering/tau_bench/model_utils/api/cache.py:32
↓ 1 callers
Method
index_batch
Index multiple documents at once
chapter3/sparse-embedding/bm25_engine.py:402
↓ 1 callers
Method
index_chunk
Index a contextual chunk in the retrieval pipeline
chapter3/contextual-retrieval/index_local_laws_contextual.py:236
↓ 1 callers
Method
index_chunk
Index a chunk in the retrieval pipeline
chapter3/agentic-rag/index_local_laws.py:260
↓ 1 callers
Method
index_conversation
Index a conversation turn in Dify Args: turn: Conversation turn to index
chapter3/user-memory/conversation_history.py:186
↓ 1 callers
Method
index_document_dense
Index a document in the dense embedding service.
chapter3/retrieval-pipeline/retrieval_client.py:30
↓ 1 callers
Method
index_document_sparse
Index a document in the sparse embedding service.
chapter3/retrieval-pipeline/retrieval_client.py:48
↓ 1 callers
Function
index_documents
Index documents into knowledge base
chapter3/agentic-rag/quickstart.py:97
↓ 1 callers
Function
index_sample_documents
Index a collection of sample documents
chapter3/sparse-embedding/demo.py:46
↓ 1 callers
Function
index_to_alpha
(index: int)
chapter2/prompt-engineering/tau_bench/model_utils/model/utils.py:29
↓ 1 callers
Function
init_agent
Initialize the agent with optional MCP tools
chapter4/agent-with-event-trigger/server_fastapi.py:97
↓ 1 callers
Function
init_agent
Initialize the agent with optional MCP tools
chapter4/agent-with-event-trigger/server.py:97
↓ 1 callers
Method
initializeLLMProvider
* Initialize LLM provider based on configuration
chapter9/live-audio/backend/server.js:83
↓ 1 callers
Method
initializeProvider
* Initialize ASR provider based on configuration
chapter9/live-audio/backend/utils/speechToText.js:18
↓ 1 callers
Method
initializeSileroVAD
* Initialize the Silero VAD ONNX model
chapter9/live-audio/backend/utils/vad.js:41
↓ 1 callers
Method
initialize_agent
Initialize the agent
chapter5/coding-agent/main.py:114
↓ 1 callers
Method
insert_file_content
Insert content at specific line in file. Args: file_path: File path content: Content to insert
chapter4/execution-tools/terminal_controller.py:297
← previous
next →
1,101–1,200 of 2,925, ranked by callers