Class CohereAIWrapper

java.lang.Object
com.intellijava.core.wrappers.CohereAIWrapper
All Implemented Interfaces:
LanguageModelInterface

public class CohereAIWrapper extends Object implements LanguageModelInterface
Wrapper for the Cohere API models.
Author:
github.com/Barqawiz
  • Constructor Details

    • CohereAIWrapper

      public CohereAIWrapper(String apiKey)
      CohereAIWrapper constructor with the API key
      Parameters:
      apiKey - cohere API key, generate if from your account.
  • Method Details

    • generateText

      public BaseRemoteModel generateText(Map<String,Object> params) throws IOException
      Generate text from remote large language model based on the received prompt.
      Specified by:
      generateText in interface LanguageModelInterface
      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.