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

WatsonxAiChatModel is using wrong APIs

Open FabioAng71 opened this issue 8 months ago • 10 comments
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

FabioAng71 avatar Feb 26 '25 18:02 FabioAng71