Corrected the name of a constant.
This commit is contained in:
parent
2b22ffc5ea
commit
1a2a6582ad
|
@ -45,7 +45,7 @@ public class ChainWithDocumentLiveTest {
|
|||
ingestor.ingest(document);
|
||||
|
||||
ChatLanguageModel chatModel = OpenAiChatModel.builder()
|
||||
.apiKey(Constants.OPEN_AI_KEY)
|
||||
.apiKey(Constants.OPENAI_API_KEY)
|
||||
.timeout(ofSeconds(60))
|
||||
.build();
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ public class ChatWithDocumentLiveTest {
|
|||
|
||||
Prompt prompt = promptTemplate.apply(variables);
|
||||
ChatLanguageModel chatModel = OpenAiChatModel.builder()
|
||||
.apiKey(Constants.OPEN_AI_KEY)
|
||||
.apiKey(Constants.OPENAI_API_KEY)
|
||||
.timeout(ofSeconds(60))
|
||||
.build();
|
||||
AiMessage aiMessage = chatModel.generate(prompt.toUserMessage())
|
||||
|
|
|
@ -22,7 +22,7 @@ public class ChatWithMemoryLiveTest {
|
|||
|
||||
@Test
|
||||
public void givenMemory_whenPrompted_thenValidResponse() {
|
||||
ChatLanguageModel model = OpenAiChatModel.withApiKey(Constants.OPEN_AI_KEY);
|
||||
ChatLanguageModel model = OpenAiChatModel.withApiKey(Constants.OPENAI_API_KEY);
|
||||
ChatMemory chatMemory = TokenWindowChatMemory.withMaxTokens(300, new OpenAiTokenizer(GPT_3_5_TURBO));
|
||||
|
||||
chatMemory.add(userMessage("Hello, my name is Kumar"));
|
||||
|
|
|
@ -7,6 +7,6 @@ public class Constants {
|
|||
* registering for free at (https://platform.openai.com/signup) and then by navigating
|
||||
* to "Create new secret key" page at (https://platform.openai.com/account/api-keys).
|
||||
*/
|
||||
public static String OPEN_AI_KEY = "demo"; //"<OPEN_AI_KEY>";
|
||||
public static String OPENAI_API_KEY = "<OPENAI_API_KEY>";
|
||||
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ public class PromptTemplatesLiveTest {
|
|||
Prompt prompt = promptTemplate.apply(variables);
|
||||
|
||||
ChatLanguageModel model = OpenAiChatModel.builder()
|
||||
.apiKey(Constants.OPEN_AI_KEY)
|
||||
.apiKey(Constants.OPENAI_API_KEY)
|
||||
.modelName(GPT_3_5_TURBO)
|
||||
.temperature(0.3)
|
||||
.build();
|
||||
|
|
|
@ -34,7 +34,7 @@ public class ServiceWithToolsLiveTest {
|
|||
@Test
|
||||
public void givenServiceWithTools_whenPrompted_thenValidResponse() {
|
||||
Assistant assistant = AiServices.builder(Assistant.class)
|
||||
.chatLanguageModel(OpenAiChatModel.withApiKey(Constants.OPEN_AI_KEY))
|
||||
.chatLanguageModel(OpenAiChatModel.withApiKey(Constants.OPENAI_API_KEY))
|
||||
.tools(new Calculator())
|
||||
.chatMemory(MessageWindowChatMemory.withMaxMessages(10))
|
||||
.build();
|
||||
|
|
Loading…
Reference in New Issue