Package org.springframework.ai.model
Interface ModelResponse<T extends ModelResult<?>>
- Type Parameters:
T
- the type of the result(s) provided by the AI model
- All Known Implementing Classes:
AudioTranscriptionResponse
,ChatResponse
,EmbeddingResponse
,ImageResponse
public interface ModelResponse<T extends ModelResult<?>>
Interface representing the response received from an AI model. This interface provides
methods to access the main result or a list of results generated by the AI model, along
with the response metadata. It serves as a standardized way to encapsulate and manage
the output from AI models, ensuring easy retrieval and processing of the generated
information.
- Since:
- 0.8.0
- Author:
- Mark Pollack
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the response metadata associated with the AI model's response.Retrieves the result of the AI model.Retrieves the list of generated outputs by the AI model.
-
Method Details
-
getResult
T getResult()Retrieves the result of the AI model.- Returns:
- the result generated by the AI model
-
getResults
Retrieves the list of generated outputs by the AI model.- Returns:
- the list of generated outputs
-
getMetadata
ResponseMetadata getMetadata()Retrieves the response metadata associated with the AI model's response.- Returns:
- the response metadata
-