spring-ai icon indicating copy to clipboard operation
spring-ai copied to clipboard

[AzureOpenAiChatOptions] Unable to set all possible options when calling AzureOpenAiChatModel

Open RikJux opened this issue 1 year ago • 2 comments

Bug description Consider the attributes that can be set through AzureOpenAiChatOptions:

  • maxTokens
  • temperature
  • topP
  • logitBias
  • user
  • n
  • stop
  • presencePenalty
  • frequencyPenalty
  • deploymentName
  • responseFormat
  • functionCallbacks
  • functions

The AzureOpenAiChatOptions object is used in the AzureOpenAiChatModel to create the instance of ChatCompletionsOptions. ChatCompletionsOptions has the following attributes:

  • messages
  • maxTokens
  • temperature
  • topP
  • logitBias
  • user
  • n
  • stop
  • presencePenalty
  • frequencyPenalty
  • stream
  • model
  • functions
  • functionCall
  • functionCallConfig
  • dataSources
  • enhancements
  • seed
  • responseFormat
  • tools
  • toolChoice
  • logprobs
  • topLogprobs

In code it seems like there's no way to set options like logprobs, enhancements or seed.

Furthermore, in the method that should merge two ChatCompletionsOptions:

private ChatCompletionsOptions merge(ChatCompletionsOptions fromOptions, ChatCompletionsOptions toOptions) 

such options are not taken into account

Expected behavior I'm expecting the AzureOpenAiChatOptions to be aligned with the currently available options for Azure OpenAi

RikJux avatar Jun 18 '24 15:06 RikJux