Python: Added fixes and more examples for OpenAI and Azure chat client agents (#232)

* Added non-streaming and streaming examples

* Updated resource management

* Added examples with thread management

* Added function tools examples

* Small rename

* Added code interpreter example

* Updated example

* Addressed PR feedback

* Added more OpenAI and Azure chat completion examples

* File renaming

* Small fix in tests

* Small revert

* More renaming

* Small fix
This commit is contained in:
Dmytro Struk
2025-07-24 08:31:05 -07:00
committed by GitHub
Unverified
parent 14efb626ab
commit a72245287f
14 changed files with 694 additions and 89 deletions
@@ -47,7 +47,7 @@ async def streaming_example() -> None:
) as agent:
query = "What's the weather like in Portland?"
print(f"User: {query}")
print("Assistant: ", end="", flush=True)
print("Agent: ", end="", flush=True)
async for chunk in agent.run_stream(query):
if chunk.text:
print(chunk.text, end="", flush=True)
@@ -55,7 +55,7 @@ async def streaming_example() -> None:
async def main() -> None:
print("=== Basic Foundry Chat Client Example ===")
print("=== Basic Foundry Chat Client Agent Example ===")
await non_streaming_example()
await streaming_example()