Commit f924502
Support single object tool_calls in OpenAI vendor APIs
XFY Spark and possibly other vendors implement the OpenAI interface but return
tool_calls as a single object rather than an array. Add @jsonformat annotation
to handle both array and single object responses in ChatCompletionMessage,
making Spring AI more broadly compatible with OpenAI API implementations.
Only ChatCompletionMessage.java required modification to support this alternate
format while maintaining backward compatibility with the standard OpenAI API
response structure.
Co-authored-by: jito <[email protected]>1 parent 7780411 commit f924502
File tree
1 file changed
+3
-1
lines changed- models/spring-ai-openai/src/main/java/org/springframework/ai/openai/api
1 file changed
+3
-1
lines changedLines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
905 | 906 | | |
906 | 907 | | |
907 | 908 | | |
908 | | - | |
| 909 | + | |
| 910 | + | |
909 | 911 | | |
910 | 912 | | |
911 | 913 | | |
| |||
0 commit comments