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
Function
build_historical_leaderboards
Build leaderboard snapshots at different time points. Args: df: Full voting DataFrame time_slices: List of (end_date, sl
chapter6/elo-leaderboard/leaderboard.py:127
Function
build_historical_leaderboards_parallel
Build historical leaderboards using parallel processing. Args: df: Full voting DataFrame time_slices: List of (end_date,
chapter6/elo-leaderboard/parallel_processing.py:50
Function
build_indexes
()
chapter3/structured-index/api_service.py:155
Function
build_parse_force_prompts
( dps: list[ParseForceDatapoint], suffix_strategy: PromptSuffixStrategy | None = None, )
chapter2/prompt-engineering/tau_bench/model_utils/model/chat.py:545
Function
build_parse_force_prompts
( dps: list[ParseForceDatapoint], include_response: bool = True, )
chapter2/prompt-engineering/tau_bench/model_utils/model/completion.py:447
Function
build_parse_prompts
( dps: list[ParseDatapoint], suffix_strategy: PromptSuffixStrategy | None = None, )
chapter2/prompt-engineering/tau_bench/model_utils/model/chat.py:463
Function
build_parse_prompts
( dps: list[ParseDatapoint], include_response: bool = True, )
chapter2/prompt-engineering/tau_bench/model_utils/model/completion.py:381
Function
build_prompts
( dps: list[Datapoint], prompt_suffix_strategy: PromptSuffixStrategy | None )
chapter2/prompt-engineering/tau_bench/model_utils/model/chat.py:435
Function
build_score_prompts
( dps: list[ScoreDatapoint], suffix_strategy: PromptSuffixStrategy | None = None, )
chapter2/prompt-engineering/tau_bench/model_utils/model/chat.py:578
Function
build_score_prompts
( dps: list[ScoreDatapoint], include_response: bool = True, )
chapter2/prompt-engineering/tau_bench/model_utils/model/completion.py:484
Method
build_tree
Recursively build tree structure.
chapter4/execution-tools/filesystem_enhanced.py:248
Function
cache_call_w_dedup
(func: Callable[..., T])
chapter2/prompt-engineering/tau_bench/model_utils/api/cache.py:56
Method
calculateAudioDuration
(audioBuffer)
chapter9/live-audio/backend/server.js:613
Function
calculate_pairwise_win_rates_chunk
Calculate win rates for a chunk of model pairs. Args: args: Tuple of (model_pairs, df) Returns: List of win
chapter6/elo-leaderboard/parallel_processing.py:99
Method
calculate_stats
Calculate min, max, mean, median for a list of values
chapter2/log-sanitization/metrics.py:79
Method
calculate_win_probability
Calculate win probability using fast NumPy operations. Args: model_a: First model identifier model_b
chapter6/elo-leaderboard/optimized_elo.py:227
Function
calculate_win_rate_matrix_from_data
Calculate empirical win rate matrix directly from vote data. Args: df: DataFrame with columns 'model_a', 'model_b', 'winner'
chapter6/elo-leaderboard/leaderboard.py:41
Function
calculate_win_rate_matrix_parallel
Calculate win rate matrix using parallel processing. Args: df: DataFrame with match data models: List of models to inclu
chapter6/elo-leaderboard/parallel_processing.py:149
Function
calendar_events
Get calendar events.
chapter4/perception-tools/src/main.py:595
Method
capture_action
Capture an action in the current trajectory. Args: action: The action to capture
chapter8/gaia-experience/experience_agent.py:266
Function
catch_model_errors
(func: Callable[..., T])
chapter2/prompt-engineering/tau_bench/model_utils/api/sample.py:21
Method
chat
Chat interface that maintains conversation history Args: message: User message **kwargs: Generation
chapter2/attention_visualization/agent.py:487
Method
chat
Chat using OpenAI-compatible endpoint
chapter2/local_llm_serving/ollama_native.py:343
Function
check_config
Quick configuration check Returns: True if configuration is valid
chapter1/search-codegen/config.py:75
Function
check_openai_key
Check if OpenAI API key is available.
chapter4/collaboration-tools/test_intelligence_tools.py:22
Method
chunk_test_case_conversations
Chunk all conversations in a test case Args: test_case: Test case containing conversation histories
chapter3/agentic-rag-for-user-memory/chunker.py:259
Method
chunk_test_case_conversations
Chunk all conversations in a test case Args: test_case: Test case containing conversation histories
chapter3/contextual-retrieval-for-user-memory/chunker.py:259
Method
classify
( self, instruction: str, text: str, options: list[str], examples: lis
chapter2/prompt-engineering/tau_bench/model_utils/model/chat.py:346
Method
classify
( self, instruction: str, text: str, options: list[str], examples: lis
chapter2/prompt-engineering/tau_bench/model_utils/model/completion.py:273
Method
classify
( self, instruction: str, text: str, options: list[str], examples: lis
chapter2/prompt-engineering/tau_bench/model_utils/model/model.py:54
Method
cleanup
* Cleanup resources
chapter9/live-audio/backend/utils/vad.js:283
Method
clear
Clear all documents.
chapter3/retrieval-pipeline/document_store.py:72
Method
clear
Clear all documents from the store.
chapter3/dense-embedding/document_store.py:145
Function
clearLogs
()
chapter9/live-audio/frontend/pages/index.tsx:475
Function
clear_all
Clear all documents from the pipeline (for testing).
chapter3/retrieval-pipeline/main.py:240
Method
clear_all
Clear all workflows from the knowledge base (use with caution).
chapter8/browser-use-rpa/learning_agent/knowledge_base.py:286
Method
clear_all_memories
Clear all memories for this user - useful for testing
chapter3/user-memory/memory_manager.py:225
Method
clear_all_memories
Clear all memories for this user
chapter3/user-memory/memory_manager.py:577
Method
clear_all_memories
Clear all memory cards
chapter3/contextual-retrieval-for-user-memory/advanced_memory_manager.py:367
Method
clear_history
Clear the conversation history
chapter1/search-codegen/agent.py:310
Method
clear_history
Clear conversation history
chapter1/search-codegen/main.py:83
Method
clear_history
Clear conversation history
chapter3/agentic-rag-for-user-memory/agent.py:355
Method
clear_history
Clear conversation history
chapter3/contextual-retrieval-for-user-memory/agent.py:355
Function
clear_index
Clear all indexed documents
chapter3/sparse-embedding/server.py:464
Function
clear_indexes
Clear the specified indexes.
chapter3/structured-index/api_service.py:342
Method
code_interpreter
Execute Python code directly without restrictions
chapter2/attention_visualization/tools.py:389
Method
code_interpreter
Execute Python code in a full Python environment. This provides unrestricted access to Python's built-in functions and standard libra
chapter2/local_llm_serving/tools.py:411
Method
code_mode
Enter code interpreter mode
chapter1/search-codegen/main.py:124
Method
compare_modes
Compare contextual vs non-contextual modes for the same query. Educational method to demonstrate the difference in retrieval
chapter3/contextual-retrieval/contextual_agent.py:299
Method
compare_retrieval_methods
Compare contextual vs non-contextual retrieval. Educational Note: This method demonstrates the improvement that cont
chapter3/contextual-retrieval/contextual_chunking.py:430
Method
compare_retrieval_methods
Compare contextual vs non-contextual retrieval. Educational Note: This method demonstrates the improvement that cont
chapter3/contextual-retrieval/contextual_tools.py:440
Function
compare_win_rates
Compare predicted win rates from Elo with empirical win rates. Args: elo_system: Trained Elo rating system empirical_df:
chapter6/elo-leaderboard/leaderboard.py:94
Function
comparison_lr
Side-by-side comparison diagram.
book/svg_lib.py:336
Method
compute_similarity
Compute similarity between two vectors. Args: vec1: First vector vec2: Second vector met
chapter3/dense-embedding/embedding_service.py:182
Method
constructor
()
chapter9/live-audio/frontend/public/audioWorklet.js:2
Method
constructor
()
chapter9/live-audio/frontend/public/audioWorklet.js:48
Method
constructor
(ws)
chapter9/live-audio/backend/server.js:27
Method
constructor
()
chapter9/live-audio/backend/utils/speechToText.js:7
Method
constructor
(options = {})
chapter9/live-audio/backend/utils/vad.js:7
Method
constructor
(config, apiKey)
chapter9/live-audio/backend/utils/providers/asrProviders.js:10
Method
constructor
(config, apiKey)
chapter9/live-audio/backend/utils/providers/llmProviders.js:7
Method
constructor
(config, apiKey)
chapter9/live-audio/backend/tests/test-tts-providers.js:33
Method
convert_currency
Convert currency using live exchange rates (simulated)
chapter2/attention_visualization/tools.py:348
Method
convert_currency
Convert currency using live exchange rates (simulated)
chapter2/local_llm_serving/tools.py:331
Method
createChatCompletion
(messages, options = {})
chapter9/live-audio/backend/utils/providers/llmProviders.js:12
Method
createChatCompletion
(messages, options = {})
chapter9/live-audio/backend/utils/providers/llmProviders.js:48
Method
createChatCompletion
(messages, options = {})
chapter9/live-audio/backend/utils/providers/llmProviders.js:99
Method
createProvider
(providerName, config, globalConfig)
chapter9/live-audio/backend/utils/providers/llmProviders.js:202
Method
create_complex_financial_task
Create a complex task that requires multiple tool calls and reasoning Returns: Task description
chapter1/context/main.py:48
Method
create_directories
Create necessary directories if they don't exist
chapter1/context/config.py:146
Method
create_embeddings
Create embeddings for texts using sentence transformers.
chapter3/structured-index/raptor_indexer.py:67
Function
create_input_ids
(example)
chapter7/orpheus/orpheus_sft_unsloth.py:202
Function
create_interactive_leaderboard
Create interactive Plotly visualization of ranking evolution. Args: history_df: DataFrame with columns: date, model, rating, ran
chapter6/elo-leaderboard/visualization.py:180
Function
create_rank_evolution_chart
Create interactive rank evolution chart (lower rank number is better). Args: history_df: DataFrame with columns: date, model, ra
chapter6/elo-leaderboard/visualization.py:233
Function
create_simple_animation
Convenience function to create animation in one step. Args: history_df: DataFrame with rating history output_path: Path
chapter6/elo-leaderboard/animation.py:405
Function
csv_parse
Parse CSV data.
chapter4/perception-tools/src/main.py:388
Function
currency_converter
Convert currency.
chapter4/perception-tools/src/main.py:220
Function
cycle_diagram
Circular cycle diagram with arrows between nodes.
book/svg_lib.py:355
Function
decorator
(func)
chapter3/dense-embedding/logger.py:65
Function
default_api
( log_file: str | None = None, sampling_strategy: SamplingStrategy | None = None, request_router:
chapter2/prompt-engineering/tau_bench/model_utils/api/api.py:388
Function
default_api_from_args
(args: argparse.Namespace)
chapter2/prompt-engineering/tau_bench/model_utils/api/api.py:408
Function
default_quick_api
( log_file: str | None = None, sampling_strategy: SamplingStrategy | None = None, request_router:
chapter2/prompt-engineering/tau_bench/model_utils/api/api.py:414
Function
delete_document
Delete a document from all services.
chapter3/retrieval-pipeline/main.py:172
Function
delete_document
Delete a document from the index. This endpoint: 1. Removes the document from the document store 2. Removes the embedding from t
chapter3/dense-embedding/main.py:305
Method
delete_document
Delete a document from all services. Args: doc_id: Document ID to delete Returns: Deleti
chapter3/retrieval-pipeline/retrieval_pipeline.py:364
Method
delete_document
Delete a document from both services.
chapter3/retrieval-pipeline/retrieval_client.py:180
Method
delete_item
Delete an item from the index.
chapter3/dense-embedding/indexing.py:21
Method
delete_item
Delete an item from the index. Note: ANNOY doesn't support deletion, so we need to rebuild without the item.
chapter3/dense-embedding/indexing.py:108
Method
delete_memory
Delete a note
chapter3/user-memory/memory_manager.py:205
Method
delete_memory
Delete a memory card
chapter3/user-memory/memory_manager.py:362
Method
delete_memory
Delete a memory card
chapter3/user-memory/memory_manager.py:560
Function
disable_cache
()
chapter2/prompt-engineering/tau_bench/model_utils/api/cache.py:20
Function
display_memory_operations
Display memory operations from processing results Args: results: Processing results containing operations verbose: Wheth
chapter3/user-memory/memory_operation_formatter.py:94
Function
document_reader
Read document content.
chapter4/perception-tools/src/main.py:133
Function
docx_extract
Extract content from DOCX.
chapter4/perception-tools/src/main.py:372
Function
download
Download a file from URL.
chapter4/perception-tools/src/main.py:98
Function
enable_cache
()
chapter2/prompt-engineering/tau_bench/model_utils/api/cache.py:26
Function
ensure_memory_cleared
Ensures that all memory is cleared for a given memory manager. Used primarily for testing and evaluation to ensure clean state before each te
chapter3/user-memory/memory_manager.py:646
Method
estimate_tokens
Estimate token count for text (rough approximation) Args: text: Text to estimate tokens for
chapter2/context-compression/compression_strategies.py:656
Method
evaluate
(self, api: tau_bench.model_utils.API)
chapter2/prompt-engineering/tau_bench/model_utils/api/datapoint.py:127
← previous
next →
2,001–2,100 of 2,925, ranked by callers