Description
The current implementation of the fromSpringAiMessage method in the AzureOpenAiChatModel class does not support passing tool_calls or tool_call_id. Additionally, it does not handle the FUNCTION message type, which results in an IllegalArgumentException when such a message type is encountered.
Current Implementation
private ChatRequestMessage fromSpringAiMessage(Message message) {
switch (message.getMessageType()) {
case USER:
return new ChatRequestUserMessage(message.getContent());
case SYSTEM:
return new ChatRequestSystemMessage(message.getContent());
case ASSISTANT:
return new ChatRequestAssistantMessage(message.getContent());
default:
throw new IllegalArgumentException("Unknown message type " + message.getMessageType());
}
}
Problems
-
No way to pass
tool_callsortool_call_id: TheChatRequestAssistantMessageconstructor does not provide a way to pass thetool_callsjava @JsonCreator public ChatRequestAssistantMessage(@JsonProperty("content") String content) { this.content = content; } -
Does not support
FUNCTIONmessage type
Comment From: csterwa
@RikJux does the recent M2 release resolve this issue?
Comment From: csterwa
May be old. Closing.