semantic-kernel icon indicating copy to clipboard operation
semantic-kernel copied to clipboard

Python: Execution settings should not specify defaults for settings that the AI Service has a default for.

Open alliscode opened this issue 1 year ago • 0 comments

A request to OpenAI with no ExceutionSettings defined in user code results in the following request body:

{
    "messages": [{
            "content": "Can you help me tell the time in Seattle right now?",
            "role": "user"
        }
    ],
    "temperature": 1,
    "top_p": 1,
    "n": 1,
    "presence_penalty": 0,
    "frequency_penalty": 0,
    "model": "Dummy"
}

Values are specified for tmperature, top_p, n, presence_penalty, and frequency_penalty. It would be better to not specify these settings unless the SK user explicitly sets them. Currently, the defaults that we provide match those provided by OpenAI, so removing them should not result in changed behavior for customers.

Expected behavior

When a user of SK has not specified any ExecutionSettings, SK should not provide any:

{
    "messages": [{
            "content": "Can you help me tell the time in Seattle right now?",
            "role": "user"
        }
    ],
    "model": "Dummy"
}

Platform

  • OS: [e.g. Windows, Mac]
  • IDE: [e.g. Visual Studio, VS Code]
  • Language: [e.g. C#, Python]
  • Source: [e.g. NuGet package version 0.1.0, pip package version 0.1.0, main branch of repository]

Additional context Add any other context about the problem here.

alliscode avatar May 13 '24 20:05 alliscode