Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Introducing a facade API : (#53)" #68

Merged
merged 2 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ buildNumber.properties
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath
nb-configuration.xml

.idea


8 changes: 3 additions & 5 deletions examples/glassfish-car-booking/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,10 @@
<version>${jakarta.jakartaee-api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.smallrye.llm</groupId>
<artifactId>mp-ai-api</artifactId>
</dependency>
<dependency>
<groupId>io.smallrye.llm</groupId>
<artifactId>smallrye-llm-langchain4j-portable-extension</artifactId>
<version>1.0.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>jakarta.enterprise</groupId>
Expand Down Expand Up @@ -69,6 +66,7 @@
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j</artifactId>
<version>${dev.langchain4j.version}</version>
</dependency>
<dependency>
<groupId>dev.langchain4j</groupId>
Expand All @@ -90,7 +88,7 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<scope>runtime</scope>
<version>2.0.16</version>
<version>2.0.9</version>
</dependency>
</dependencies>
<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import java.util.Map;
import java.util.stream.Collectors;

import org.eclipse.microprofile.ai.llm.Tool;

import jakarta.enterprise.context.ApplicationScoped;

import dev.langchain4j.agent.tool.Tool;
import lombok.extern.java.Log;

@ApplicationScoped
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package io.jefrajames.booking;

import org.eclipse.microprofile.ai.llm.RegisterAIService;
import org.eclipse.microprofile.ai.llm.SystemMessage;
import dev.langchain4j.service.SystemMessage;
import io.smallrye.llm.spi.RegisterAIService;

import java.time.temporal.ChronoUnit;

@SuppressWarnings("CdiManagedBeanInconsistencyInspection")
@RegisterAIService(tools = BookingService.class, chatMemoryMaxMessages = 10, chatLanguageModelName = "chat-model")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package io.jefrajames.booking;

import org.eclipse.microprofile.ai.llm.RegisterAIService;
import org.eclipse.microprofile.ai.llm.SystemMessage;
import org.eclipse.microprofile.ai.llm.UserMessage;
import org.eclipse.microprofile.ai.llm.V;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.V;
import io.smallrye.llm.spi.RegisterAIService;

@SuppressWarnings("CdiManagedBeanInconsistencyInspection")
@RegisterAIService(chatMemoryMaxMessages = 5,

chatLanguageModelName = "chat-model")
public interface FraudAiService {

Expand Down
12 changes: 5 additions & 7 deletions examples/helidon-car-booking-portable-ext/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,39 @@
<name>SmallRye LLM Examples: Helidon Car Booking Portable Extension</name>

<properties>
<version.io.helidon>4.0.7</version.io.helidon>
<mainClass>io.helidon.Main</mainClass>
<dev.langchain4j.version>0.34.0</dev.langchain4j.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.helidon</groupId>
<artifactId>helidon-bom</artifactId>
<version>${version.io.helidon}</version>
<version>4.0.7</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.helidon</groupId>
<artifactId>helidon-dependencies</artifactId>
<version>${version.io.helidon}</version>
<version>4.0.7</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>io.smallrye.llm</groupId>
<artifactId>mp-ai-api</artifactId>
</dependency>
<dependency>
<groupId>io.smallrye.llm</groupId>
<artifactId>smallrye-llm-langchain4j-portable-extension</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.smallrye.llm</groupId>
<artifactId>smallrye-llm-langchain4j-config-mpconfig</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<!-- Adds all features available in MicroProfile -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

import java.time.temporal.ChronoUnit;

import org.eclipse.microprofile.ai.llm.RegisterAIService;
import org.eclipse.microprofile.ai.llm.SystemMessage;
import org.eclipse.microprofile.faulttolerance.Fallback;
import org.eclipse.microprofile.faulttolerance.Retry;
import org.eclipse.microprofile.faulttolerance.Timeout;

import dev.langchain4j.service.SystemMessage;
import io.smallrye.llm.spi.RegisterAIService;

@SuppressWarnings("CdiManagedBeanInconsistencyInspection")
@RegisterAIService(tools = BookingService.class, chatMemoryMaxMessages = 10, chatLanguageModelName = "chat-model")
public interface ChatAiService {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@

import java.time.temporal.ChronoUnit;

import org.eclipse.microprofile.ai.llm.RegisterAIService;
import org.eclipse.microprofile.ai.llm.SystemMessage;
import org.eclipse.microprofile.ai.llm.UserMessage;
import org.eclipse.microprofile.ai.llm.V;
import org.eclipse.microprofile.faulttolerance.Fallback;
import org.eclipse.microprofile.faulttolerance.Retry;
import org.eclipse.microprofile.faulttolerance.Timeout;

import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.V;
import io.smallrye.llm.spi.RegisterAIService;

@SuppressWarnings("CdiManagedBeanInconsistencyInspection")
@RegisterAIService(chatMemoryMaxMessages = 5, chatLanguageModelName = "chat-model")
@RegisterAIService(chatMemoryMaxMessages = 5,

chatLanguageModelName = "chat-model")
public interface FraudAiService {

@SystemMessage("""
Expand Down
12 changes: 5 additions & 7 deletions examples/helidon-car-booking/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,39 @@
<name>SmallRye LLM Examples: Helidon Car Booking</name>

<properties>
<version.io.helidon>4.0.7</version.io.helidon>
<mainClass>io.helidon.Main</mainClass>
<dev.langchain4j.version>0.34.0</dev.langchain4j.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.helidon</groupId>
<artifactId>helidon-bom</artifactId>
<version>${version.io.helidon}</version>
<version>4.0.7</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.helidon</groupId>
<artifactId>helidon-dependencies</artifactId>
<version>${version.io.helidon}</version>
<version>4.0.7</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>io.smallrye.llm</groupId>
<artifactId>mp-ai-api</artifactId>
</dependency>
<dependency>
<groupId>io.smallrye.llm</groupId>
<artifactId>smallrye-llm-langchain4j-buildcompatible-extension</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.smallrye.llm</groupId>
<artifactId>smallrye-llm-langchain4j-config-mpconfig</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<!-- Adds all features available in MicroProfile -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

import jakarta.enterprise.context.ApplicationScoped;

import org.eclipse.microprofile.ai.llm.Tool;

import dev.langchain4j.agent.tool.Tool;
import lombok.extern.java.Log;

@ApplicationScoped
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

import java.time.temporal.ChronoUnit;

import org.eclipse.microprofile.ai.llm.RegisterAIService;
import org.eclipse.microprofile.ai.llm.SystemMessage;
import org.eclipse.microprofile.faulttolerance.Fallback;
import org.eclipse.microprofile.faulttolerance.Retry;
import org.eclipse.microprofile.faulttolerance.Timeout;

import dev.langchain4j.service.SystemMessage;
import io.smallrye.llm.spi.RegisterAIService;

@SuppressWarnings("CdiManagedBeanInconsistencyInspection")
@RegisterAIService(tools = BookingService.class, chatMemoryMaxMessages = 10, chatLanguageModelName = "chat-model")
public interface ChatAiService {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

import java.time.temporal.ChronoUnit;

import org.eclipse.microprofile.ai.llm.RegisterAIService;
import org.eclipse.microprofile.ai.llm.SystemMessage;
import org.eclipse.microprofile.ai.llm.UserMessage;
import org.eclipse.microprofile.ai.llm.V;
import org.eclipse.microprofile.faulttolerance.Fallback;
import org.eclipse.microprofile.faulttolerance.Retry;
import org.eclipse.microprofile.faulttolerance.Timeout;

import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.V;
import io.smallrye.llm.spi.RegisterAIService;

@SuppressWarnings("CdiManagedBeanInconsistencyInspection")
@RegisterAIService(chatMemoryMaxMessages = 5,

Expand Down
4 changes: 2 additions & 2 deletions examples/liberty-car-booking/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ These are the steps to run this service.
## Application requirements:
- JDK 17 and higher
- Maven 3.9.9 and higher
- LangChain4j 0.35.0 or higher.
- LangChain4j 0.33.0 or higher.
- Testing against GPT 3.5 and 4.0 on a dedicated Azure instance (to be customized in your context).

Then you can access the application through the browser of your choice.
Expand Down Expand Up @@ -39,7 +39,7 @@ To package the application in JVM mode run: `mvn package`.

## Configuration

All configuration is centralized in `microprofile-config.properties` (found is `resources\META-INF` folder) and can be redefined using environment variables.
All configuration is centralized in `microprofile-config.properties`(found is `resources\META-INF` folder) and can be redefined using environment variables.

## Running the application

Expand Down
Loading