docs: update custom API key example using OpenAiChatModel.builder() (#3335)
Signed-off-by: Cho-Hyun-Seung <toki0327@naver.com>
This commit is contained in:
committed by
Ilayaperumal Gopinathan
parent
cc5379344f
commit
03a2cb76ed
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user