MCPcopy Create free account

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

Functions13,003 in github.com/bojieli/ai-agent-book

↓ 1 callersFunctionparticipant
(first, x, fill)
web-astro/scripts/training-foundations-figures.mjs:78
↓ 1 callersFunctionpatched_model_snapshot
Point the tokenizer at CSM's existing training-pad token. The 2026.8 Unsloth safety check rejects the upstream tokenizer because its pad toke
chapter8/speech-sft-experiment/run_sesame.py:65
↓ 1 callersMethodpause
Pause the agent before the next step
chapter9/browser-use-rpa/browser-use/browser_use/agent/service.py:1964
↓ 1 callersFunctionpercentile
(values: list[float], q: float)
chapter7/openvla-robotwin2-eval/experiment.py:450
↓ 1 callersFunctionpercentiles
(values: List[float])
chapter3/dense-embedding/benchmark.py:94
↓ 1 callersFunctionperform_searches
Perform various search queries to demonstrate the engine
chapter3/sparse-embedding/demo.py:136
↓ 1 callersFunctionpersist_checkpoint
()
chapter5/code-for-math/demo.py:581
↓ 1 callersFunctionpersona_nodes
(sim_dir: Path)
chapter10/generative-agents/analyze_campaign.py:28
↓ 1 callersMethodphase1_learning
Phase 1: Learn how to send an email.
chapter9/browser-use-rpa/demo_email.py:85
↓ 1 callersMethodphase2_replay
Phase 2: Replay learned workflow with different parameters.
chapter9/browser-use-rpa/demo_email.py:141
↓ 1 callersFunctionphaseHeader
(k, id, y)
web-astro/scripts/coding-production-layout.mjs:420
↓ 1 callersFunctionphone_computer
()
scripts/book_figures/chapter10.py:100
↓ 1 callersMethodpick
(self, object_id: str)
chapter6/gemini-xlerobot-navigation/desktop_planner.py:69
↓ 1 callersFunctionpick_xticks
Evenly spaced x tick positions plus a date format for the given span. Ticks are anchored at the newest date and step backwards, so the latest
scripts/gen_star_history.py:447
↓ 1 callersFunctionpipelineStage
(k, stage, x, y, width, rtl, rowHeight)
web-astro/scripts/coding-production-layout.mjs:334
↓ 1 callersMethodplace
(self, object_id: str, target_id: str)
chapter6/gemini-xlerobot-navigation/desktop_planner.py:85
↓ 1 callersFunctionplay_manual
Let the user play the game manually.
chapter1/learning-from-experience/demo.py:23
↓ 1 callersFunctionplot_artifacts
( out: Path, online: pd.DataFrame, history: pd.DataFrame, empirical: pd.DataFrame, )
chapter7/elo-leaderboard/validation/run_experiment.py:192
↓ 1 callersFunctionplot_leaderboard
Plot static leaderboard bar chart. Args: leaderboard_data: List of (model, rating, matches, wins) tuples top_n: Number o
chapter7/elo-leaderboard/visualization.py:13
↓ 1 callersFunctionplot_rating_distribution
Plot distribution of ratings across all models. Args: leaderboard_data: List of (model, rating, matches, wins) tuples sa
chapter7/elo-leaderboard/visualization.py:141
↓ 1 callersFunctionplot_win_rate_matrix
Plot heatmap of win rate matrix. Args: win_rate_df: DataFrame with win rates (rows beat columns) top_n: Number of models
chapter7/elo-leaderboard/visualization.py:54
↓ 1 callersFunctionpoints
(input)
web-astro/scripts/evaluation-comparison-layout.test.mjs:175
↓ 1 callersFunctionpoints
(s)
web-astro/scripts/chapter7-figures.test.mjs:81
↓ 1 callersFunctionpoll_campaign_emails
(client: UnipileClient, account_id: str, campaign_id: str, after: datetime, *, timeou
chapter6/agent-with-event-trigger/unipile_mailbox_experiment.py:499
↓ 1 callersFunctionpositive_usage
(usage: dict | None)
chapter10/talkact-reproduction/validate_campaign.py:36
↓ 1 callersFunctionpre_edit_metrics
(events: list[dict[str, Any]], first_edit_sequence: int | None)
chapter7/model-action-threshold/experiment.py:349
↓ 1 callersFunctionpre_state
构造断点发生之前的轨迹。 思考和工具参数两个断点发生在“还要接着调工具”的时候,正文断点发生在“数据齐 了该写总结”的时候。这段轨迹是实验的输入,直接拼出来即可,不必先让模型跑。
chapter5/provider-failover/run_continuation.py:33
↓ 1 callersFunctionpredict_win_rate
Predict win rates between all model pairs using Elo ratings. Args: elo_ratings: Dictionary of model names to Elo ratings
chapter7/elo-leaderboard/bradley_terry.py:139
↓ 1 callersFunctionprefix_prompt
(case: Dict[str, Any], chunks: List[Dict[str, Any]])
chapter3/memory_rag_campaign.py:173
↓ 1 callersFunctionprefix_reuse
()
scripts/book_figures/chapter2.py:217
↓ 1 callersFunctionpreflight
(cfg: dict[str, Any])
chapter7/openvla-robotwin2-eval/experiment.py:99
↓ 1 callersFunctionpreflight
启动自检:给出清晰中文报错,而非 traceback。
chapter5/video-edit/demo.py:123
↓ 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_benchmark
(run_dir: Path, train_per_language: int, test_per_language: int, seed: int)
chapter8/prompt-distillation/run_experiment_8_8.py:148
↓ 1 callersFunctionprepare_fixtures
Create small deterministic inputs with real document/media encoders.
chapter4/perception-tools/run_experiment_4_2.py:133
↓ 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:59
↓ 1 callersFunctionprepare_model_for_lora
配置 LoRA(低秩适应)进行高效微调 LoRA 只训练少量参数,大大减少内存使用和训练时间。 针对 openai/gpt-oss-20b 的 MoE(混合专家)架构,除了注意力层外, 还需要特别指定 MLP 专家层进行训练。 Args:
chapter8/MultilingualReasoning/gpt_oss_20b_sft.py:149
↓ 1 callersFunctionprepare_real_paper
(run_dir: str | Path, public_dir: str | Path)
chapter5/paper-to-ppt/paper_source.py:76
↓ 1 callersFunctionprepare_rows
(ds, tokenizer, snac, indices, seconds)
chapter8/speech-sft-experiment/run_orpheus.py:104
↓ 1 callersFunctionprepare_seed
(upstream: Path, output: Path)
chapter10/generative-agents/run_campaign.py:404
↓ 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 callersFunctionprepare_worktree
(cfg: dict[str, Any], run_dir: Path)
chapter7/openvla-robotwin2-eval/experiment.py:347
↓ 1 callersFunctionpreprocess
(ds, indices, processor, max_audio_samples: int)
chapter8/speech-sft-experiment/run_sesame.py:107
↓ 1 callersFunctionpreprocessSentence
(sentence, language = 'en')
chapter6/live-audio/backend/utils/textProcessor.js:180
↓ 1 callersMethodpress
Press a key on the page (sends keyboard input to the focused element or page).
chapter9/browser-use-rpa/browser-use/browser_use/actor/page.py:211
↓ 1 callersFunctionpreview_status_bar
离线预览:展示五种状态栏(system hint)技术如何改变模型看到的上下文。 对应书中实验 2-9 的五种技术。整个过程在本地渲染,**不发起任何 LLM 调用, 因此无需 API Key**。每个案例都做一次“无状态栏 vs 有状态栏”的对照, 直观地展示 Agent
chapter2/system-hint/main.py:347
↓ 1 callersMethodprice_one
(self)
chapter7/user-memory-system-evaluation/experiment.py:168
↓ 1 callersFunctionprimary_probes
(rows_for_arm: list[dict])
chapter2/system-hint/run_experiment_2_8.py:688
↓ 1 callersFunctionprint_ab_table
(tracers)
chapter7/agent-cost-analysis/demo.py:144
↓ 1 callersFunctionprint_agent_table
(tracker, title)
chapter10/book-translation/demo.py:136
↓ 1 callersFunctionprint_application_results
(all_results)
chapter5/permission-embedded-data-objects/pedo/eval/benchmark_application.py:455
↓ 1 callersFunctionprint_banner
Print demo banner
chapter2/context-compression/main.py:30
↓ 1 callersFunctionprint_banner
打印欢迎横幅
chapter1/web-search-agent/quickstart.py:27
↓ 1 callersMethodprint_breakdown
打印一次 agent 任务的按步骤成本拆解表,并指出最贵的一步、成本构成与分布。
chapter7/agent-cost-analysis/tracer.py:230
↓ 1 callersFunctionprint_comparison
(arms: list[dict], summaries: list[dict])
chapter5/small-model-codified-rules/demo.py:187
↓ 1 callersMethodprint_comparison_matrix
Print a mode x case comparison matrix so the effect of each context component can be read at a glance across every case. Arg
chapter1/context/main.py:378
↓ 1 callersFunctionprint_comparison_table
打印 recall@k 对比表。
chapter3/contextual-retrieval/compare_retrieval.py:161
↓ 1 callersMethodprint_config
Print current configuration (hiding sensitive data)
chapter2/context-compression/config.py:105
↓ 1 callersFunctionprint_confusion_matrix
Pretty print confusion matrix and analysis.
chapter8/prompt-distillation/evaluate.py:264
↓ 1 callersFunctionprint_consistency
(analysis, label)
chapter10/book-translation/demo.py:147
↓ 1 callersFunctionprint_detail
(rec, sample_text)
chapter7/tts-quality-eval/demo.py:126
↓ 1 callersFunctionprint_diff
打印一个文件改动前后的 unified diff 片段(最多若干行)。
chapter5/conversational-ui/demo.py:104
↓ 1 callersFunctionprint_final_results
(results)
chapter5/permission-embedded-data-objects/pedo/eval/benchmark_safety_final.py:464
↓ 1 callersFunctionprint_frame_tree
(frame_id, frame_info, indent=0, visited=None)
chapter9/browser-use-rpa/browser-use/tests/scripts/test_frame_hierarchy.py:186
↓ 1 callersFunctionprint_interception_example
找一例:实验组模型自报可退(expected_refundable=True),但数据库真值不可退,被代码拦截。
chapter5/small-model-codified-rules/demo.py:222
↓ 1 callersFunctionprint_matrix
( matrix: list[list[float | None]], attack_idx: list[int], defense_idx: list[int], )
chapter2/prompt-injection/demo.py:141
↓ 1 callersFunctionprint_per_query
逐条查询打印各方法的 MRR,直观展示「单路会翻车、融合来兜底」。
chapter3/retrieval-pipeline/evaluate.py:589
↓ 1 callersFunctionprint_per_query
(result: Dict, label: str)
chapter3/contextual-retrieval/compare_retrieval.py:198
↓ 1 callersFunctionprint_providers
离线打印所有可用 TTS provider 及其配置状态(无需任何 API key)。
chapter7/tts-quality-eval/demo.py:193
↓ 1 callersFunctionprint_query_trace
(pipeline: Pipeline, query: str, args)
chapter3/retrieval-pipeline/evaluate.py:612
↓ 1 callersFunctionprint_report
(variant: str, metrics: dict[str, Any])
chapter8/premature-completion-dpo/evaluate.py:295
↓ 1 callersFunctionprint_report
(r: Dict)
chapter8/prompt-distillation/compare.py:208
↓ 1 callersFunctionprint_report
(results: List[Dict[str, Any]])
chapter2/local_llm_serving/benchmark.py:275
↓ 1 callersFunctionprint_report
打印单条样本的 before/after 与命中明细
chapter3/log-sanitization/regex_sanitizer.py:247
↓ 1 callersFunctionprint_results
Print formatted results.
chapter5/permission-embedded-data-objects/pedo/eval/benchmark_safety.py:645
↓ 1 callersMethodprint_results_table
Print results in a formatted table Args: results: List of test results
chapter1/context/main.py:349
↓ 1 callersFunctionprint_roster
打印角色花名册,证明存在 5 个角色、各有不同系统提示词/工具集。
chapter10/multi-role-transfer/demo.py:85
↓ 1 callersFunctionprint_rubric
离线打印 Rubric 维度定义(无需任何 API key)。
chapter7/tts-quality-eval/demo.py:205
↓ 1 callersFunctionprint_safety_v2_results
(results, all_prompts)
chapter5/permission-embedded-data-objects/pedo/eval/benchmark_safety_v2.py:379
↓ 1 callersFunctionprint_scenarios
打印内置场景列表(供 --help / --list-roles 参考)。
chapter10/multi-role-transfer/demo.py:100
↓ 1 callersFunctionprint_section
Print a colored section header
chapter8/continued-pretraining/compare_models.py:24
↓ 1 callersFunctionprint_section
Print a colored section header
chapter8/continued-pretraining/continued-pretrain.py:108
↓ 1 callersFunctionprint_section
Print a formatted section header.
chapter3/dense-embedding/quick_demo.py:8
↓ 1 callersFunctionprint_spec_results
Print formatted results.
chapter5/permission-embedded-data-objects/pedo/eval/benchmark_spec_errors.py:335
↓ 1 callersFunctionprint_spec_v2_results
(results)
chapter5/permission-embedded-data-objects/pedo/eval/benchmark_spec_errors_v2.py:365
↓ 1 callersMethodprint_status
Print agent status
chapter5/coding-agent/main.py:74
↓ 1 callersFunctionprint_summary
在控制台输出整理结果的汇总信息。 Args: counts: dict,各类别移动的文件数量。
chapter10/staged-system-prompt/runs/staged-system-prompt-kimi-k3-20260730-v1/workspace/organize_downloads.py:149
↓ 1 callersMethodprint_summary
(self)
chapter10/staged-system-prompt/agent.py:504
↓ 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:300
↓ 1 callersFunctionprint_table
(rows)
chapter7/tts-quality-eval/demo.py:175
↓ 1 callersFunctionprint_table
打印多列准确率对比表。columns = [(mode, records), ...],顺序即列顺序。
chapter5/code-for-logic/demo.py:458
↓ 1 callersFunctionprint_table
rows: list of (label, holdout_tuple, boundary_tuple)
chapter9/prompt-auto-optimization/demo.py:55
↓ 1 callersFunctionprint_table
(report: Dict[str, Any], pipeline: Pipeline, args)
chapter3/retrieval-pipeline/evaluate.py:562
↓ 1 callersFunctionprint_table
(results: List[Dict[str, Any]], summary: Dict[str, Any])
chapter3/agentic-rag/compare_offline.py:106
↓ 1 callersMethodprint_table
打印完整的信息可见性审计表。
chapter10/voice-werewolf/werewolf/audit.py:31
↓ 1 callersFunctionprint_tree
(node, indent=0, parent_id=None)
chapter9/browser-use-rpa/browser-use/tests/scripts/test_frame_hierarchy.py:73
↓ 1 callersFunctionpriors
()
scripts/book_figures/chapter8.py:83
↓ 1 callersFunctionprobe
(path: Path)
chapter6/controllable-tts/validate_artifacts.py:25
← previousnext →6,201–6,300 of 13,003, ranked by callers