MCPcopy Create free account

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

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

↓ 3 callersMethod_get_system_state
Get current system state information
chapter2/system-hint/agent.py:190
↓ 3 callersMethod_get_timestamp
Get formatted timestamp
chapter2/system-hint/agent.py:214
↓ 3 callersMethod_get_tools
返回搜索后端提供的工具定义。
chapter1/web-search-agent/agent.py:162
↓ 3 callersMethod_get_unique_filename
Generate a unique filename for downloads by appending (1), (2), etc., if a file already exists.
chapter9/browser-use-rpa/browser-use/browser_use/browser/watchdogs/downloads_watchdog.py:922
↓ 3 callersFunction_hr
(title)
chapter5/log-diagnosis/demo.py:76
↓ 3 callersFunction_http_json
( url: str, *, body: dict[str, Any] | None = None, timeout: int = 120, headers: dict[str,
chapter6/controllable-tts/evaluate_audio_quality.py:62
↓ 3 callersFunction_http_post
POST JSON,返回原始响应字节。非 2xx 抛出带响应体片段的异常。
chapter7/tts-quality-eval/pipeline.py:132
↓ 3 callersMethod_init_system_prompt
Initialize the system prompt
chapter3/user-memory/conversational_agent.py:149
↓ 3 callersFunction_install_client
(monkeypatch, response: FakeResponse)
chapter4/perception-tools/test_xquik_tools.py:39
↓ 3 callersFunction_install_fake_llm
(glossary_payload=GLOSSARY_JSON)
chapter10/book-translation/tests/test_glossary_robustness.py:26
↓ 3 callersFunction_is_access_denied
(e: Exception)
chapter5/permission-embedded-data-objects/pedo/eval/baxbench_adapter/oracle.py:42
↓ 3 callersFunction_is_debug_mode
Check if we're in debug mode based on environment variables or logging level.
chapter9/browser-use-rpa/browser-use/browser_use/observability.py:31
↓ 3 callersFunction_is_trace
(obj: dict[str, Any])
chapter2/prompt-engineering/tau_bench/model_utils/api/datapoint.py:18
↓ 3 callersMethod_is_valid_target
Check if a target should be processed. Args: target_info: Target info dict from CDP Returns: True if target should be processed, False if
chapter9/browser-use-rpa/browser-use/browser_use/browser/session.py:2057
↓ 3 callersMethod_known_teammates
狼人从自己的私有上下文里解析出队友名单(好人解析不到,返回空)。
chapter10/voice-werewolf/werewolf/agent.py:227
↓ 3 callersMethod_known_wolves
从自己的私有上下文里收集『已知是狼人』的玩家:预言家的查验结果 + 狼人的队友。 好人平民无从得知任何人身份 → 返回空集合,只能随机投票。这正是信息不对称。
chapter10/voice-werewolf/werewolf/agent.py:236
↓ 3 callersMethod_learn_from_outcome
Learn from task outcomes and store procedural knowledge
chapter3/memobase/agent.py:356
↓ 3 callersFunction_load_callable
惰性导入并返回工具对应的异步函数。
chapter4/perception-tools/cli.py:189
↓ 3 callersMethod_log
(self, msg: str)
chapter10/multi-role-transfer/orchestrator.py:96
↓ 3 callersFunction_log_pretty_path
Pretty-print a path, shorten home dir to ~ and cwd to .
chapter9/browser-use-rpa/browser-use/browser_use/utils.py:643
↓ 3 callersFunction_make_agent
(responses)
tests/test_ch2_ollama_native_nonstream_react_loop.py:60
↓ 3 callersMethod_materialize_template
(output: Path)
chapter5/agent-creator/creator.py:512
↓ 3 callersFunction_minimal_run
(route: str = "workflow", error=None)
chapter1/image-gen-workflow/tests/test_manifest_schema.py:10
↓ 3 callersFunction_minimal_valid_manifest
()
chapter5/cad-vs-diffusion/test_offline.py:51
↓ 3 callersFunction_missing_retro_queue_as_empty
Maps the pinned Retro APK's absent queue schema to an empty observation.
chapter7/android-world/run_controlled_experiment.py:418
↓ 3 callersFunction_mutation_error
(operation: str, exc: Exception)
chapter4/perception-tools/src/filesystem_tools.py:35
↓ 3 callersFunction_mutation_root
()
chapter4/perception-tools/src/filesystem_tools.py:51
↓ 3 callersFunction_ok_response
(audio_bytes: bytes)
chapter7/tts-quality-eval/test_minimax_t2a_refresh.py:43
↓ 3 callersFunction_openrouter_model_id
Map a provider-native model name to an OpenRouter model id, used by the universal OpenRouter fallback. An explicit OPENROUTER_MODEL env var wins
chapter4/multimodal-agent/config.py:14
↓ 3 callersFunction_page
(src_uri: str, tmp_path: Path)
tests/test_site_edit_urls.py:39
↓ 3 callersFunction_parse_direct_audio_rubric
Validate a direct-audio judge response against the exact four dimensions.
chapter7/tts-quality-eval/pipeline.py:473
↓ 3 callersMethod_parse_target
(raw: str, candidates: List[str], allow_none: bool)
chapter10/voice-werewolf/werewolf/agent.py:308
↓ 3 callersFunction_path
(query: str)
chapter4/perception-tools/src/expanded_catalog.py:692
↓ 3 callersMethod_prepare_chunk_text
Prepare chunk text for indexing with contextual enrichment Args: chunk: Conversation chunk
chapter3/agentic-rag-for-user-memory/indexer.py:216
↓ 3 callersMethod_prepare_chunk_text
Prepare chunk text for indexing with contextual enrichment Args: chunk: Conversation chunk
chapter3/contextual-retrieval-for-user-memory/indexer.py:124
↓ 3 callersFunction_print_leaderboard
打印最终排行榜表格。若评分含置信区间则展示 95% CI 列。
chapter7/elo-leaderboard/cli.py:107
↓ 3 callersMethod_privacy
(self, trajectory: Dict[str, Any])
chapter9/trajectory-verifier/verifier.py:231
↓ 3 callersMethod_process_request
Process a user request Args: request: User request force_tools: Force tool usage regardless of setti
chapter1/search-codegen/main.py:182
↓ 3 callersFunction_quarantine
(root: Path, path: Path)
chapter4/perception-tools/src/filesystem_tools.py:154
↓ 3 callersMethod_queue_reactions
Queue reactions for asynchronous processing.
chapter5/permission-embedded-data-objects/pedo/core/store.py:536
↓ 3 callersMethod_raise_if_stopped_or_paused
Utility function that raises an InterruptedError if the agent is stopped or paused.
chapter9/browser-use-rpa/browser-use/browser_use/agent/service.py:631
↓ 3 callersFunction_real_receipt
(tool: str, backend: str = "live.example")
chapter4/active-tool-discovery/test_exact_experiment.py:61
↓ 3 callersFunction_redact_secrets
Remove credential values before any provider request/response is retained.
chapter6/phone-agent/agent.py:71
↓ 3 callersFunction_redact_text
(value: str)
chapter10/generative-agents/provider_adapter.py:38
↓ 3 callersMethod_redistribute_codes
Redistribute flattened codes back into SNAC's 3-layer format. Terminates early if invalid codes are detected (out of range 0
chapter8/orpheus/inference.py:196
↓ 3 callersMethod_repair_until_deterministic
Use actual compiler/pytest feedback to repair the created Agent.
chapter5/agent-creator/creator.py:1110
↓ 3 callersMethod_replace_sensitive_data
Replaces sensitive data placeholders in params with actual values. Args: params: The parameter object containing <secret>placeholder</secret>
chapter9/browser-use-rpa/browser-use/browser_use/tools/registry/service.py:398
↓ 3 callersMethod_replace_shortened_urls_in_string
Replace all shortened URLs in a string with their original URLs.
chapter9/browser-use-rpa/browser-use/browser_use/agent/service.py:1157
↓ 3 callersFunction_request_with_retry
Make HTTP request with timeout and retry logic.
chapter9/browser-use-rpa/browser-use/examples/cloud/01_basic_task.py:41
↓ 3 callersFunction_required
(label: str, value: str)
chapter6/phone-agent/agent.py:56
↓ 3 callersMethod_reranker
(self, name: str)
chapter7/user-memory-system-evaluation/experiment.py:869
↓ 3 callersFunction_resolve_mutation_path
( root: Path, value: str, *, must_exist: bool, )
chapter4/perception-tools/src/filesystem_tools.py:87
↓ 3 callersFunction_retry_clipper_foreground
Retries once only for AndroidWorld's documented Clipper foreground race.
chapter7/android-world/run_controlled_experiment.py:447
↓ 3 callersFunction_rubric_dimension_total
Compatibility helper retained for older result files and tests.
chapter9/self-evolution-eval/harness.py:12
↓ 3 callersFunction_run_loop
文本 ReAct 循环。 available_names: set,当前允许调用的工具名(不含 discover_tools/finish)。 —— 主动发现模式下会随 discover_tools 动态增长。 返回 (called_tools, trace,
chapter4/active-tool-discovery/agent.py:109
↓ 3 callersFunction_run_main
Run main() in interactive mode and return the api_key it hands on.
chapter1/context/tests/test_openrouter_notice.py:74
↓ 3 callersFunction_save_json
(obj, path: str)
chapter7/elo-leaderboard/cli.py:62
↓ 3 callersFunction_save_output
把问题、ReAct 轨迹和答案保存为 JSON 文件
chapter1/web-search-agent/main.py:25
↓ 3 callersMethod_save_storage_state
Save browser storage state to file.
chapter9/browser-use-rpa/browser-use/browser_use/browser/watchdogs/storage_state_watchdog.py:164
↓ 3 callersFunction_schemas
()
chapter4/perception-tools/test_expanded_catalog.py:19
↓ 3 callersFunction_search_without_network
屏蔽真实网络与退避 sleep,只验证参数处理不崩溃。
chapter9/self-evolving-tools/test_web_search_num_results.py:8
↓ 3 callersMethod_serialize_content_part_text
(part: ContentPartTextParam)
chapter9/browser-use-rpa/browser-use/browser_use/llm/groq/serializer.py:31
↓ 3 callersMethod_serialize_content_part_text
Convert a text content part to Anthropic's TextBlockParam.
chapter9/browser-use-rpa/browser-use/browser_use/llm/anthropic/serializer.py:61
↓ 3 callersMethod_serialize_content_part_text
(part: ContentPartTextParam)
chapter9/browser-use-rpa/browser-use/browser_use/llm/openai/serializer.py:32
↓ 3 callersMethod_serialize_content_part_text
Convert a text content part to AWS Bedrock format.
chapter9/browser-use-rpa/browser-use/browser_use/llm/aws/serializer.py:91
↓ 3 callersFunction_set_marker_label_font
Render the space and continuation markers when the CJK font lacks them. The CJK font chosen by ``_configure_cjk_font`` has neither U+2423 nor
chapter2/attention_visualization/visualization.py:456
↓ 3 callersFunction_sha
(path: Path)
chapter5/video-edit/campaign.py:44
↓ 3 callersMethod_show_dvd_screensaver_on_about_blank_tabs
Show DVD screensaver on all about:blank pages only.
chapter9/browser-use-rpa/browser-use/browser_use/browser/watchdogs/aboutblank_watchdog.py:108
↓ 3 callersFunction_slide_bullets
Keep string bullets only; JSON null / non-str items are skipped.
chapter5/paper-to-video/demo.py:204
↓ 3 callersFunction_stub_io
替换掉网络与帧抽取 IO,让 Agent 直接吃到给定的 LLM 回复文本。
chapter5/video-edit/test_agents_llm_json.py:19
↓ 3 callersFunction_suite
()
chapter3/memobase/test_evaluate_generic_empty_query.py:17
↓ 3 callersMethod_synthesize
(self, speaker: str, text: str, round_no: int)
chapter10/voice-werewolf/werewolf/simulator.py:125
↓ 3 callersMethod_tool_rewrite_todo_list
Rewrite TODO list with new pending items
chapter2/system-hint/agent.py:776
↓ 3 callersMethod_tool_update_todo_status
Update status of TODO items
chapter2/system-hint/agent.py:804
↓ 3 callersFunction_trajectory
Run the HTTP orchestrator and return its measured trajectory. Correct behavior is the default. The acceptance campaign can explicitly inject
chapter5/log-diagnosis/campaign.py:209
↓ 3 callersFunction_trigger_timer_callback
Trigger callback actions when timer expires.
chapter4/collaboration-tools/src/timer_tools.py:117
↓ 3 callersFunction_truncate_current_ui_section
Truncates only middles of T3A action or summary UI sections.
chapter7/android-world/run_controlled_experiment.py:319
↓ 3 callersFunction_try_call_func
Try calling a generated function with common argument patterns.
chapter5/permission-embedded-data-objects/pedo/eval/benchmark_safety.py:351
↓ 3 callersMethod_update
()
extras/agent-lab/agent-trajectory.js:422
↓ 3 callersFunction_use_openrouter
走 OpenRouter 的两种情形: 1) provider 自己的 Key 缺失、但有 OPENROUTER_API_KEY(统一兜底); 2) 目标是 gpt-5.x 且有 OPENROUTER_API_KEY —— 直连 gpt-5.x 需组织实名、 且 /ch
chapter9/prompt-auto-optimization/config.py:95
↓ 3 callersFunction_utc_now
()
chapter7/android-world/run_controlled_experiment.py:167
↓ 3 callersFunction_validate_resume_evidence
(evidence: dict[str, Any], args: argparse.Namespace)
chapter7/android-world/run_controlled_experiment.py:1270
↓ 3 callersFunction_vision
( backend: Backend, *, purpose: str, prompt: str, frames: list[dict[str, Any]], receip
chapter5/video-edit/campaign.py:185
↓ 3 callersMethod_vision_locate
抽取给定时间点的帧,连同问题交给 Vision LLM,返回 {start,end}。
chapter5/video-edit/agents.py:134
↓ 3 callersFunction_wrap_line
Greedy word-wrap of one logical line to fit avail_w pixels.
book-ar/svg_lib.py:162
↓ 3 callersFunction_write_checkpoint
(path: Path, identity: dict, results_by_arm: dict[str, dict[str, dict]])
chapter5/small-model-codified-rules/demo.py:365
↓ 3 callersFunction_write_json
(path: Path, payload: Any)
chapter1/learning-from-experience/run_experiment_8_2.py:53
↓ 3 callersMethodadd
(self, response, request: dict, latency_s: float | None = None)
chapter5/paper-to-ppt/agents.py:60
↓ 3 callersMethodadd_item
Add a history item to the list
chapter9/browser-use-rpa/browser-use/browser_use/agent/views.py:392
↓ 3 callersMethodadd_new_task
Add a new task to the agent, keeping the same task_id as tasks are continuous
chapter9/browser-use-rpa/browser-use/browser_use/agent/service.py:617
↓ 3 callersFunctionadd_to_buckets
(buckets: dict[str, int], times: list[str], start: datetime, bucket_seconds: int)
scripts/gen_star_history.py:320
↓ 3 callersFunctionaggregate
(records: Sequence[RunRecord], keys: Sequence[str])
chapter7/user-memory-system-evaluation/experiment.py:1246
↓ 3 callersFunctionaggregate
(passes: list[dict[str, Any]])
chapter6/controllable-tts/evaluate_audio_quality.py:312
↓ 3 callersMethodainvoke
(self, messages: list[BaseMessage], output_format: None = None)
chapter9/browser-use-rpa/browser-use/browser_use/llm/openai/chat.py:142
↓ 3 callersFunctionall_factors
全部因子(core + 所有扩展),按 key 去重。
chapter3/structured-knowledge-extraction/discovery.py:119
↓ 3 callersFunctionanalyze
(arms: List[Dict[str, Any]])
chapter1/context/run_experiment_1_1.py:495
↓ 3 callersMethodanalyze_conversation
Analyze conversation context and determine memory updates Args: conversation_context: List of conversation messa
chapter3/user-memory/background_memory_processor.py:110
↓ 3 callersMethodany_running
(self)
chapter6/async-agent/tasks.py:246
↓ 3 callersFunctionapply_edit
按剪辑计划 plan 生成成片。 plan 结构(由 Proposer Agent 产出): { "start": float, # 目标片段起点(秒) "end": float, # 目标片段终
chapter5/video-edit/video_editor.py:32
↓ 3 callersFunctionarrow
(edge, d, { dashed = false } = {})
web-astro/scripts/collaboration-society-figures.mjs:66
← previousnext →1,101–1,200 of 13,003, ranked by callers