Python: OpenAI Responses Agent - threads, code interpreter, bug fixes and examples (#242)

* Added basic example with small fix

* Added example with function tools

* Added example with thread management

* Small renaming

* Added example with code interpreter
This commit is contained in:
Dmytro Struk
2025-07-28 10:07:29 -07:00
committed by GitHub
Unverified
parent 190035bb69
commit c794892d79
10 changed files with 403 additions and 35 deletions
@@ -33,7 +33,7 @@ def get_code_interpreter_chunk(chunk: AgentRunResponseUpdate) -> str | None:
async def main() -> None:
"""Example showing how to use the HostedCodeInterpreterTool with Foundry."""
print("=== Foundry Chat Client with Code Interpreter Example ===")
print("=== Foundry Agent with Code Interpreter Example ===")
async with ChatClientAgent(
chat_client=FoundryChatClient(),
@@ -60,7 +60,7 @@ async def example_with_thread_persistence() -> None:
print(f"Agent: {result1.text}")
# Second conversation using the same thread - maintains context
query2 = "How about comparing it to London?"
query2 = "How about London?"
print(f"\nUser: {query2}")
result2 = await agent.run(query2, thread=thread)
print(f"Agent: {result2.text}")