Skip to content

Commit

Permalink
Merge pull request #347 from holly-cummins/main
Browse files Browse the repository at this point in the history
Change capitalisation of Langchain4j to be consistent
  • Loading branch information
cescoffier authored Mar 4, 2024
2 parents 6ecde8e + c14ea9b commit 0a86dac
Show file tree
Hide file tree
Showing 69 changed files with 261 additions and 261 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package io.quarkiverse.langchain4j.bam.deployment;

import static io.quarkiverse.langchain4j.deployment.Langchain4jDotNames.CHAT_MODEL;
import static io.quarkiverse.langchain4j.deployment.Langchain4jDotNames.EMBEDDING_MODEL;
import static io.quarkiverse.langchain4j.deployment.Langchain4jDotNames.STREAMING_CHAT_MODEL;
import static io.quarkiverse.langchain4j.deployment.LangChain4jDotNames.CHAT_MODEL;
import static io.quarkiverse.langchain4j.deployment.LangChain4jDotNames.EMBEDDING_MODEL;
import static io.quarkiverse.langchain4j.deployment.LangChain4jDotNames.STREAMING_CHAT_MODEL;

import java.util.List;

Expand All @@ -12,7 +12,7 @@

import io.quarkiverse.langchain4j.ModelName;
import io.quarkiverse.langchain4j.bam.runtime.BamRecorder;
import io.quarkiverse.langchain4j.bam.runtime.config.Langchain4jBamConfig;
import io.quarkiverse.langchain4j.bam.runtime.config.LangChain4jBamConfig;
import io.quarkiverse.langchain4j.deployment.items.ChatModelProviderCandidateBuildItem;
import io.quarkiverse.langchain4j.deployment.items.EmbeddingModelProviderCandidateBuildItem;
import io.quarkiverse.langchain4j.deployment.items.SelectedChatModelProviderBuildItem;
Expand All @@ -39,7 +39,7 @@ FeatureBuildItem feature() {
@BuildStep
public void providerCandidates(BuildProducer<ChatModelProviderCandidateBuildItem> chatProducer,
BuildProducer<EmbeddingModelProviderCandidateBuildItem> embeddingProducer,
Langchain4jBamBuildConfig config) {
LangChain4jBamBuildConfig config) {

if (config.chatModel().enabled().isEmpty() || config.chatModel().enabled().get()) {
chatProducer.produce(new ChatModelProviderCandidateBuildItem(PROVIDER));
Expand All @@ -56,7 +56,7 @@ public void providerCandidates(BuildProducer<ChatModelProviderCandidateBuildItem
void generateBeans(BamRecorder recorder,
List<SelectedChatModelProviderBuildItem> selectedChatItem,
List<SelectedEmbeddingModelCandidateBuildItem> selectedEmbedding,
Langchain4jBamConfig config,
LangChain4jBamConfig config,
BuildProducer<SyntheticBeanBuildItem> beanProducer) {

for (var selected : selectedChatItem) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

@ConfigRoot(phase = BUILD_TIME)
@ConfigMapping(prefix = "quarkus.langchain4j.bam")
public interface Langchain4jBamBuildConfig {
public interface LangChain4jBamBuildConfig {

/**
* Chat model related settings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import io.quarkiverse.langchain4j.bam.Message;
import io.quarkiverse.langchain4j.bam.Parameters;
import io.quarkiverse.langchain4j.bam.TextGenerationRequest;
import io.quarkiverse.langchain4j.bam.runtime.config.Langchain4jBamConfig;
import io.quarkiverse.langchain4j.bam.runtime.config.LangChain4jBamConfig;
import io.quarkus.test.QuarkusUnitTest;

public class AiChatServiceTest {
Expand Down Expand Up @@ -66,7 +66,7 @@ interface NewAIService {
NewAIService service;

@Inject
Langchain4jBamConfig langchain4jBamConfig;
LangChain4jBamConfig langchain4jBamConfig;

@Test
void chat() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import io.quarkiverse.langchain4j.bam.Message;
import io.quarkiverse.langchain4j.bam.Parameters;
import io.quarkiverse.langchain4j.bam.TextGenerationRequest;
import io.quarkiverse.langchain4j.bam.runtime.config.Langchain4jBamConfig;
import io.quarkiverse.langchain4j.bam.runtime.config.LangChain4jBamConfig;
import io.quarkus.test.QuarkusUnitTest;
import io.smallrye.mutiny.Multi;

Expand Down Expand Up @@ -67,7 +67,7 @@ interface NewAIService {
NewAIService service;

@Inject
Langchain4jBamConfig langchain4jBamConfig;
LangChain4jBamConfig langchain4jBamConfig;

@Test
void chat() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import io.quarkiverse.langchain4j.bam.Message;
import io.quarkiverse.langchain4j.bam.Parameters;
import io.quarkiverse.langchain4j.bam.TextGenerationRequest;
import io.quarkiverse.langchain4j.bam.runtime.config.Langchain4jBamConfig;
import io.quarkiverse.langchain4j.bam.runtime.config.LangChain4jBamConfig;
import io.quarkus.test.QuarkusUnitTest;

public class AllPropertiesTest {
Expand Down Expand Up @@ -59,7 +59,7 @@ public class AllPropertiesTest {
.setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class).addClass(WireMockUtil.class));

@Inject
Langchain4jBamConfig langchain4jBamConfig;
LangChain4jBamConfig langchain4jBamConfig;

@Inject
ChatLanguageModel model;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import io.quarkiverse.langchain4j.bam.Message;
import io.quarkiverse.langchain4j.bam.Parameters;
import io.quarkiverse.langchain4j.bam.TextGenerationRequest;
import io.quarkiverse.langchain4j.bam.runtime.config.Langchain4jBamConfig;
import io.quarkiverse.langchain4j.bam.runtime.config.LangChain4jBamConfig;
import io.quarkus.test.QuarkusUnitTest;

public class DefaultPropertiesTest {
Expand All @@ -39,7 +39,7 @@ public class DefaultPropertiesTest {
.setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class).addClass(WireMockUtil.class));

@Inject
Langchain4jBamConfig langchain4jBamConfig;
LangChain4jBamConfig langchain4jBamConfig;

@Inject
ChatLanguageModel model;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import io.quarkiverse.langchain4j.bam.BamStreamingChatModel;
import io.quarkiverse.langchain4j.bam.runtime.config.ChatModelConfig;
import io.quarkiverse.langchain4j.bam.runtime.config.EmbeddingModelConfig;
import io.quarkiverse.langchain4j.bam.runtime.config.Langchain4jBamConfig;
import io.quarkiverse.langchain4j.bam.runtime.config.LangChain4jBamConfig;
import io.quarkiverse.langchain4j.runtime.NamedModelUtil;
import io.quarkus.runtime.annotations.Recorder;
import io.smallrye.config.ConfigValidationException;
Expand All @@ -26,8 +26,8 @@ public class BamRecorder {

private static final String DUMMY_KEY = "dummy";

public Supplier<ChatLanguageModel> chatModel(Langchain4jBamConfig runtimeConfig, String modelName) {
Langchain4jBamConfig.BamConfig bamConfig = correspondingBamConfig(runtimeConfig, modelName);
public Supplier<ChatLanguageModel> chatModel(LangChain4jBamConfig runtimeConfig, String modelName) {
LangChain4jBamConfig.BamConfig bamConfig = correspondingBamConfig(runtimeConfig, modelName);

if (bamConfig.enableIntegration()) {
ChatModelConfig chatModelConfig = bamConfig.chatModel();
Expand Down Expand Up @@ -79,8 +79,8 @@ public ChatLanguageModel get() {
}
}

public Supplier<StreamingChatLanguageModel> streamingChatModel(Langchain4jBamConfig runtimeConfig, String modelName) {
Langchain4jBamConfig.BamConfig bamConfig = correspondingBamConfig(runtimeConfig, modelName);
public Supplier<StreamingChatLanguageModel> streamingChatModel(LangChain4jBamConfig runtimeConfig, String modelName) {
LangChain4jBamConfig.BamConfig bamConfig = correspondingBamConfig(runtimeConfig, modelName);

if (bamConfig.enableIntegration()) {
ChatModelConfig chatModelConfig = bamConfig.chatModel();
Expand Down Expand Up @@ -132,8 +132,8 @@ public StreamingChatLanguageModel get() {
}
}

public Supplier<EmbeddingModel> embeddingModel(Langchain4jBamConfig runtimeConfig, String modelName) {
Langchain4jBamConfig.BamConfig bamConfig = correspondingBamConfig(runtimeConfig, modelName);
public Supplier<EmbeddingModel> embeddingModel(LangChain4jBamConfig runtimeConfig, String modelName) {
LangChain4jBamConfig.BamConfig bamConfig = correspondingBamConfig(runtimeConfig, modelName);

if (bamConfig.enableIntegration()) {
EmbeddingModelConfig embeddingModelConfig = bamConfig.embeddingModel();
Expand Down Expand Up @@ -168,8 +168,8 @@ public EmbeddingModel get() {
}
}

private Langchain4jBamConfig.BamConfig correspondingBamConfig(Langchain4jBamConfig runtimeConfig, String modelName) {
Langchain4jBamConfig.BamConfig bamConfig;
private LangChain4jBamConfig.BamConfig correspondingBamConfig(LangChain4jBamConfig runtimeConfig, String modelName) {
LangChain4jBamConfig.BamConfig bamConfig;
if (NamedModelUtil.isDefault(modelName)) {
bamConfig = runtimeConfig.defaultConfig();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

@ConfigRoot(phase = RUN_TIME)
@ConfigMapping(prefix = "quarkus.langchain4j.bam")
public interface Langchain4jBamConfig {
public interface LangChain4jBamConfig {

/**
* Default model config.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
import dev.langchain4j.model.chat.DisabledChatLanguageModel;
import dev.langchain4j.model.chat.DisabledStreamingChatLanguageModel;
import dev.langchain4j.model.embedding.DisabledEmbeddingModel;
import io.quarkiverse.langchain4j.bam.runtime.config.Langchain4jBamConfig;
import io.quarkiverse.langchain4j.bam.runtime.config.Langchain4jBamConfig.BamConfig;
import io.quarkiverse.langchain4j.bam.runtime.config.LangChain4jBamConfig;
import io.quarkiverse.langchain4j.bam.runtime.config.LangChain4jBamConfig.BamConfig;
import io.quarkiverse.langchain4j.runtime.NamedModelUtil;

class DisabledModelsBamRecorderTest {

Langchain4jBamConfig config = mock(Langchain4jBamConfig.class);
LangChain4jBamConfig config = mock(LangChain4jBamConfig.class);
BamConfig defaultConfig = mock(BamConfig.class);
BamRecorder recorder = new BamRecorder();

Expand Down
Loading

0 comments on commit 0a86dac

Please sign in to comment.