-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WatsonxAiChatModel is using wrong APIs #2334
Comments
Hi @FabioAng71, Both the If your use case requires OpenAI API-compatible behavior the recommended approach is to use the
same approach as Deepseek and Groq Let me know if this works for you or if you have any further questions!? |
Hi @apappascs. I followed you seggustion but it doesn't work for several reasons:
The right solution should be to re-implement WatsonxAiChatModel using Let me know your thoughts |
@FabioAng71 Thank you for looking into this. Based on your findings, it seems that it's not compatible with the OpenAI API. However, to be honest, I'm not sure which of these endpoints is preferable or why. I couldn't find any documentation comparing the two: |
@apappascs On the other hand WatsonxAi Text Generation API is just a simple text request and a simple text response. Looking into IBM documentaion for Text Generation API it is cleary stated that the correct API is WatsonxAi Chat API |
Bug description
While using WatsonxAiChatModel I see the request is sent to the following endpoint:
/ml/v1/text/generation?version=2023-05-29
https://cloud.ibm.com/apidocs/watsonx-ai#text-generation
while I expect it should use the following one:
/ml/v1/text/chat?version=2023-05-29
https://cloud.ibm.com/apidocs/watsonx-ai#text-chat
and consequently all the parameters associated with the second API (such as tools)
watsonx-ai.text-chat is very close to opeai.completions
Environment
Spring AI 1.0.0-M6, Java version 21
Steps to reproduce
add the following fragment to the pom.xml
Expected behavior
I think that the WatsonxAiChatModel should be changed and be more close to the OpenAiChatModel
The text was updated successfully, but these errors were encountered: