marcushellberg / java-ai-playground

MIT License
269 stars 88 forks source link

Quarkus version? #20

Open edeandrea opened 1 day ago

edeandrea commented 1 day ago

Would you be interested in having a Quarkus branch? I'd be open to working on it if so.

edeandrea commented 1 day ago

I think I've got most of this working with Quarkus, but unfortunately I really don't know much about Vaadin. Might you be able to help out?

When I run ./mvnw clean package -Pproduction I am getting:

╰─ ./mvnw clean package -Dquarkus.profile=ollama -Pproduction
[INFO] Scanning for projects...
[INFO] 
[INFO] ----------------< org.vaadin.marcus:java-ai-playground >----------------
[INFO] Building java-ai-playground 1.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- clean:3.2.0:clean (default-clean) @ java-ai-playground ---
[INFO] Deleting /Users/edeandre/workspaces/IntelliJ/java-ai-playground/target
[INFO] 
[INFO] --- resources:3.3.1:resources (default-resources) @ java-ai-playground ---
[INFO] Copying 4 resources from src/main/resources to target/classes
[INFO] 
[INFO] --- quarkus:3.15.1:generate-code (default) @ java-ai-playground ---
[INFO] 
[INFO] >>> vaadin:24.4.13:prepare-frontend (default) > :configure @ java-ai-playground >>>
[INFO] 
[INFO] --- vaadin:24.4.13:configure (configure) @ java-ai-playground ---
[INFO] Reflections took 649 ms to scan 422 urls, producing 14613 keys and 70030 values
[INFO] 
[INFO] <<< vaadin:24.4.13:prepare-frontend (default) < :configure @ java-ai-playground <<<
[INFO] 
[INFO] 
[INFO] --- vaadin:24.4.13:prepare-frontend (default) @ java-ai-playground ---
[INFO] Reflections took 480 ms to scan 422 urls, producing 14613 keys and 70030 values
[INFO] Reflections took 478 ms to scan 422 urls, producing 14613 keys and 70030 values
[INFO] Reflections took 369 ms to scan 422 urls, producing 14613 keys and 70030 values
[INFO] Reflections took 359 ms to scan 422 urls, producing 14613 keys and 70030 values
[INFO] Visited 106 classes. Took 74 ms.
[INFO] Copying frontend resources from jar files ...
[INFO] Visited 421 resources. Took 154 ms.
[INFO] 
[INFO] --- compiler:3.13.0:compile (default-compile) @ java-ai-playground ---
[INFO] Recompiling the module because of changed source code.
[INFO] Compiling 13 source files with javac [debug release 17] to target/classes
[INFO] /Users/edeandre/workspaces/IntelliJ/java-ai-playground/src/main/java/org/vaadin/marcus/langchain4j/LangChain4jConfig.java: /Users/edeandre/workspaces/IntelliJ/java-ai-playground/src/main/java/org/vaadin/marcus/langchain4j/LangChain4jConfig.java uses unchecked or unsafe operations.
[INFO] /Users/edeandre/workspaces/IntelliJ/java-ai-playground/src/main/java/org/vaadin/marcus/langchain4j/LangChain4jConfig.java: Recompile with -Xlint:unchecked for details.
[INFO] 
[INFO] >>> vaadin:24.4.13:build-frontend (default) > :configure @ java-ai-playground >>>
[INFO] 
[INFO] --- vaadin:24.4.13:configure (configure) @ java-ai-playground ---
[INFO] Reflections took 452 ms to scan 422 urls, producing 14617 keys and 70042 values
[INFO] 
[INFO] <<< vaadin:24.4.13:build-frontend (default) < :configure @ java-ai-playground <<<
[INFO] 
[INFO] 
[INFO] --- vaadin:24.4.13:build-frontend (default) @ java-ai-playground ---
[INFO] Reflections took 422 ms to scan 422 urls, producing 14617 keys and 70042 values
[INFO] Reflections took 313 ms to scan 422 urls, producing 14617 keys and 70042 values
[INFO] Scanning classes to find frontend configurations and dependencies...
[INFO] Visited 8246 classes. Took 2235 ms.
[INFO] Checking if a production mode bundle build is needed
[INFO] Frontend build requested.
[INFO] Skipping `npm install` because the frontend packages are already installed in the folder '/Users/edeandre/workspaces/IntelliJ/java-ai-playground/node_modules' and the hash in the file '/Users/edeandre/workspaces/IntelliJ/java-ai-playground/node_modules/.vaadin/vaadin.json' is the same as in 'package.json'
WARN (tsgen) <ModelPlugin>: Component has no properties: io.smallrye.mutiny.Multi
[INFO] Copying frontend resources from jar files ...
[INFO] Visited 421 resources. Took 83 ms.
[INFO] Running Vite ...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  19.426 s
[INFO] Finished at: 2024-10-30T15:40:02-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.vaadin:vaadin-maven-plugin:24.4.13:build-frontend (default) on project java-ai-playground: Execution default of goal com.vaadin:vaadin-maven-plugin:24.4.13:build-frontend failed: Vite process exited with non-zero exit code.
[ERROR] Stderr: 'vite v5.4.6 building for production...
[ERROR] transforming...
[ERROR] src/main/frontend/views/@index.tsx(24,41): error TS2345: Argument of type 'Dispatch<SetStateAction<BookingDetails[]>>' is not assignable to parameter of type '(value: (BookingDetails | undefined)[] | undefined) => void | PromiseLike<void>'.
[ERROR]   Types of parameters 'value' and 'value' are incompatible.
[ERROR]     Type '(BookingDetails | undefined)[] | undefined' is not assignable to type 'SetStateAction<BookingDetails[]>'.
[ERROR]       Type 'undefined' is not assignable to type 'SetStateAction<BookingDetails[]>'.
[ERROR] src/main/frontend/views/@index.tsx(48,8): error TS2339: Property 'onNext' does not exist on type 'Promise<Multi | undefined>'.
[ERROR] src/main/frontend/views/@index.tsx(48,15): error TS7006: Parameter 'token' implicitly has an 'any' type.
[ERROR] ✓ 455 modules transformed.
[ERROR] vite v5.4.6 building for production...
[ERROR] transforming...
[ERROR] src/main/frontend/views/@index.tsx(24,41): error TS2345: Argument of type 'Dispatch<SetStateAction<BookingDetails[]>>' is not assignable to parameter of type '(value: (BookingDetails | undefined)[] | undefined) => void | PromiseLike<void>'.
[ERROR]   Types of parameters 'value' and 'value' are incompatible.
[ERROR]     Type '(BookingDetails | undefined)[] | undefined' is not assignable to type 'SetStateAction<BookingDetails[]>'.
[ERROR]       Type 'undefined' is not assignable to type 'SetStateAction<BookingDetails[]>'.
[ERROR] src/main/frontend/views/@index.tsx(48,8): error TS2339: Property 'onNext' does not exist on type 'Promise<Multi | undefined>'.
[ERROR] src/main/frontend/views/@index.tsx(48,15): error TS7006: Parameter 'token' implicitly has an 'any' type.
[ERROR] ✓ 455 modules transformed.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

I'm happy to create a draft PR, that way you have something you can check out and try.

edeandrea commented 1 day ago

See https://github.com/edeandrea/java-ai-playground/tree/quarkus

edeandrea commented 15 hours ago

I think I'm getting somewhere...has to do with Nullability I think.