microsoft / semantic-kernel

Integrate cutting-edge LLM technology quickly and easily into your apps
https://aka.ms/semantic-kernel
MIT License
21.83k stars 3.25k forks source link

Python: Bug: extension_data doesn't seem to propagate in chat completions API #9456

Open barucoh opened 1 day ago

barucoh commented 1 day ago

Describe the bug I want to use the parallel_tool_calls=False flag to only call a single function at a time. Trying to use it with extension_data doesn't seem to work. I put a breakpoint in the openai._base_client.py : AsyncAPIClient._request function to see what is exactly being sent to the API and the flag is not there.

To Reproduce Steps to reproduce the behavior:

        settings: OpenAIChatPromptExecutionSettings = (
            self.kernel.get_prompt_execution_settings_from_service_id(
                service_id="service_name"
            )
        )
        settings.extension_data = {"parallel_tool_calls": False}

        arguments = KernelArguments(settings=settings)

        ...

        chat_function = self.kernel.add_function(
            prompt="{{$chat_history}}",
            plugin_name="ChatBot",
            function_name="Chat",
        )
        result = await self.kernel.invoke(chat_function, arguments=arguments)

Platform

evchaki commented 1 day ago

@barucoh thanks for bringing this up. We will take a look and see what we can do to support this. @moonbox3