Class OCICohereChatModel

java.lang.Object
org.springframework.ai.oci.cohere.OCICohereChatModel
All Implemented Interfaces:
ChatModel, StreamingChatModel, Model<Prompt,ChatResponse>, StreamingModel<Prompt,ChatResponse>

public class OCICohereChatModel extends Object implements ChatModel
ChatModel implementation that uses the OCI GenAI Chat API.
Since:
1.0.0
Author:
Anders Swanson
  • Constructor Details

    • OCICohereChatModel

      public OCICohereChatModel(com.oracle.bmc.generativeaiinference.GenerativeAiInference genAi, OCICohereChatOptions options)
    • OCICohereChatModel

      public OCICohereChatModel(com.oracle.bmc.generativeaiinference.GenerativeAiInference genAi, OCICohereChatOptions options, io.micrometer.observation.ObservationRegistry observationRegistry)
  • Method Details

    • call

      public ChatResponse call(Prompt prompt)
      Description copied from interface: Model
      Executes a method call to the AI model.
      Specified by:
      call in interface ChatModel
      Specified by:
      call in interface Model<Prompt,ChatResponse>
      Parameters:
      prompt - the request object to be sent to the AI model
      Returns:
      the response from the AI model
    • getDefaultOptions

      public ChatOptions getDefaultOptions()
      Specified by:
      getDefaultOptions in interface ChatModel
    • setObservationConvention

      public void setObservationConvention(ChatModelObservationConvention observationConvention)
      Use the provided convention for reporting observation data
      Parameters:
      observationConvention - The provided convention