Python: added args and results to function call span (#733)

* added args and results to function call span

* add ignores for mypy

* improved serialization

* also add None result

* improved handling

* log args when None

* slight tweak

* fix tests
This commit is contained in:
Eduard van Valkenburg
2025-09-15 20:28:01 +02:00
committed by GitHub
Unverified
parent ba9a1a61e1
commit db58a10a37
6 changed files with 123 additions and 80 deletions
@@ -108,15 +108,15 @@ async def main(scenario: Literal["chat_client", "chat_client_stream", "ai_functi
client = OpenAIResponsesClient()
# Scenarios where telemetry is collected in the SDK, from the most basic to the most complex.
if scenario == "ai_function" or scenario == "all":
with suppress(Exception):
await run_ai_function()
if scenario == "chat_client_stream" or scenario == "all":
with suppress(Exception):
await run_chat_client(client, stream=True)
if scenario == "chat_client" or scenario == "all":
with suppress(Exception):
await run_chat_client(client, stream=False)
if scenario == "ai_function" or scenario == "all":
with suppress(Exception):
await run_ai_function()
if __name__ == "__main__":