MCPcopy Create free account

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

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

Functionbuild_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
Functionbuild_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
Functionbuild_indexes
()
chapter3/structured-index/api_service.py:155
Functionbuild_parse_force_prompts
( dps: list[ParseForceDatapoint], suffix_strategy: PromptSuffixStrategy | None = None, )
chapter2/prompt-engineering/tau_bench/model_utils/model/chat.py:545
Functionbuild_parse_force_prompts
( dps: list[ParseForceDatapoint], include_response: bool = True, )
chapter2/prompt-engineering/tau_bench/model_utils/model/completion.py:447
Functionbuild_parse_prompts
( dps: list[ParseDatapoint], suffix_strategy: PromptSuffixStrategy | None = None, )
chapter2/prompt-engineering/tau_bench/model_utils/model/chat.py:463
Functionbuild_parse_prompts
( dps: list[ParseDatapoint], include_response: bool = True, )
chapter2/prompt-engineering/tau_bench/model_utils/model/completion.py:381
Functionbuild_prompts
( dps: list[Datapoint], prompt_suffix_strategy: PromptSuffixStrategy | None )
chapter2/prompt-engineering/tau_bench/model_utils/model/chat.py:435
Functionbuild_score_prompts
( dps: list[ScoreDatapoint], suffix_strategy: PromptSuffixStrategy | None = None, )
chapter2/prompt-engineering/tau_bench/model_utils/model/chat.py:578
Functionbuild_score_prompts
( dps: list[ScoreDatapoint], include_response: bool = True, )
chapter2/prompt-engineering/tau_bench/model_utils/model/completion.py:484
Methodbuild_tree
Recursively build tree structure.
chapter4/execution-tools/filesystem_enhanced.py:248
Functioncache_call_w_dedup
(func: Callable[..., T])
chapter2/prompt-engineering/tau_bench/model_utils/api/cache.py:56
MethodcalculateAudioDuration
(audioBuffer)
chapter9/live-audio/backend/server.js:613
Functioncalculate_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
Methodcalculate_stats
Calculate min, max, mean, median for a list of values
chapter2/log-sanitization/metrics.py:79
Methodcalculate_win_probability
Calculate win probability using fast NumPy operations. Args: model_a: First model identifier model_b
chapter6/elo-leaderboard/optimized_elo.py:227
Functioncalculate_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
Functioncalculate_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
Functioncalendar_events
Get calendar events.
chapter4/perception-tools/src/main.py:595
Methodcapture_action
Capture an action in the current trajectory. Args: action: The action to capture
chapter8/gaia-experience/experience_agent.py:266
Functioncatch_model_errors
(func: Callable[..., T])
chapter2/prompt-engineering/tau_bench/model_utils/api/sample.py:21
Methodchat
Chat interface that maintains conversation history Args: message: User message **kwargs: Generation
chapter2/attention_visualization/agent.py:487
Methodchat
Chat using OpenAI-compatible endpoint
chapter2/local_llm_serving/ollama_native.py:343
Functioncheck_config
Quick configuration check Returns: True if configuration is valid
chapter1/search-codegen/config.py:75
Functioncheck_openai_key
Check if OpenAI API key is available.
chapter4/collaboration-tools/test_intelligence_tools.py:22
Methodchunk_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
Methodchunk_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
Methodclassify
( self, instruction: str, text: str, options: list[str], examples: lis
chapter2/prompt-engineering/tau_bench/model_utils/model/chat.py:346
Methodclassify
( self, instruction: str, text: str, options: list[str], examples: lis
chapter2/prompt-engineering/tau_bench/model_utils/model/completion.py:273
Methodclassify
( self, instruction: str, text: str, options: list[str], examples: lis
chapter2/prompt-engineering/tau_bench/model_utils/model/model.py:54
Methodcleanup
* Cleanup resources
chapter9/live-audio/backend/utils/vad.js:283
Methodclear
Clear all documents.
chapter3/retrieval-pipeline/document_store.py:72
Methodclear
Clear all documents from the store.
chapter3/dense-embedding/document_store.py:145
FunctionclearLogs
()
chapter9/live-audio/frontend/pages/index.tsx:475
Functionclear_all
Clear all documents from the pipeline (for testing).
chapter3/retrieval-pipeline/main.py:240
Methodclear_all
Clear all workflows from the knowledge base (use with caution).
chapter8/browser-use-rpa/learning_agent/knowledge_base.py:286
Methodclear_all_memories
Clear all memories for this user - useful for testing
chapter3/user-memory/memory_manager.py:225
Methodclear_all_memories
Clear all memories for this user
chapter3/user-memory/memory_manager.py:577
Methodclear_all_memories
Clear all memory cards
chapter3/contextual-retrieval-for-user-memory/advanced_memory_manager.py:367
Methodclear_history
Clear the conversation history
chapter1/search-codegen/agent.py:310
Methodclear_history
Clear conversation history
chapter1/search-codegen/main.py:83
Methodclear_history
Clear conversation history
chapter3/agentic-rag-for-user-memory/agent.py:355
Methodclear_history
Clear conversation history
chapter3/contextual-retrieval-for-user-memory/agent.py:355
Functionclear_index
Clear all indexed documents
chapter3/sparse-embedding/server.py:464
Functionclear_indexes
Clear the specified indexes.
chapter3/structured-index/api_service.py:342
Methodcode_interpreter
Execute Python code directly without restrictions
chapter2/attention_visualization/tools.py:389
Methodcode_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
Methodcode_mode
Enter code interpreter mode
chapter1/search-codegen/main.py:124
Methodcompare_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
Methodcompare_retrieval_methods
Compare contextual vs non-contextual retrieval. Educational Note: This method demonstrates the improvement that cont
chapter3/contextual-retrieval/contextual_chunking.py:430
Methodcompare_retrieval_methods
Compare contextual vs non-contextual retrieval. Educational Note: This method demonstrates the improvement that cont
chapter3/contextual-retrieval/contextual_tools.py:440
Functioncompare_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
Functioncomparison_lr
Side-by-side comparison diagram.
book/svg_lib.py:336
Methodcompute_similarity
Compute similarity between two vectors. Args: vec1: First vector vec2: Second vector met
chapter3/dense-embedding/embedding_service.py:182
Methodconstructor
()
chapter9/live-audio/frontend/public/audioWorklet.js:2
Methodconstructor
()
chapter9/live-audio/frontend/public/audioWorklet.js:48
Methodconstructor
(ws)
chapter9/live-audio/backend/server.js:27
Methodconstructor
()
chapter9/live-audio/backend/utils/speechToText.js:7
Methodconstructor
(options = {})
chapter9/live-audio/backend/utils/vad.js:7
Methodconstructor
(config, apiKey)
chapter9/live-audio/backend/utils/providers/asrProviders.js:10
Methodconstructor
(config, apiKey)
chapter9/live-audio/backend/utils/providers/llmProviders.js:7
Methodconstructor
(config, apiKey)
chapter9/live-audio/backend/tests/test-tts-providers.js:33
Methodconvert_currency
Convert currency using live exchange rates (simulated)
chapter2/attention_visualization/tools.py:348
Methodconvert_currency
Convert currency using live exchange rates (simulated)
chapter2/local_llm_serving/tools.py:331
MethodcreateChatCompletion
(messages, options = {})
chapter9/live-audio/backend/utils/providers/llmProviders.js:12
MethodcreateChatCompletion
(messages, options = {})
chapter9/live-audio/backend/utils/providers/llmProviders.js:48
MethodcreateChatCompletion
(messages, options = {})
chapter9/live-audio/backend/utils/providers/llmProviders.js:99
MethodcreateProvider
(providerName, config, globalConfig)
chapter9/live-audio/backend/utils/providers/llmProviders.js:202
Methodcreate_complex_financial_task
Create a complex task that requires multiple tool calls and reasoning Returns: Task description
chapter1/context/main.py:48
Methodcreate_directories
Create necessary directories if they don't exist
chapter1/context/config.py:146
Methodcreate_embeddings
Create embeddings for texts using sentence transformers.
chapter3/structured-index/raptor_indexer.py:67
Functioncreate_input_ids
(example)
chapter7/orpheus/orpheus_sft_unsloth.py:202
Functioncreate_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
Functioncreate_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
Functioncreate_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
Functioncsv_parse
Parse CSV data.
chapter4/perception-tools/src/main.py:388
Functioncurrency_converter
Convert currency.
chapter4/perception-tools/src/main.py:220
Functioncycle_diagram
Circular cycle diagram with arrows between nodes.
book/svg_lib.py:355
Functiondecorator
(func)
chapter3/dense-embedding/logger.py:65
Functiondefault_api
( log_file: str | None = None, sampling_strategy: SamplingStrategy | None = None, request_router:
chapter2/prompt-engineering/tau_bench/model_utils/api/api.py:388
Functiondefault_api_from_args
(args: argparse.Namespace)
chapter2/prompt-engineering/tau_bench/model_utils/api/api.py:408
Functiondefault_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
Functiondelete_document
Delete a document from all services.
chapter3/retrieval-pipeline/main.py:172
Functiondelete_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
Methoddelete_document
Delete a document from all services. Args: doc_id: Document ID to delete Returns: Deleti
chapter3/retrieval-pipeline/retrieval_pipeline.py:364
Methoddelete_document
Delete a document from both services.
chapter3/retrieval-pipeline/retrieval_client.py:180
Methoddelete_item
Delete an item from the index.
chapter3/dense-embedding/indexing.py:21
Methoddelete_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
Methoddelete_memory
Delete a note
chapter3/user-memory/memory_manager.py:205
Methoddelete_memory
Delete a memory card
chapter3/user-memory/memory_manager.py:362
Methoddelete_memory
Delete a memory card
chapter3/user-memory/memory_manager.py:560
Functiondisable_cache
()
chapter2/prompt-engineering/tau_bench/model_utils/api/cache.py:20
Functiondisplay_memory_operations
Display memory operations from processing results Args: results: Processing results containing operations verbose: Wheth
chapter3/user-memory/memory_operation_formatter.py:94
Functiondocument_reader
Read document content.
chapter4/perception-tools/src/main.py:133
Functiondocx_extract
Extract content from DOCX.
chapter4/perception-tools/src/main.py:372
Functiondownload
Download a file from URL.
chapter4/perception-tools/src/main.py:98
Functionenable_cache
()
chapter2/prompt-engineering/tau_bench/model_utils/api/cache.py:26
Functionensure_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
Methodestimate_tokens
Estimate token count for text (rough approximation) Args: text: Text to estimate tokens for
chapter2/context-compression/compression_strategies.py:656
Methodevaluate
(self, api: tau_bench.model_utils.API)
chapter2/prompt-engineering/tau_bench/model_utils/api/datapoint.py:127
← previousnext →2,001–2,100 of 2,925, ranked by callers