MCPcopy Create free account

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

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

↓ 1 callersFunctionprep_for_json_serialization
(obj: Any, from_parse_method: bool = False)
chapter2/prompt-engineering/tau_bench/model_utils/api/logging.py:15
↓ 1 callersFunctionprepare_animation_data
Prepare data for D3.js bar chart race animation. Args: history_df: DataFrame with columns: date, model, rating, rank top
chapter6/elo-leaderboard/animation.py:11
↓ 1 callersFunctionprepare_model_and_tokenizer
Load model and tokenizer, optionally with LoRA. Args: model_name: Model name or path use_lora: Whether to use LoRA for e
chapter8/prompt-distillation/train_sft_trl.py:57
↓ 1 callersFunctionprepare_model_for_lora
配置 LoRA(低秩适应)进行高效微调 LoRA 只训练少量参数,大大减少内存使用和训练时间。 针对 openai/gpt-oss-20b 的 MoE(混合专家)架构,除了注意力层外, 还需要特别指定 MLP 专家层进行训练。 Args:
chapter7/MultilingualReasoning/gpt_oss_20b_sft.py:143
↓ 1 callersMethodprepare_test_case
Prepare a test case by chunking and indexing its conversations Args: test_id: The test case ID to prepare
chapter3/agentic-rag-for-user-memory/evaluator.py:239
↓ 1 callersMethodprepare_test_case
Prepare a test case by chunking and indexing its conversations Args: test_id: The test case ID to prepare
chapter3/contextual-retrieval-for-user-memory/evaluator.py:239
↓ 1 callersFunctionpreprocessSentence
(sentence, language = 'en')
chapter9/live-audio/backend/utils/textProcessor.js:174
↓ 1 callersFunctionprint_banner
Print demo banner
chapter2/context-compression/main.py:19
↓ 1 callersFunctionprint_banner
打印欢迎横幅
chapter1/web-search-agent/quickstart.py:28
↓ 1 callersMethodprint_config
Print current configuration (hiding sensitive data)
chapter2/context-compression/config.py:74
↓ 1 callersFunctionprint_confusion_matrix
Pretty print confusion matrix and analysis.
chapter8/prompt-distillation/evaluate.py:244
↓ 1 callersFunctionprint_results_table
Print a formatted table of results
chapter2/prompt-engineering/analyze_results.py:103
↓ 1 callersMethodprint_results_table
Print results in a formatted table Args: results: List of test results
chapter1/context/main.py:241
↓ 1 callersFunctionprint_section
Print a colored section header
chapter7/continued-pretraining/compare_models.py:23
↓ 1 callersFunctionprint_section
Print a colored section header
chapter7/continued-pretraining/continued-pretrain.py:44
↓ 1 callersFunctionprint_section
Print a formatted section header.
chapter3/dense-embedding/quick_demo.py:8
↓ 1 callersMethodprint_status
Print agent status
chapter5/coding-agent/main.py:74
↓ 1 callersMethodprint_summary
Print evaluation summary
chapter3/contextual-retrieval/evaluation/evaluate.py:292
↓ 1 callersMethodprint_summary
Print evaluation summary
chapter3/agentic-rag/evaluation/evaluate.py:292
↓ 1 callersMethodprocessAudioChunk
* Process audio chunk and detect voice activity using Silero VAD * @param {Buffer} audioChunk - Raw audio data * @returns {Promise<Array>} VAD r
chapter9/live-audio/backend/utils/vad.js:138
↓ 1 callersMethodprocessAudioWithVAD
* Process audio chunk through VAD * @param {Buffer} audioChunk - Raw audio data
chapter9/live-audio/backend/server.js:225
↓ 1 callersMethodprocessSpeechSegment
* Process speech segment with STT * @param {Buffer} audioData - Speech audio data * @param {number} duration - Duration of speech in ms
chapter9/live-audio/backend/server.js:246
↓ 1 callersMethodprocessTTSQueue
()
chapter9/live-audio/backend/server.js:706
↓ 1 callersMethodprocess_all_documents
Process all legal documents with contextual chunking
chapter3/contextual-retrieval/index_local_laws_contextual.py:351
↓ 1 callersMethodprocess_all_documents
Process all legal documents
chapter3/agentic-rag/index_local_laws.py:319
↓ 1 callersMethodprocess_conversation_batch
Process multiple conversation contexts in batch Args: conversation_contexts: List of conversation contexts
chapter3/user-memory/background_memory_processor.py:597
↓ 1 callersMethodprocess_document
Process a document using contextual chunking with optional immediate indexing
chapter3/contextual-retrieval/index_local_laws_contextual.py:187
↓ 1 callersFunctionprocess_elo_updates_vectorized
Process Elo updates using vectorized NumPy operations with Numba JIT. This is the core hot loop optimized with Numba for maximum perform
chapter6/elo-leaderboard/optimized_elo.py:27
↓ 1 callersFunctionprocess_file
(path, dry_run=False)
book/strip_titles.py:36
↓ 1 callersFunctionprocess_file
Process a single file with the agent
chapter3/multimodal-agent/main.py:16
↓ 1 callersMethodprocess_matches_vectorized
Process all matches using vectorized NumPy operations and Numba JIT. This is the fastest way to compute Elo ratings for larg
chapter6/elo-leaderboard/optimized_elo.py:159
↓ 1 callersMethodprocess_test_case
Process all conversations in a test case
chapter2/log-sanitization/agent.py:302
↓ 1 callersFunctionpronounceCodeBlock
(text)
chapter9/live-audio/backend/utils/textProcessor.js:164
↓ 1 callersFunctionpronounceNumbers
(text, language)
chapter9/live-audio/backend/utils/textProcessor.js:143
↓ 1 callersFunctionprovide_recommendations
Provide recommendations based on system
chapter2/local_llm_serving/check_compatibility.py:77
↓ 1 callersMethodquery
Process query with contextual retrieval and detailed logging. This override adds educational logging to show the retrieval p
chapter3/contextual-retrieval/contextual_agent.py:253
↓ 1 callersFunctionquery_indexes
Query RAPTOR and/or GraphRAG indexes.
chapter3/structured-index/main.py:52
↓ 1 callersFunctionquick_integration_test
Quick integration test with real browser-use.
chapter8/browser-use-rpa/test_validation.py:312
↓ 1 callersFunctionquick_test
Quick test with simple task.
chapter8/browser-use-rpa/demo_email.py:227
↓ 1 callersFunctionquick_test
Run a quick test with context-aware citations strategy
chapter2/context-compression/quickstart.py:40
↓ 1 callersFunctionquickstart
Quick demonstration of the execution tools.
chapter4/execution-tools/quickstart.py:9
↓ 1 callersFunctionquickstart
Run a quick demonstration of the memory system with separated architecture
chapter3/user-memory/quickstart.py:21
↓ 1 callersFunctionread_document
Read and extract content from documents (PDF, DOCX, PPTX). Args: file_path: Path to the document file (or URL) extract_i
chapter4/perception-tools/src/multimodal_tools.py:108
↓ 1 callersMethodread_document
Read a legal document from disk
chapter3/contextual-retrieval/index_local_laws_contextual.py:141
↓ 1 callersMethodread_document
Read a legal document from disk
chapter3/agentic-rag/index_local_laws.py:127
↓ 1 callersMethodread_file
Read a file from current directory. Args: file_path: File path relative to current directory encodin
chapter4/execution-tools/terminal_controller.py:202
↓ 1 callersFunctionread_webpage_content
Read and extract content from webpage. Args: url: URL to read extract_links: Whether to extract links Retur
chapter4/perception-tools/src/google_search_enhanced.py:141
↓ 1 callersMethodrebuild_index
Build/rebuild the ANNOY index.
chapter3/dense-embedding/indexing.py:210
↓ 1 callersMethodrebuild_index
HNSW doesn't require explicit rebuild.
chapter3/dense-embedding/indexing.py:378
↓ 1 callersFunctionredistribute_codes
(code_list)
chapter7/orpheus/orpheus_sft_unsloth.py:416
↓ 1 callersFunctionreflect
( model: str, provider: str, response: str, messages: List[Dict[str, Any]] )
chapter2/prompt-engineering/tau_bench/envs/user.py:235
↓ 1 callersMethodregister_process
Register a background process for monitoring
chapter4/agent-with-event-trigger/client.py:113
↓ 1 callersMethodregister_tool
Register a new tool
chapter2/attention_visualization/tools.py:102
↓ 1 callersFunctionremoveEmoji
(sentence)
chapter9/live-audio/backend/utils/textProcessor.js:4
↓ 1 callersFunctionremoveEmotions
(text)
chapter9/live-audio/backend/utils/textProcessor.js:159
↓ 1 callersFunctionremove_descriptions_recursive
Recursively remove all description fields from a nested object Args: obj: The object to process Returns: Object
chapter2/prompt-engineering/ablation_utils.py:114
↓ 1 callersFunctionremove_special_chars
(s: str)
chapter2/prompt-engineering/tau_bench/model_utils/api/datapoint.py:94
↓ 1 callersMethodrender
(self)
book/svg_lib.py:236
↓ 1 callersFunctionrequest_admin_input
Request input from a human administrator. Args: prompt: Question or prompt for the admin input_type: Type of input expected (
chapter4/collaboration-tools/src/hitl_tools.py:288
↓ 1 callersMethodreset
Reset agent state
chapter5/coding-agent/agent.py:480
↓ 1 callersMethodreset
Reset all ratings to initial values.
chapter6/elo-leaderboard/elo_rating.py:151
↓ 1 callersMethodreset
(self, instruction: Optional[str] = None)
chapter2/prompt-engineering/tau_bench/envs/user.py:70
↓ 1 callersMethodreset
(self, instruction: Optional[str] = None)
chapter2/prompt-engineering/tau_bench/envs/user.py:126
↓ 1 callersMethodreset
(self, instruction: Optional[str] = None)
chapter2/prompt-engineering/tau_bench/envs/user.py:179
↓ 1 callersMethodreset
(self, instruction: Optional[str] = None)
chapter2/prompt-engineering/tau_bench/envs/user.py:294
↓ 1 callersMethodreset
Reset the agent's state
chapter2/system-hint/agent.py:963
↓ 1 callersMethodreset_agent
Reset the agent state
chapter4/agent-with-event-trigger/client.py:77
↓ 1 callersMethodreset_conversation
Reset the conversation history
chapter2/local_llm_serving/ollama_native.py:315
↓ 1 callersMethodreset_conversation
Reset the conversation history
chapter2/local_llm_serving/agent.py:266
↓ 1 callersFunctionrespond_to_request
Admin response to an approval request. Args: request_id: ID of the request to respond to approved: Whether the request is app
chapter4/collaboration-tools/src/hitl_tools.py:211
↓ 1 callersMethodroute
(self, dp: Datapoint, available_models: list[Model])
chapter2/prompt-engineering/tau_bench/model_utils/api/router.py:11
↓ 1 callersFunctionrun
(config: RunConfig)
chapter2/prompt-engineering/tau_bench/run.py:20
↓ 1 callersMethodrun
Run agent with streaming output Args: user_message: User's input message max_iterations: Maximum num
chapter5/coding-agent/agent_new.py:102
↓ 1 callersMethodrun
Run the interactive evaluation session
chapter3/agentic-rag-for-user-memory/main.py:47
↓ 1 callersMethodrun
Run the interactive session
chapter3/contextual-retrieval-for-user-memory/main.py:51
↓ 1 callersMethodrunSileroVAD
* Run Silero VAD inference on audio chunk * @param {Float32Array} audioSamples - Normalized audio samples * @returns {Promise<number>} Speech pr
chapter9/live-audio/backend/utils/vad.js:101
↓ 1 callersFunctionrun_ablation_study
Run ablation study to test importance of context Args: api_key: API key for the LLM provider provider: LLM provider to u
chapter1/context/main.py:607
↓ 1 callersMethodrun_ablation_study
Run ablation study across specified context modes Args: context_modes: List of context modes to test (defaults t
chapter1/context/main.py:142
↓ 1 callersMethodrun_agent
Run the agent with user input and display results
chapter5/coding-agent/main.py:185
↓ 1 callersFunctionrun_all_experiments
Run all ablation experiments and compare results
chapter2/prompt-engineering/test_ablation.py:86
↓ 1 callersMethodrun_all_strategies
Run all compression strategies
chapter2/context-compression/run_all_strategies.py:243
↓ 1 callersMethodrun_all_strategies
Run experiments for all compression strategies
chapter2/context-compression/experiment.py:166
↓ 1 callersFunctionrun_all_tests
Run all tests.
chapter4/collaboration-tools/test_basic.py:127
↓ 1 callersMethodrun_all_tests
Run all validation tests.
chapter8/browser-use-rpa/test_validation.py:47
↓ 1 callersMethodrun_batch_evaluation
Run batch evaluation on multiple test cases.
chapter3/user-memory-evaluation/main.py:138
↓ 1 callersFunctionrun_batch_mode
Run batch queries from file
chapter3/contextual-retrieval/main.py:116
↓ 1 callersFunctionrun_batch_mode
Run batch queries from file
chapter3/agentic-rag/main.py:116
↓ 1 callersFunctionrun_comparison
Run comparison across all modes Args: api_key: API key for Kimi task: Custom task (optional) root_dir: Root dire
chapter2/kv-cache/main.py:207
↓ 1 callersFunctionrun_comparison_demo
Run comparison between agentic and non-agentic modes
chapter3/agentic-rag/quickstart.py:144
↓ 1 callersFunctionrun_comparison_mode
Run both modes and compare results
chapter3/contextual-retrieval/main.py:159
↓ 1 callersFunctionrun_comparison_mode
Run both modes and compare results
chapter3/agentic-rag/main.py:159
↓ 1 callersFunctionrun_complex_task
Run a complex multi-step task
chapter5/coding-agent/example_complex_task.py:10
↓ 1 callersFunctionrun_demo
Run the interactive demo Args: enable_streaming: Whether to enable streaming output (default: True)
chapter2/context-compression/main.py:54
↓ 1 callersFunctionrun_demo
Run a demonstration of all collaboration tools.
chapter4/collaboration-tools/quickstart.py:14
↓ 1 callersFunctionrun_demo
Run a comprehensive demo of the vector search service.
chapter3/dense-embedding/test_client.py:59
↓ 1 callersFunctionrun_demo
Run interactive demo
chapter3/agentic-rag/quickstart.py:121
↓ 1 callersFunctionrun_demo_evaluation
Run a demonstration evaluation with sample agent responses.
chapter3/user-memory-evaluation/main.py:241
↓ 1 callersFunctionrun_educational_tests
Run educational test cases.
chapter3/retrieval-pipeline/test_client.py:161
↓ 1 callersFunctionrun_evaluation
Run all evaluation tests
chapter7/continued-pretraining/evaluate_model.py:48
↓ 1 callersMethodrun_evaluation
Run full evaluation
chapter3/contextual-retrieval/evaluation/evaluate.py:128
← previousnext →1,401–1,500 of 2,925, ranked by callers