spring-ai
spring-ai copied to clipboard
WatsonxAiChatModel is using wrong APIs
trafficstars
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
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-watsonx-ai-spring-boot-starter</artifactId>
</dependency>
Expected behavior I think that the WatsonxAiChatModel should be changed and be more close to the OpenAiChatModel