-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding default assistants for doing genearl c-suite items (#13)
Co-authored-by: Jamie Land <[email protected]>
- Loading branch information
1 parent
cafd79a
commit 8ea67e9
Showing
10 changed files
with
311 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/main/java/com/redhat/composer/config/llm/aiservices/GraniteAiService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.redhat.composer.config.llm.aiservices; | ||
|
||
import dev.langchain4j.service.SystemMessage; | ||
import dev.langchain4j.service.TokenStream; | ||
import dev.langchain4j.service.UserMessage; | ||
import dev.langchain4j.service.V; | ||
import io.smallrye.mutiny.Multi; | ||
|
||
|
||
/** | ||
* Mistral7BAiService. | ||
*/ | ||
@SuppressWarnings("LineLengthCheck") | ||
public interface GraniteAiService extends BaseAiService { | ||
|
||
// Note: Handling history is a little more complex than just passing it as a string | ||
// See: https://www.ibm.com/granite/docs/models/granite/#using-the-multi-round-chat-example-finance | ||
static final String userMessage = """ | ||
<|start_of_role|>system<|end_of_role|>{{systemMessage}}<|end_of_text|> | ||
{context} | ||
<|start_of_role|>user<|end_of_role|>{{input}}<|end_of_text|> | ||
<|start_of_role|>assistant<|end_of_role|> | ||
"""; | ||
|
||
/** | ||
* Returns TokenStream given input. | ||
* @param context Context information such as chat history and source information | ||
* @param input User Message | ||
* @return the TokenStream | ||
*/ | ||
@SystemMessage("{{systemMessage}}") | ||
@UserMessage(userMessage) | ||
TokenStream chatToken(@V("context") String context, @V("input") String input, @V("systemMessage") String systemMessage); | ||
|
||
|
||
/** | ||
* Returns a Multi of String given input. | ||
* @param context Context information such as chat history and source information | ||
* @param input User Message | ||
* @return the Multi of String | ||
*/ | ||
@SystemMessage("{{systemMessage}}") | ||
@UserMessage(userMessage) | ||
Multi<String> chatStream(@V("context") String context, @V("input") String input, @V("systemMessage") String systemMessage); | ||
|
||
} |
44 changes: 0 additions & 44 deletions
44
src/main/java/com/redhat/composer/config/llm/aiservices/HealthCareService.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.