You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/context.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ Context is an overloaded term. There are two main classes of context you might c
10
10
This is represented via the [`RunContextWrapper`][agents.run_context.RunContextWrapper] class and the [`context`][agents.run_context.RunContextWrapper.context] property within it. The way this works is:
11
11
12
12
1. You create any Python object you want. A common pattern is to use a dataclass or a Pydantic object.
13
-
2. You pass that object to the various run methods (e.g. `Runner.run(..., **context=whatever**))`.
13
+
2. You pass that object to the various run methods (e.g. `Runner.run(..., context=whatever)`).
14
14
3. All your tool calls, lifecycle hooks etc will be passed a wrapper object, `RunContextWrapper[T]`, where `T` represents your context object type which you can access via `wrapper.context`.
15
15
16
16
The **most important** thing to be aware of: every agent, tool function, lifecycle etc for a given agent run must use the same _type_ of context.
0 commit comments