Interface ModelClient<TReq extends ModelRequest<?>,TRes extends ModelResponse<?>>

Type Parameters:
TReq - the generic type of the request to the AI model
TRes - the generic type of the response from the AI model
All Known Subinterfaces:
ChatClient, EmbeddingClient, ImageClient
All Known Implementing Classes:
AbstractEmbeddingClient, AzureOpenAiChatClient, AzureOpenAiEmbeddingClient, BedrockAnthropicChatClient, BedrockCohereChatClient, BedrockCohereEmbeddingClient, BedrockLlama2ChatClient, BedrockTitanChatClient, BedrockTitanEmbeddingClient, HuggingfaceChatClient, MistralAiChatClient, MistralAiEmbeddingClient, OllamaChatClient, OllamaEmbeddingClient, OpenAiAudioTranscriptionClient, OpenAiChatClient, OpenAiEmbeddingClient, OpenAiImageClient, PostgresMlEmbeddingClient, StabilityAiImageClient, TransformersEmbeddingClient, VertexAiGeminiChatClient, VertexAiPaLm2ChatClient, VertexAiPaLm2EmbeddingClient

public interface ModelClient<TReq extends ModelRequest<?>,TRes extends ModelResponse<?>>
The ModelClient interface provides a generic API for invoking AI models. It is designed to handle the interaction with various types of AI models by abstracting the process of sending requests and receiving responses. The interface uses Java generics to accommodate different types of requests and responses, enhancing flexibility and adaptability across different AI model implementations.
Since:
0.8.0
Author:
Mark Pollack
  • Method Summary

    Modifier and Type
    Method
    Description
    call(TReq request)
    Executes a method call to the AI model.
  • Method Details

    • call

      TRes call(TReq request)
      Executes a method call to the AI model.
      Parameters:
      request - the request object to be sent to the AI model
      Returns:
      the response from the AI model