Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Run context

RunContextWrapperdataclass

Bases:Generic[TContext]

This wraps the context object that you passed toRunner.run(). It also containsinformation about the usage of the agent run so far.

NOTE: Contexts are not passed to the LLM. They're a way to pass dependencies and data to codeyou implement, like tool functions, callbacks, hooks, etc.

Source code insrc/agents/run_context.py
@dataclassclassRunContextWrapper(Generic[TContext]):"""This wraps the context object that you passed to `Runner.run()`. It also contains    information about the usage of the agent run so far.    NOTE: Contexts are not passed to the LLM. They're a way to pass dependencies and data to code    you implement, like tool functions, callbacks, hooks, etc.    """context:TContext"""The context object (or None), passed by you to `Runner.run()`"""usage:Usage=field(default_factory=Usage)"""The usage of the agent run so far. For streamed responses, the usage will be stale until the    last chunk of the stream is processed.    """

contextinstance-attribute

context:TContext

The context object (or None), passed by you toRunner.run()

usageclass-attributeinstance-attribute

usage:Usage=field(default_factory=Usage)

The usage of the agent run so far. For streamed responses, the usage will be stale until thelast chunk of the stream is processed.


[8]ページ先頭

©2009-2025 Movatter.jp