Package com.intellijava.core.wrappers
Class CohereAIWrapper
java.lang.Object
com.intellijava.core.wrappers.CohereAIWrapper
- All Implemented Interfaces:
LanguageModelInterface
Wrapper for the Cohere API models.
- Author:
- github.com/Barqawiz
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongenerateText
(Map<String, Object> params) Generate text from remote large language model based on the received prompt.
-
Constructor Details
-
CohereAIWrapper
CohereAIWrapper constructor with the API key- Parameters:
apiKey
- cohere API key, generate if from your account.
-
-
Method Details
-
generateText
Generate text from remote large language model based on the received prompt.- Specified by:
generateText
in interfaceLanguageModelInterface
- Parameters:
params
- key and value for the API parameters model the model name, either medium or xlarge. prompt text of the required action or the question. temperature higher values means more risks and creativity. max_tokens maximum size of the model input and output.- Returns:
- BaseRemoteModel for model response
- Throws:
IOException
- if there is an error when connecting to the OpenAI API.
-