MCPcopy Create free account

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

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

↓ 11 callersMethodfrom_env
Create config from environment variables
chapter3/agentic-rag/config.py:247
↓ 11 callersMethodgenerate
Generate response using Kimi K3 model.
chapter3/mem0/agent.py:104
↓ 11 callersMethodget_available_actions
Get list of available actions in current state.
chapter1/learning-from-experience/game_environment.py:172
↓ 11 callersFunctionheight
( value, width, { size = 16, mono = false, bold = false, min = 0 } = {}, )
web-astro/scripts/chapter3-figure-kit.mjs:84
↓ 11 callersFunctionmean
(values: Iterable[Optional[float]])
chapter7/user-memory-system-evaluation/experiment.py:1216
↓ 11 callersFunctionnormalize_number
标准化数字格式:去除逗号、空格、LaTeX 符号等
chapter8/Intuitor/evaluate_from_cache.py:71
↓ 11 callersMethodpoll
(self)
chapter10/voice-werewolf/test_live_human.py:242
↓ 11 callersMethodprocess
Process a query and return the final answer as a string Args: query: The query to process max_iterat
chapter1/context/agent.py:989
↓ 11 callersFunctionrow
(ids, options = {})
web-astro/scripts/computer-use-layout.mjs:2
↓ 11 callersMethodstep
(self, action: Action)
chapter2/prompt-engineering/tau_bench/envs/base.py:92
↓ 11 callersMethodterminate
(self)
chapter10/voice-werewolf/test_live_human.py:245
↓ 11 callersFunctionwrite_campaign_evidence
Write immutable run artifacts plus ``validation/latest.json``. ``latest.json`` is the canonical compact pointer. It contains hashes for the
chapter3/experiment_utils.py:135
↓ 10 callersFunction_completed
Return terminal-response status with compatibility for old results.
chapter1/context/main.py:33
↓ 10 callersMethod_filter
(self, condition: str = None, model: str = None, category: str = None)
chapter5/permission-embedded-data-objects/pedo/eval/dataguardbench/metrics.py:190
↓ 10 callersFunctioncanonical_json
(value: Any)
chapter4/active-tool-discovery/run_exact_experiment.py:120
↓ 10 callersFunctioncard
(x, y, width, h, { fill = '#f0f0f0', dash = false } = {})
web-astro/scripts/chapter3-figure-kit.mjs:136
↓ 10 callersFunctionclean_token_labels
Make raw tokenizer tokens readable as axis labels. Replaces whitespace with visible glyphs and truncates very long special tokens so the
chapter2/attention_visualization/visualization.py:428
↓ 10 callersMethodcode_interpreter
Execute code in a sandboxed environment with multi-language support. Args: code: Code to execute lan
chapter4/execution-tools/execution_tools.py:78
↓ 10 callersMethoddefault_attacks
返回覆盖五大向量的内置默认攻击集。
chapter2/prompt-injection/robustness_evaluator.py:233
↓ 10 callersMethoddelete
(self, object_id, accessor, _reaction_depth=0)
tests/test_ch5_pedo_live_security_eval.py:342
↓ 10 callersMethoddispatch_notification
Dispatch notification to a single channel.
chapter4/collaboration-tools/src/notification_dispatcher.py:318
↓ 10 callersMethodevaluate
Evaluate an agent's response against the test case criteria. Args: test_case: The test case being evaluated
chapter3/user-memory-evaluation/evaluator.py:75
↓ 10 callersMethodexecute
(self, name: str, arguments: dict[str, Any])
chapter7/model-action-threshold/experiment.py:290
↓ 10 callersFunctionextract_youtube_transcript
Extract transcript from a YouTube video. Args: video_id: YouTube video ID or URL language_code: Language code for the tr
chapter4/perception-tools/src/multimodal_tools.py:473
↓ 10 callersFunctionforeign_trace
(issuer: str = KIMI, kind: str = PLAINTEXT, credential: str | None = None)
chapter5/provider-failover/tests/test_offline.py:18
↓ 10 callersMethodfrom_env
Create configuration from environment variables.
chapter3/mem0/config.py:185
↓ 10 callersMethodfrom_env
Create config from environment variables
chapter3/contextual-retrieval/config.py:247
↓ 10 callersMethodget_element_by_index
Alias for get_dom_element_by_index for backwards compatibility.
chapter9/browser-use-rpa/browser-use/browser_use/browser/session.py:1653
↓ 10 callersMethodinner_text
(self, **kwargs)
chapter10/parallel-web-research/test_coordination.py:111
↓ 10 callersFunctionis_new_tab_page
Check if a URL is a new tab page (about:blank, chrome://new-tab-page, or chrome://newtab). Args: url: The URL to check Returns: bool: True i
chapter9/browser-use-rpa/browser-use/browser_use/utils.py:422
↓ 10 callersFunctionparse_rewrite_output
把改写节点的原始输出解析为 {prompt, negative_prompt, style_notes}。 容忍 ```json 代码围栏和前后多余文字;结构不合法时抛 ValueError。
chapter1/image-gen-workflow/pipeline.py:41
↓ 10 callersFunctionread
(arm)
chapter6/astra-async-steering/test_judging.py:16
↓ 10 callersFunctionread
(arm)
chapter6/astra-async-steering/validation/runs/exp6-14-20260905-formal/source/test_judging.py:16
↓ 10 callersMethodregister_reaction_handler
(self, name: str, handler: Callable)
chapter5/permission-embedded-data-objects/pedo/core/store.py:116
↓ 10 callersFunctionreport_for
(text, *, result=None, arguments=None, tool="refund_order", turn=2)
tests/test_ch9_factual_grounding.py:15
↓ 10 callersFunctionresolve_llm_backend
Resolve a backend from a loose key/URL pair, as the old helper did. Prefer :func:`~agentbook.providers.resolution.resolve_backend`, which knows
agentbook/providers/legacy.py:35
↓ 10 callersMethodrun
Run the interactive CLI
chapter1/search-codegen/main.py:237
↓ 10 callersMethodscreenshot
Take a screenshot and return base64 encoded image. Args: format: Image format ('jpeg', 'png', 'webp') quality: Quality 0-100 for JPEG f
chapter9/browser-use-rpa/browser-use/browser_use/actor/page.py:190
↓ 10 callersFunctionsha256
(value: bytes | str)
chapter6/agent-with-event-trigger/unipile_mailbox_experiment.py:41
↓ 10 callersMethodstop
Stop the browser session without killing the browser process. This clears event buses and cached state but keeps the browser alive. Useful when y
chapter9/browser-use-rpa/browser-use/browser_use/browser/session.py:481
↓ 10 callersMethodsubmit_decision
Submit human decision for a pending request.
chapter4/collaboration-tools/src/notification_dispatcher.py:381
↓ 10 callersMethodsubscribe
注册一个订阅者,返回订阅句柄。types=None 表示接收所有类型。
chapter10/parallel-web-research/message_bus.py:102
↓ 10 callersFunctionvalidate_manifest
离线校验 manifest 结构,返回问题列表(空列表表示通过)。
chapter1/image-gen-workflow/evidence.py:83
↓ 10 callersMethodwrite_file
( file_name: str, content: str, file_system: FileSystem, append: bool = False, trailing_newline
chapter9/browser-use-rpa/browser-use/browser_use/tools/service.py:887
↓ 9 callersMethod_is_safe_path
Check if path is within allowed directories.
chapter4/execution-tools/filesystem_enhanced.py:29
↓ 9 callersFunction_limit
(options: dict[str, Any], default: int = 10)
chapter4/perception-tools/src/expanded_catalog.py:483
↓ 9 callersFunction_manifest
(**overrides)
chapter1/image-gen-workflow/tests/test_manifest_schema.py:43
↓ 9 callersMethod_resolve_path
Resolve path relative to workspace.
chapter4/execution-tools/filesystem_enhanced.py:22
↓ 9 callersMethod_write_files
Write additional files to tmp directory.
chapter4/execution-tools/multilang_executor.py:261
↓ 9 callersMethodadd
(self, observation: Observation)
chapter7/model-benchmark/campaign.py:326
↓ 9 callersFunctionassess_groundedness
Judge whether an answer's figures have any source behind them. Groundedness is deliberately orthogonal to correctness. A model with no obser
chapter1/context/grounding.py:129
↓ 9 callersMethodbuild
(self, target_tokens: int, output_tokens: int)
chapter7/model-benchmark/campaign.py:369
↓ 9 callersFunctionbuild_agent
Create an Agent without constructing a real OpenAI client.
chapter1/web-search-agent/tests/test_agent.py:30
↓ 9 callersMethodcalculate_backoff_curves
Compute 429 rate limit backoff curve metrics by request rate level.
chapter7/model-benchmark/rate_ramp_benchmark.py:154
↓ 9 callersMethodclose
(self)
chapter6/agent-with-event-trigger/unipile_mailbox_experiment.py:131
↓ 9 callersMethodcreate
(**kwargs)
chapter5/code-for-math/test_empty_problems.py:21
↓ 9 callersMethodcreate
(self, *, purpose: str, **request: Any)
chapter3/experiment_utils.py:99
↓ 9 callersMethodcreateProvider
(providerName, config, globalConfig)
chapter6/live-audio/backend/utils/providers/asrProviders.js:248
↓ 9 callersMethodcreate_optimized_json_schema
Create the most optimized schema by flattening all $ref/$defs while preserving FULL descriptions and ALL action definitions. Also ensures OpenAI
chapter9/browser-use-rpa/browser-use/browser_use/llm/schema.py:12
↓ 9 callersMethodevaluate_all
评估全部攻击向量并汇总为 :class:`RobustnessReport`。
chapter2/prompt-injection/robustness_evaluator.py:178
↓ 9 callersMethodexecute_action
Execute an action and return (feedback, reward, done).
chapter1/learning-from-experience/game_environment.py:204
↓ 9 callersMethodexecute_tool
Execute a tool by name with given arguments
chapter2/local_llm_serving/tools.py:125
↓ 9 callersMethodgoto
(self, *args, **kwargs)
chapter10/parallel-web-research/test_coordination.py:105
↓ 9 callersMethodhandle_barge_in
Handle instant audio stream cancellation, dialogue context truncation, and re-planning. Entrypoint called upon barge-in detection or manual i
chapter6/streaming-speech/interruption_manager.py:276
↓ 9 callersFunctionhash_item
(item: Any)
chapter2/prompt-engineering/tau_bench/model_utils/api/cache.py:47
↓ 9 callersMethodmodel
(self)
chapter9/browser-use-rpa/browser-use/examples/models/langchain/chat.py:31
↓ 9 callersFunctionnumber
(value, default=None)
book-vi/fix_svg_text_layout.py:107
↓ 9 callersFunctionpanel
( k, x, y, w, rows, { fill = '#f0f0f0', min = 0, name = '' } = {}, )
web-astro/scripts/computer-use-layout.mjs:8
↓ 9 callersMethodquery
Process a user query using the ReAct pattern. Args: user_query: The user's question stream: Whether
chapter3/agentic-rag/agent.py:231
↓ 9 callersMethodrelease
(self)
chapter4/perception-tools/test_analyze_video_release_on_error.py:75
↓ 9 callersFunctionsafe_eval
Evaluate a whitelisted mathematical expression and return its value. Raises: UnsafeExpression: if the expression uses syntax outside the
chapter1/context/calc_sandbox.py:93
↓ 9 callersMethodsend
( self, sender_id: str, target: str, type: str, payload: Optional[Dict
chapter10/parallel-web-research/message_bus.py:131
↓ 9 callersMethodstop
(self)
chapter6/async-agent/runtime.py:365
↓ 9 callersMethodto_text
Convert chunk to text format for indexing
chapter3/agentic-rag-for-user-memory/chunker.py:62
↓ 9 callersMethodwrite_file
Write content to a file with safety checks. Args: path: File path (relative to workspace or absolute)
chapter4/execution-tools/file_tools.py:34
↓ 8 callersMethod_ask
( self, prompt: str, *, purpose: str = "creator_generation", max_token
chapter5/agent-creator/creator.py:208
↓ 8 callersFunction_extract_json
从 LLM 回复里稳健地抠出第一个 JSON 对象。
chapter5/video-edit/agents.py:88
↓ 8 callersMethod_extract_single_content
Extract a single piece of content to text
chapter4/multimodal-agent/agent.py:611
↓ 8 callersMethod_load_object
(self, object_id: str)
chapter5/permission-embedded-data-objects/pedo/core/store.py:674
↓ 8 callersFunction_report_issues
Return issue dicts; null/non-list → []; skip non-dict entries.
chapter10/book-translation/agents.py:34
↓ 8 callersMethod_safe_files
(payload: dict[str, Any], allowed: set[str])
chapter5/agent-creator/creator.py:373
↓ 8 callersFunction_text_width
Estimated rendered width of a single line of text, in pixels.
book-ar/svg_lib.py:134
↓ 8 callersMethodadd
(self, result: PromptResult)
chapter5/permission-embedded-data-objects/pedo/eval/dataguardbench/metrics.py:62
↓ 8 callersMethodadd
(self, round_no, phase, category, content, visible_to)
chapter10/voice-werewolf/werewolf/audit.py:28
↓ 8 callersMethodadd_dialogue_turn
Add a dialogue turn to the current context.
chapter6/streaming-speech/interruption_manager.py:365
↓ 8 callersMethodadd_turn
Add a conversation turn Args: session_id: Session identifier user_message: User's message
chapter3/user-memory/conversation_history.py:95
↓ 8 callersFunctionapprox_num_tokens
(text: str)
chapter2/prompt-engineering/tau_bench/model_utils/model/utils.py:141
↓ 8 callersMethodcall
(self, tool: str, arguments: dict[str, str] | None)
chapter7/public-health-reporting-eval/reporting_tools.py:134
↓ 8 callersMethodcall_tool
Call a tool and return the result.
chapter4/collaboration-tools/client_example.py:44
↓ 8 callersFunctioncandidate
(org="", position="acme", parent=None, references=None)
tests/test_ch5_pedo_tenant_isolation.py:49
↓ 8 callersMethodclear
Clear all documents.
chapter3/retrieval-pipeline/demo.py:38
↓ 8 callersMethodclose
Close all resources
chapter9/browser-use-rpa/browser-use/browser_use/agent/service.py:2025
↓ 8 callersMethodclose
(self)
chapter10/parallel-web-research/agents.py:58
↓ 8 callersMethodcolor
Apply color to text if colors are enabled
chapter5/coding-agent/main.py:49
↓ 8 callersMethodcreate_action_model
Creates a Union of individual action models from registered actions, used by LLM APIs that support tool calling & enforce a schema. Each action m
chapter9/browser-use-rpa/browser-use/browser_use/tools/registry/service.py:478
↓ 8 callersFunctiondispatch
(catalog: dict, name: str, args: dict, out_path: Path)
chapter2/agent-skills-ppt/demo.py:210
↓ 8 callersMethodenable
(self, params: dict, session_id: str | None = None)
chapter9/browser-use-rpa/browser-use/tests/ci/test_browser_session_proxy.py:48
↓ 8 callersMethodevaluate
Evaluate the agent's performance using accumulated experiences. Args: num_episodes: Number of episodes to evalua
chapter1/learning-from-experience/llm_agent.py:578
↓ 8 callersMethodexecute_task
Execute a task using available tools with system hints Args: task: The task to execute max_iteration
chapter2/system-hint/agent.py:825
↓ 8 callersFunctionextract_and_normalize_answer
从模型输出中提取并标准化答案
chapter8/Intuitor/evaluate_from_cache.py:137
← previousnext →201–300 of 13,003, ranked by callers