Skip to content

Commit

Permalink
Fixing Nomic Spelling/Fixing LLM Request Values
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaland committed Nov 10, 2024
1 parent 40f92c2 commit e134739
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Backend includes the ability to dynamically create Assistants, Rag Connections,
"host": "my-weaviate-instance.svc:8080",
"apiKey" : "ABCDE12345"
},
"embeddingType": "noimc",
"embeddingType": "nomic",
"name": "Example Rag Connection",
"description": "Example of a rag connection"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class EmbeddingModelFactory {

@Inject
NomicLocalEmbeddingModelClient nomicEmbeddingClient;
public static final String NOMIC_EMBEDDING = "noimc";
public static final String NOMIC_EMBEDDING = "nomic";

public static final String DEFAULT_EMBEDDING = NOMIC_EMBEDDING;

Expand Down
40 changes: 36 additions & 4 deletions src/main/java/com/redhat/composer/model/request/LLMRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

public class LLMRequest {

private String name;
private String description;

private String modelType = StreamingModelFactory.DEFAULT_MODEL;

private String url;
Expand All @@ -18,13 +21,31 @@ public class LLMRequest {
public LLMRequest() {
}

public LLMRequest(String modelType, String url, String apiKey, String modelName) {
public LLMRequest(String name, String description, String modelType, String url, String apiKey, String modelName) {
this.name = name;
this.description = description;
this.modelType = modelType;
this.url = url;
this.apiKey = apiKey;
this.modelName = modelName;
}

public String getName() {
return this.name;
}

public void setName(String name) {
this.name = name;
}

public String getDescription() {
return this.description;
}

public void setDescription(String description) {
this.description = description;
}

public String getModelType() {
return this.modelType;
}
Expand Down Expand Up @@ -57,6 +78,16 @@ public void setModelName(String modelName) {
this.modelName = modelName;
}

public LLMRequest name(String name) {
setName(name);
return this;
}

public LLMRequest description(String description) {
setDescription(description);
return this;
}

public LLMRequest modelType(String modelType) {
setModelType(modelType);
return this;
Expand Down Expand Up @@ -84,18 +115,19 @@ public boolean equals(Object o) {

@Override
public int hashCode() {
return Objects.hash(modelType, url, apiKey, modelName);
return Objects.hash(name, description, modelType, url, apiKey, modelName);
}

@Override
public String toString() {
return "{" +
" modelType='" + getModelType() + "'" +
" name='" + getName() + "'" +
", description='" + getDescription() + "'" +
", modelType='" + getModelType() + "'" +
", url='" + getUrl() + "'" +
", apiKey='" + getApiKey() + "'" +
", modelName='" + getModelName() + "'" +
"}";
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ public List<RetrieverConnectionEntity> getRetrieverConnections() {

public LLMConnectionEntity createLLMConnection(LLMRequest request) {
LLMConnectionEntity entity = new LLMConnectionEntity();
entity.setName(request.getName());
entity.setDescription(request.getDescription());
entity.setUrl(request.getUrl());
entity.setApiKey(request.getApiKey());
entity.setModelName(request.getModelName());
Expand Down

0 comments on commit e134739

Please sign in to comment.