MCPcopy Create free account

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

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

↓ 3 callersMethodarrow
(self, x1, y1, x2, y2, label=None, dash=False, color='border')
book-tr/svg_lib.py:424
↓ 3 callersMethodarrow
(self, x1, y1, x2, y2, label=None, dash=False, color='border')
book-ar/svg_lib.py:450
↓ 3 callersMethodarrow
(self, x1, y1, x2, y2, label=None, dash=False, color='border')
book-ru/svg_lib.py:424
↓ 3 callersMethodarrow
(self, x1, y1, x2, y2, label=None, dash=False, color='border')
book-es/svg_lib.py:424
↓ 3 callersMethodarrow
(self, x1, y1, x2, y2, label=None, dash=False, color='border')
book-mn/svg_lib.py:425
↓ 3 callersMethodarrow
(self, x1, y1, x2, y2, label=None, dash=False, color='border')
book-id/svg_lib.py:424
↓ 3 callersFunctionassert_anchors
(locale: str, chapter: int, figure: int, anchors: tuple[str, ...])
tests/test_i18n_figure_placement.py:63
↓ 3 callersMethodassign_identities
(self)
chapter10/voice-werewolf/werewolf/game.py:154
↓ 3 callersFunctionatomic_json
(path: Path, value: Any)
chapter5/paper-to-video/campaign.py:39
↓ 3 callersFunctionattention_sink_stats
Compute how much attention lands on a single "sink" column. Averages, over every query row that can see the sink column, the attention w
chapter2/attention_visualization/visualization.py:467
↓ 3 callersMethodauthenticate
Run the full authentication flow. Returns True if authentication successful.
chapter9/browser-use-rpa/browser-use/browser_use/sync/auth.py:275
↓ 3 callersMethodbind_campaign
(self, campaign_id: str, config: dict[str, Any])
chapter7/model-benchmark/campaign.py:302
↓ 3 callersFunctionbootstrap_experiment_root
()
chapter7/elo-leaderboard/tests/_bootstrap.py:7
↓ 3 callersFunctionbuild_candidate_manifest
( optimization: Dict[str, Any], learning_signal: Dict[str, Any] )
chapter9/prompt-auto-optimization/release_gate.py:8
↓ 3 callersFunctionbuild_openrouter_backend
Build a backend that routes through OpenRouter. Shared by :func:`resolve_backend` and the legacy shim in :mod:`agentbook.providers.legacy` so
agentbook/providers/resolution.py:41
↓ 3 callersFunctionbuild_pairs
构造偏好对。返回(pairs, 教师路径回执列表)。
chapter8/premature-completion-dpo/build_preference_data.py:119
↓ 3 callersFunctionbuild_presentation
从大纲 payload 构建 pptx,返回 {path, num_slides, titles} 供校验。
chapter2/agent-skills-ppt/skills/pptx/scripts/generate_pptx.py:111
↓ 3 callersFunctionbuild_prompt
prompt = 任务 + 轨迹前缀 + 请给出下一步动作(与 evaluate.format_prompt 同构)。
chapter8/premature-completion-dpo/build_preference_data.py:59
↓ 3 callersFunctionbuild_series
Cumulative star count over time, anchored at the chart's start date.
scripts/gen_star_history.py:423
↓ 3 callersMethodbuild_system_prompt
(self, instruction: Optional[str])
chapter2/prompt-engineering/tau_bench/envs/user.py:144
↓ 3 callersMethodcalculate_cost
(self, model: str, usage: ChatInvokeUsage)
chapter9/browser-use-rpa/browser-use/browser_use/tokens/service.py:185
↓ 3 callersFunctioncalculate_percentile
Calculate percentile (0-100) using linear interpolation.
chapter7/model-benchmark/rate_ramp_benchmark.py:21
↓ 3 callersMethodcalculate_raw_idf
Calculate the Robertson/Sparck Jones IDF printed in Chapter 3.
chapter3/sparse-embedding/bm25_engine.py:271
↓ 3 callersFunctioncalibrate
用与候选来源关联的独立人工金标校准一条规则。
chapter9/ai-style-skill/judge.py:125
↓ 3 callersFunctioncall_with_transient_retries
( *, kind: str, request: dict[str, Any], function: Any )
chapter10/generative-agents/provider_adapter.py:147
↓ 3 callersFunctioncandidate_from_gate
把生成的门禁模块与溯源信息打包成可评审候选。
chapter9/harness-safety-gate/evolution.py:299
↓ 3 callersFunctioncandidate_from_source
Package generated source and provenance as a reviewable candidate.
chapter9/self-modifying-agent/evolution.py:127
↓ 3 callersFunctioncanonical_json
(value: Any)
chapter6/agent-with-event-trigger/unipile_mailbox_experiment.py:36
↓ 3 callersFunctioncanonical_json
(value: Any)
chapter4/perception-tools/run_experiment_4_2.py:99
↓ 3 callersFunctioncard
( x, y, width, height, { fill = palette.panel, rx = 8, extra = '' } = {}, )
web-astro/scripts/collaboration-society-figures.mjs:58
↓ 3 callersFunctioncard
( x, y, width, height, { fill = palette.panel, dash = false, rx = 8, extra = '' } = {},
web-astro/scripts/training-sequences-figures.mjs:52
↓ 3 callersFunctioncard
( x, y, width, height, { fill = palette.panel, dash = false, rx = 8, extra = '' } = {},
web-astro/scripts/evolution-flow-figures.mjs:103
↓ 3 callersFunctionchapter1PilotSlideCount
(number)
slides/chapter1-pilot.mjs:817
↓ 3 callersFunctionchapter_order
(nav: list)
scripts/homepage_index.py:58
↓ 3 callersFunctionchat
发起一次结构化 JSON 调用,返回 ``(文本内容, 证据回执)``。
chapter9/ai-style-skill/llm_client.py:55
↓ 3 callersMethodchat
(self, **kwargs)
tests/test_ch2_ollama_native_nonstream_react_loop.py:43
↓ 3 callersMethodchat
Send a message to the model and handle tool calls in a ReAct loop Args: message: User message use_to
chapter2/local_llm_serving/agent.py:182
↓ 3 callersFunctionchat_json
(calls: CachedCalls, purpose: str, model: str, system: str, user: str, max_tokens: int = 2400)
chapter3/structured-index/campaign.py:173
↓ 3 callersMethodcheck_all
Run all integrity checks, return list of violations.
chapter5/permission-embedded-data-objects/pedo/eval/benchmark_safety.py:48
↓ 3 callersMethodcheck_credentials_exist
Check if OAuth credentials file exists.
chapter9/browser-use-rpa/browser-use/examples/integrations/gmail_2fa_integration.py:50
↓ 3 callersFunctioncheck_db_violations
Check all integrity violations in current DB state.
chapter5/permission-embedded-data-objects/pedo/eval/benchmark_safety_final.py:190
↓ 3 callersMethodcheck_sandbox_config
Return the effective sandbox configuration, filling any missing keys. Missing keys default to ``False`` (fail-open is reported honestly as
chapter5/coding-agent/sandbox_evaluator.py:208
↓ 3 callersFunctionchoose_decision
Makes a conservative success/cost candidate decision from paired evidence.
chapter7/android-world/experiment_core.py:141
↓ 3 callersFunctionchoose_efficiency_decision
Promotes a cost refinement only when H5 success is preserved and cost falls.
chapter7/android-world/experiment_core.py:236
↓ 3 callersMethodchoose_target
让 Agent 从候选人中选一个目标(夜间刀人 / 查验 / 用毒 / 救人判断等)。 用 JSON 模式返回,鲁棒地解析出目标玩家名。
chapter10/voice-werewolf/werewolf/agent.py:191
↓ 3 callersFunctionchosen_passes_filter
拒绝采样规则:必须含验证动作,且不含完成宣称。
chapter8/premature-completion-dpo/build_preference_data.py:84
↓ 3 callersMethodchunk_text
Split text into chunks with overlap.
chapter3/structured-index/raptor_indexer.py:62
↓ 3 callersMethodchunk_text
Chunk text into smaller segments. Args: text: Document text to chunk doc_id: Document identifier
chapter3/agentic-rag/chunking.py:24
↓ 3 callersFunctionclassify
(text: str)
chapter2/attention_visualization/run_status_bar_experiment.py:214
↓ 3 callersFunctionclassify_next_action
把模型的下一步动作分为完成、继续验证或无法判断。 提示要求第一行给出明确动作;优先读取这一行,避免把“如果测试通过, 就可以完成”之类的条件句误算成已经收尾。没有明确动作时才退回到 关键词规则,并继续对同时出现两类信号的旧格式采取保守判断。
chapter8/premature-completion-dpo/evaluate.py:52
↓ 3 callersMethodcleanup
()
chapter6/live-audio/backend/server.js:174
↓ 3 callersMethodclear_all_memories
Clear all memories for this user - useful for testing
chapter3/user-memory/memory_manager.py:507
↓ 3 callersMethodclear_history
清空对话历史
chapter1/web-search-agent/agent.py:540
↓ 3 callersMethodclear_history
Clear conversation history
chapter3/contextual-retrieval/agent.py:387
↓ 3 callersFunctioncodeRows
(kit, nodes, ids, x, y, width, metrics, rtl, key)
web-astro/scripts/coding-application-layout.mjs:107
↓ 3 callersFunctioncollect_tool_calls
Normalize tool calls across runtime stream formats. Claude Code emits ``assistant`` events whose message content contains ``tool_use`` blocks
chapter2/agent-skills-ppt/validate_official_run.py:50
↓ 3 callersFunctioncompletion_assessment
( experiment: str, records: Sequence[RunRecord], config: Optional[Dict[str, Any]], coverage: D
chapter7/user-memory-system-evaluation/experiment.py:1587
↓ 3 callersFunctioncomplex_problem_reasoning
Perform complex problem reasoning with step-by-step thinking. Args: problem: Problem statement context: Optional context
chapter4/collaboration-tools/src/intelligence_tools.py:86
↓ 3 callersMethodcompress_key_sentence
Key-Sentence Strategy: Retains sentences with high query term match/relevance.
chapter2/context-compression/benchmark_compression.py:113
↓ 3 callersMethodcompress_observation_filtering
Observation-Filtering Strategy: Removes verbose system output, logs, hex, and JSON blobs.
chapter2/context-compression/benchmark_compression.py:143
↓ 3 callersMethodcompress_summary
Summary Strategy: Condenses context into key abstract points.
chapter2/context-compression/benchmark_compression.py:79
↓ 3 callersMethodcompress_truncation
Truncation Strategy: Slices context to fit within strict token limits.
chapter2/context-compression/benchmark_compression.py:97
↓ 3 callersMethodcompute_mrr
Mean reciprocal rank source: 1 / rank of first relevant hit, else 0.0.
chapter3/retrieval-pipeline/stage_evaluator.py:213
↓ 3 callersFunctioncompute_parse_rate
Parseable prediction rate; empty total is 0.0 (not ZeroDivisionError).
chapter8/prompt-distillation/evaluate.py:44
↓ 3 callersFunctionconfig
()
extras/auto-translate.js:34
↓ 3 callersMethodconsolidate_memories
Deterministically deduplicate and (optionally) conflict-resolve notes. This is the offline counterpart to the LLM-driven memory maintenance i
chapter3/user-memory/memory_manager.py:269
↓ 3 callersFunctionconversation_chunks
Split each source conversation on complete user/assistant rounds.
chapter7/user-memory-system-evaluation/experiment.py:461
↓ 3 callersFunctionconvert_currency
Convert between currencies. Args: amount: Amount to convert from_currency: Source currency code (e.g., USD) to_c
chapter4/perception-tools/src/public_data_tools.py:228
↓ 3 callersFunctioncopy_path
Copy a file/directory inside the explicit mutation workspace.
chapter4/perception-tools/src/filesystem_tools.py:218
↓ 3 callersMethodcorrect_and_secure_rate
C&S rate: fraction of prompts that are correct AND secure/caught.
chapter5/permission-embedded-data-objects/pedo/eval/dataguardbench/metrics.py:67
↓ 3 callersMethodcost_usd
按 token 用量换算成本(美元)。 prompt_tokens : usage.prompt_tokens,包含了缓存命中的部分 cached_tokens : usage.prompt_tokens_details.cached_tokens,命中缓存
chapter7/agent-cost-analysis/config.py:89
↓ 3 callersFunctioncount_tokens
统计一段文本的 token 数。
chapter10/book-translation/agents.py:140
↓ 3 callersFunctioncount_tokens
(text: str)
chapter4/active-tool-discovery/agent.py:58
↓ 3 callersMethodcreate
(**kwargs)
chapter7/tts-quality-eval/tests/test_judge_robustness.py:34
↓ 3 callersFunctioncreate_excel_workbook
Create a new Excel workbook. Args: file_path: Path for new workbook Returns: Dictionary with result
chapter4/collaboration-tools/src/excel_tools.py:118
↓ 3 callersMethodcreate_from_scratch
( self, requirements: str, output: Path, *, resume: bool = False )
chapter5/agent-creator/creator.py:1475
↓ 3 callersFunctioncreate_structured_task
Create a task that returns structured JSON output. Args: instructions: Task description schema_model: Pydantic model defining the expect
chapter9/browser-use-rpa/browser-use/examples/cloud/03_structured_output.py:103
↓ 3 callersFunctioncreate_test_chunks
Create test conversation chunks with substantial content
chapter3/agentic-rag-for-user-memory/test_logging.py:18
↓ 3 callersFunctioncreate_test_chunks
Create test conversation chunks with substantial content
chapter3/contextual-retrieval-for-user-memory/test_logging.py:18
↓ 3 callersMethoddefault_sandbox_config
Return the recommended (most restrictive) sandbox configuration.
chapter5/coding-agent/sandbox_evaluator.py:169
↓ 3 callersFunctiondefinitions
(markerId)
web-astro/scripts/collaboration-society-figures.mjs:71
↓ 3 callersMethoddelete_file
Delete a file or directory. Args: file_path: Path to delete recursive: For directories, delete recur
chapter4/execution-tools/filesystem_enhanced.py:559
↓ 3 callersMethoddescribe
List all files with their content information using file-specific display methods
chapter9/browser-use-rpa/browser-use/browser_use/filesystem/file_system.py:381
↓ 3 callersMethoddetect_display_configuration
Detect the system display size and initialize the display-related config defaults: screen, window_size, window_position, viewport, no_vie
chapter9/browser-use-rpa/browser-use/browser_use/browser/profile.py:1057
↓ 3 callersFunctiondiagnose
(trajectories: Iterable[Dict[str, Any]])
chapter9/self-modifying-agent/evolution.py:62
↓ 3 callersFunctiondict_equal
(d1: dict, d2: dict)
chapter2/prompt-engineering/tau_bench/model_utils/api/datapoint.py:28
↓ 3 callersFunctiondigest
(path)
chapter6/astra-async-steering/experiment.py:56
↓ 3 callersFunctiondirect_children
(element, tag)
flatten_epub_toc.py:21
↓ 3 callersFunctiondirect_payload
()
chapter6/phone-agent/test_webrtc_app.py:7
↓ 3 callersMethoddisconnect
Disconnect and cleanup if this session owns its CDP client.
chapter9/browser-use-rpa/browser-use/browser_use/browser/session.py:169
↓ 3 callersMethoddisconnect
Disconnect from the MCP server.
chapter9/browser-use-rpa/browser-use/browser_use/mcp/client.py:161
↓ 3 callersMethoddisconnect
Disconnect from the server.
chapter4/collaboration-tools/client_example.py:38
↓ 3 callersMethoddispatch_all
Dispatch notification across multiple channels.
chapter4/collaboration-tools/src/notification_dispatcher.py:371
↓ 3 callersFunctiondisplay_metrics
(results: List[EnvRunResult])
chapter2/prompt-engineering/tau_bench/run.py:180
↓ 3 callersMethoddisplay_test_case_summary
Display a summary of all test cases. Args: show_full_titles: If True, show complete titles without truncation
chapter3/user-memory-evaluation/framework.py:299
↓ 3 callersFunctionedge
(k, name, from, to, d, { gutter = 64, dash = false } = {})
web-astro/scripts/evaluation-overview-figures.mjs:82
↓ 3 callersFunctionedge
(name, content, from, to, extra = '')
web-astro/scripts/coding-application-layout.mjs:79
↓ 3 callersFunctionedge
(name, from, to, d, { muted = false, dashed = false } = {})
web-astro/scripts/collaboration-context-figures.mjs:77
↓ 3 callersFunctionelement
(id: string)
web-astro/src/scripts/highlights.ts:26
↓ 3 callersMethodembed
(self, texts: Sequence[str])
chapter7/user-memory-system-evaluation/experiment.py:318
← previousnext →1,201–1,300 of 13,003, ranked by callers