java - Clarification on OpenAiChatModel constructor discrepancy between documentation and code example - Stack Overflow

I'm exploring the library (version 1.0.0-SNAPSHOT) and have found it to be a powerful tool for int

I'm exploring the library (version 1.0.0-SNAPSHOT) and have found it to be a powerful tool for integrating AI capabilities into Spring applications. However, I’ve encountered a discrepancy between the official documentation and the API reference that I'd like to clarify.

In the official documentation , there is an example demonstrating how to configure and use the OpenAiChatModel class:

var openAiApi = new OpenAiApi(System.getenv("OPENAI_API_KEY"));
var openAiChatOptions = OpenAiChatOptions.builder()
            .model("gpt-3.5-turbo")
            .temperature(0.4)
            .maxTokens(200)
            .build();
var chatModel = new OpenAiChatModel(this.openAiApi, this.openAiChatOptions);

This example suggests that the OpenAiChatModel constructor only requires two parameters, an OpenAiApi instance and an OpenAiChatOptions object. However, when I checked the API documentation API documentation, I noticed that the OpenAiChatModel class has only one constructor, which requires five parameters:

OpenAiChatModel(OpenAiApi openAiApi, 
                OpenAiChatOptions defaultOptions, 
                ToolCallingManager toolCallingManager, 
                .springframework.retry.support.RetryTemplate retryTemplate, 
                io.micrometer.observation.ObservationRegistry observationRegistry)

Could you please tell me why there is this difference between the example code in the documentation and the actual API implementation?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744296860a4567302.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信