From 8b849edbb8e926a31b9581e7bf111985d857783c Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Mon, 11 Nov 2024 11:36:32 +0100 Subject: [PATCH] LangChain4j: use demo for api-key value --- .../springboot/langchain4j/domain/LangChain4jModuleFactory.java | 2 +- .../langchain4j/domain/LangChain4jModuleFactoryTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/langchain4j/domain/LangChain4jModuleFactory.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/langchain4j/domain/LangChain4jModuleFactory.java index d4eb851560d..09dbe3d6efa 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/langchain4j/domain/LangChain4jModuleFactory.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/langchain4j/domain/LangChain4jModuleFactory.java @@ -36,7 +36,7 @@ public JHipsterModule buildModule(JHipsterModuleProperties properties) { .addDependency(GROUP_ID, OPEN_AI_ARTIFACT_ID, VERSION_SLUG) .and() .springMainProperties() - .set(LANGCHAIN4J_PROPERTY_API_KEY, propertyValue("${OPENAI_API_KEY}")) + .set(LANGCHAIN4J_PROPERTY_API_KEY, propertyValue("demo")) .comment(LANGCHAIN4J_PROPERTY_API_KEY, comment(API_KEY_DEMO_COMMENT)) .set(propertyKey("langchain4j.open-ai.chat-model.model-name"), propertyValue("gpt-4o-mini")) .set(propertyKey("langchain4j.open-ai.chat-model.log-requests"), propertyValue("true")) diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/langchain4j/domain/LangChain4jModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/langchain4j/domain/LangChain4jModuleFactoryTest.java index 77d40161737..b4d83f5ce08 100644 --- a/src/test/java/tech/jhipster/lite/generator/server/springboot/langchain4j/domain/LangChain4jModuleFactoryTest.java +++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/langchain4j/domain/LangChain4jModuleFactoryTest.java @@ -58,7 +58,7 @@ void shouldCreateModule() { open-ai: chat-model: # You can temporarily use 'demo' key, which is provided for free for demonstration purposes - api-key: ${OPENAI_API_KEY} + api-key: demo log-requests: 'true' log-responses: 'true' model-name: gpt-4o-mini