From 74888f8e56350f2c6c326bbb33173e73e141b05d Mon Sep 17 00:00:00 2001 From: Afzal Pawaskar <2928898+afzalmushtaque@users.noreply.github.com> Date: Wed, 14 May 2025 22:55:19 +0530 Subject: [PATCH 1/2] Fix missing tools in logs Fix for LLMCallEvent failing to log "tools" passed to BaseOpenAIChatCompletionClient in autogen_ext.models.openai._openai_client.BaseOpenAIChatCompletionClient https://github.com/microsoft/autogen/issues/6531 This bug creates problems inspecting why a certain tool was selected/not selected by the LLM as the list of tools available to the LLM is not present in the logs --- .../autogen-ext/src/autogen_ext/models/openai/_openai_client.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/packages/autogen-ext/src/autogen_ext/models/openai/_openai_client.py b/python/packages/autogen-ext/src/autogen_ext/models/openai/_openai_client.py index ffe816e599c8..973fdd23a1eb 100644 --- a/python/packages/autogen-ext/src/autogen_ext/models/openai/_openai_client.py +++ b/python/packages/autogen-ext/src/autogen_ext/models/openai/_openai_client.py @@ -637,6 +637,7 @@ async def create( response=result.model_dump(), prompt_tokens=usage.prompt_tokens, completion_tokens=usage.completion_tokens, + tools=tools, ) ) From d7acecf545c4a8f5f0c85249e3e1214ff70f0d8d Mon Sep 17 00:00:00 2001 From: Eric Zhu Date: Thu, 15 May 2025 17:03:15 -0700 Subject: [PATCH 2/2] Update python/packages/autogen-ext/src/autogen_ext/models/openai/_openai_client.py --- .../autogen-ext/src/autogen_ext/models/openai/_openai_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/packages/autogen-ext/src/autogen_ext/models/openai/_openai_client.py b/python/packages/autogen-ext/src/autogen_ext/models/openai/_openai_client.py index 0af75745441f..936b3a6c7a23 100644 --- a/python/packages/autogen-ext/src/autogen_ext/models/openai/_openai_client.py +++ b/python/packages/autogen-ext/src/autogen_ext/models/openai/_openai_client.py @@ -637,7 +637,7 @@ async def create( response=result.model_dump(), prompt_tokens=usage.prompt_tokens, completion_tokens=usage.completion_tokens, - tools=tools, + tools=create_params.tools, ) )