Skip to content

Commit

Permalink
Adding a little more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaland committed Oct 26, 2024
1 parent e79e693 commit 36ded56
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.redhat.composer.config.llm.models.streaming;

import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.jboss.logging.Logger;

import com.redhat.composer.config.retriever.contentRetriever.WeaviateContentRetrieverClient;
import com.redhat.composer.model.request.LLMRequest;

import dev.langchain4j.model.chat.StreamingChatLanguageModel;
Expand All @@ -13,6 +15,7 @@
@ApplicationScoped
public class OpenAIStreamingModel extends StreamingBaseModel {

Logger log = Logger.getLogger(WeaviateContentRetrieverClient.class);

@ConfigProperty( name = "openai.default.url")
private String mistralDefaultUrl;
Expand All @@ -28,6 +31,7 @@ public class OpenAIStreamingModel extends StreamingBaseModel {


public StreamingChatLanguageModel getChatModel(LLMRequest request) {
log.info("Attempting to create OpenAI Streaming Chat Model at: " + request.getUrl() + " with model name: " + request.getModelName());
OpenAiStreamingChatModelBuilder builder = OpenAiStreamingChatModel.builder();
builder.baseUrl(request.getUrl() == null ? mistralDefaultUrl : request.getUrl());
builder.apiKey(request.getApiKey() == null ? mistralDefaultApiKey : request.getApiKey());
Expand Down

0 comments on commit 36ded56

Please sign in to comment.