From 08bd54d078cc9f124eb3164bbec325ae17bfbdd5 Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Wed, 6 Dec 2023 09:18:36 +0200 Subject: [PATCH] REVERT - debug commit --- .github/workflows/build-pull-request.yml | 24 +++++++++---------- .../langchain4j/QuarkusAiServicesFactory.java | 8 +++++-- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-pull-request.yml b/.github/workflows/build-pull-request.yml index 2a501ce57..1d6e5e10f 100644 --- a/.github/workflows/build-pull-request.yml +++ b/.github/workflows/build-pull-request.yml @@ -44,18 +44,18 @@ jobs: java-version: ${{ matrix.java }} cache: 'maven' - - name: Build with Maven - run: mvn -B clean install -Dno-format - env: # note that secrets are not available when triggered by PR from a fork, so some tests will be skipped - PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }} - PINECONE_ENVIRONMENT: ${{ secrets.PINECONE_ENVIRONMENT }} - PINECONE_INDEX_NAME: ${{ secrets.PINECONE_INDEX_NAME }} - PINECONE_PROJECT_ID: ${{ secrets.PINECONE_PROJECT_ID }} +# - name: Build with Maven +# run: mvn -B clean install -Dno-format +# env: # note that secrets are not available when triggered by PR from a fork, so some tests will be skipped +# PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }} +# PINECONE_ENVIRONMENT: ${{ secrets.PINECONE_ENVIRONMENT }} +# PINECONE_INDEX_NAME: ${{ secrets.PINECONE_INDEX_NAME }} +# PINECONE_PROJECT_ID: ${{ secrets.PINECONE_PROJECT_ID }} - name: Build with Maven (Native) run: mvn -B install -Dnative -Dquarkus.native.container-build -Dnative.surefire.skip - env: # note that secrets are not available when triggered by PR from a fork, so some tests will be skipped - PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }} - PINECONE_ENVIRONMENT: ${{ secrets.PINECONE_ENVIRONMENT }} - PINECONE_INDEX_NAME: ${{ secrets.PINECONE_INDEX_NAME }} - PINECONE_PROJECT_ID: ${{ secrets.PINECONE_PROJECT_ID }} +# env: # note that secrets are not available when triggered by PR from a fork, so some tests will be skipped +# PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }} +# PINECONE_ENVIRONMENT: ${{ secrets.PINECONE_ENVIRONMENT }} +# PINECONE_INDEX_NAME: ${{ secrets.PINECONE_INDEX_NAME }} +# PINECONE_PROJECT_ID: ${{ secrets.PINECONE_PROJECT_ID }} diff --git a/core/runtime/src/main/java/io/quarkiverse/langchain4j/QuarkusAiServicesFactory.java b/core/runtime/src/main/java/io/quarkiverse/langchain4j/QuarkusAiServicesFactory.java index d37a5c340..222bf27d7 100644 --- a/core/runtime/src/main/java/io/quarkiverse/langchain4j/QuarkusAiServicesFactory.java +++ b/core/runtime/src/main/java/io/quarkiverse/langchain4j/QuarkusAiServicesFactory.java @@ -3,6 +3,7 @@ import static dev.langchain4j.exception.IllegalConfigurationException.illegalConfiguration; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; @@ -127,8 +128,11 @@ public T build() { } try { - return (T) Class.forName(classCreateInfo.getImplClassName(), true, Thread.currentThread() - .getContextClassLoader()).getConstructor(QuarkusAiServiceContext.class) + System.out.println(context.getClass().getName()); + Class implClass = Class.forName(classCreateInfo.getImplClassName(), true, Thread.currentThread() + .getContextClassLoader()); + System.out.println(Arrays.toString(implClass.getConstructors())); + return (T) implClass.getConstructor(QuarkusAiServiceContext.class) .newInstance(((QuarkusAiServiceContext) context)); } catch (Exception e) { throw new IllegalStateException("Unable to create class '" + classCreateInfo.getImplClassName(), e);