最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin6浏览0评论

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?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论