Package org.springframework.ai.model
Interface ModelClient<TReq extends ModelRequest<?>,TRes extends ModelResponse<?>>
- Type Parameters:
TReq
- the generic type of the request to the AI modelTRes
- 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
-
Method Details
-
call
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
-