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
+2 -2
View File
@@ -229,12 +229,12 @@ async def test_chat_client_agent_get_new_thread(chat_client: ChatClient) -> None
async def test_chat_client_agent_prepare_thread_and_messages(chat_client: ChatClient) -> None:
agent = ChatClientAgent(chat_client=chat_client)
message = ChatMessage(role=ChatRole.USER, contents=[TextContent("Hello")])
message = ChatMessage(role=ChatRole.USER, text="Hello")
thread = ChatClientAgentThread(messages=[message])
result_thread, result_messages = await agent._prepare_thread_and_messages( # type: ignore[reportPrivateUsage]
thread=thread,
input_messages="Test",
input_messages=[ChatMessage(role=ChatRole.USER, text="Test")],
construct_thread=lambda: ChatClientAgentThread(),
expected_type=ChatClientAgentThread,
)