fix annotation numbering in context management
Fix inconsistent numbering between code and explanatory annotations in the context management documentation.
This commit is contained in:
parent
211ffb28c5
commit
d56047be51
1 changed files with 3 additions and 3 deletions
|
|
@ -41,14 +41,14 @@ async def fetch_user_age(wrapper: RunContextWrapper[UserInfo]) -> str: # (2)!
|
||||||
return f"User {wrapper.context.name} is 47 years old"
|
return f"User {wrapper.context.name} is 47 years old"
|
||||||
|
|
||||||
async def main():
|
async def main():
|
||||||
user_info = UserInfo(name="John", uid=123) # (3)!
|
user_info = UserInfo(name="John", uid=123)
|
||||||
|
|
||||||
agent = Agent[UserInfo]( # (4)!
|
agent = Agent[UserInfo]( # (3)!
|
||||||
name="Assistant",
|
name="Assistant",
|
||||||
tools=[fetch_user_age],
|
tools=[fetch_user_age],
|
||||||
)
|
)
|
||||||
|
|
||||||
result = await Runner.run(
|
result = await Runner.run( # (4)!
|
||||||
starting_agent=agent,
|
starting_agent=agent,
|
||||||
input="What is the age of the user?",
|
input="What is the age of the user?",
|
||||||
context=user_info,
|
context=user_info,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue