Python: updated API in sync with dotnet (#269)

* updated API in sync with dotnet

* fix test

* updated name and display_name

* fixed mypy setup

* add pre-commit cache
This commit is contained in:
Eduard van Valkenburg
2025-07-30 10:50:22 +02:00
committed by GitHub
Unverified
parent dc993b4734
commit 1ed89d4db8
13 changed files with 138 additions and 84 deletions
@@ -48,7 +48,7 @@ async def streaming_example() -> None:
query = "What's the weather like in Portland?"
print(f"User: {query}")
print("Agent: ", end="", flush=True)
async for chunk in agent.run_stream(query):
async for chunk in agent.run_streaming(query):
if chunk.text:
print(chunk.text, end="", flush=True)
print("\n")
@@ -48,7 +48,7 @@ async def streaming_example() -> None:
query = "What's the weather like in Portland?"
print(f"User: {query}")
print("Agent: ", end="", flush=True)
async for chunk in agent.run_stream(query):
async for chunk in agent.run_streaming(query):
if chunk.text:
print(chunk.text, end="", flush=True)
print("\n")
@@ -44,7 +44,7 @@ async def main() -> None:
print(f"User: {query}")
print("Agent: ", end="", flush=True)
generated_code = ""
async for chunk in agent.run_stream(query):
async for chunk in agent.run_streaming(query):
if chunk.text:
print(chunk.text, end="", flush=True)
code_interpreter_chunk = get_code_interpreter_chunk(chunk)
@@ -46,7 +46,7 @@ async def streaming_example() -> None:
query = "What's the weather like in Portland?"
print(f"User: {query}")
print("Agent: ", end="", flush=True)
async for chunk in agent.run_stream(query):
async for chunk in agent.run_streaming(query):
if chunk.text:
print(chunk.text, end="", flush=True)
print("\n")
@@ -46,7 +46,7 @@ async def streaming_example() -> None:
query = "What's the weather like in Portland?"
print(f"User: {query}")
print("Agent: ", end="", flush=True)
async for chunk in agent.run_stream(query):
async for chunk in agent.run_streaming(query):
if chunk.text:
print(chunk.text, end="", flush=True)
print("\n")