22
33import asyncio
44
5- from agent_framework import Agent , Content
5+ from agent_framework import Agent
66from agent_framework .openai import OpenAIResponsesClient
77
88"""
1515# Helper functions
1616
1717
18- async def create_vector_store (client : OpenAIResponsesClient ) -> tuple [str , Content ]:
18+ async def create_vector_store (client : OpenAIResponsesClient ) -> tuple [str , str ]:
1919 """Create a vector store with sample documents."""
2020 file = await client .client .files .create (
2121 file = ("todays_weather.txt" , b"The weather today is sunny with a high of 75F." ), purpose = "user_data"
@@ -28,7 +28,7 @@ async def create_vector_store(client: OpenAIResponsesClient) -> tuple[str, Conte
2828 if result .last_error is not None :
2929 raise Exception (f"Vector store file processing failed with status: { result .last_error .message } " )
3030
31- return file .id , Content . from_hosted_vector_store ( vector_store_id = vector_store .id )
31+ return file .id , vector_store .id
3232
3333
3434async def delete_vector_store (client : OpenAIResponsesClient , file_id : str , vector_store_id : str ) -> None :
@@ -53,14 +53,14 @@ async def main() -> None:
5353 )
5454
5555 if stream :
56- print ("Assistant : " , end = "" )
56+ print ("Agent : " , end = "" )
5757 async for chunk in agent .run (message , stream = True ):
5858 if chunk .text :
5959 print (chunk .text , end = "" )
6060 print ("" )
6161 else :
6262 response = await agent .run (message )
63- print (f"Assistant : { response } " )
63+ print (f"Agent : { response } " )
6464 await delete_vector_store (client , file_id , vector_store_id )
6565
6666
0 commit comments