From 69dfd5998c4528f168883bff604015e3c6c0aefc Mon Sep 17 00:00:00 2001 From: Cho-Hyun-Seung Date: Tue, 27 May 2025 02:26:50 +0900 Subject: [PATCH] docs: update custom API key example using OpenAiChatModel.builder() Signed-off-by: Cho-Hyun-Seung --- .../antora/modules/ROOT/pages/api/chat/openai-chat.adoc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/openai-chat.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/openai-chat.adoc index 2dd6fd042f9..e47672c0f85 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/openai-chat.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/openai-chat.adoc @@ -631,9 +631,12 @@ OpenAiApi openAiApi = OpenAiApi.builder() .apiKey(customApiKey) .build(); -// Create a chat client with the custom OpenAiApi instance -OpenAiChatClient chatClient = new OpenAiChatClient(openAiApi); - +// Create a chat model with the custom OpenAiApi instance +OpenAiChatmodel chatModel = OpenAiChatModel.builder() + .openAiApi(openAiApi) + .build(); +// Build the ChatClient using the custom chat model +ChatClient openAiChatClient = ChatClient.builder(chatModel).build(); ---- This is useful when you need to: