Interface ChatClient.CallResponseSpec
- All Known Implementing Classes:
DefaultChatClient.DefaultCallResponseSpec
- Enclosing interface:
- ChatClient
public static interface ChatClient.CallResponseSpec
-
Method Summary
Modifier and TypeMethodDescription@Nullable ChatResponse@Nullable Stringcontent()<T> @Nullable TDeserializes the response into aTinstance.<T> @Nullable Tentity(Class<T> type, Consumer<ChatClient.EntityParamSpec> entityParamSpecConsumer) Deserializes the response into aTinstance, with behaviour configured via theentityParamSpecConsumer.<T> @Nullable Tentity(StructuredOutputConverter<T> structuredOutputConverter) Deserializes the response using the given converter.<T> @Nullable Tentity(StructuredOutputConverter<T> structuredOutputConverter, Consumer<ChatClient.EntityParamSpec> entityParamSpecConsumer) Deserializes the response using the given converter, with behaviour configured via theentityParamSpecConsumer.<T> @Nullable Tentity(org.springframework.core.ParameterizedTypeReference<T> type) Deserializes the response into aTinstance.<T> @Nullable Tentity(org.springframework.core.ParameterizedTypeReference<T> type, Consumer<ChatClient.EntityParamSpec> entityParamSpecConsumer) Deserializes the response into aTinstance, with behaviour configured via theentityParamSpecConsumer.<T> ResponseEntity<ChatResponse,T> responseEntity(Class<T> type) Returns aResponseEntitycontaining both the completeChatResponseobject and a specific entity type.<T> ResponseEntity<ChatResponse,T> responseEntity(Class<T> type, Consumer<ChatClient.EntityParamSpec> entityParamSpecConsumer) Returns aResponseEntitycontaining both the completeChatResponseobject and a specific entity type, with behaviour configured via theentityParamSpecConsumer.<T> ResponseEntity<ChatResponse,T> responseEntity(StructuredOutputConverter<T> structuredOutputConverter) Returns aResponseEntitycontaining both the completeChatResponseobject and an entity converted using a specifiedStructuredOutputConverter.<T> ResponseEntity<ChatResponse,T> responseEntity(StructuredOutputConverter<T> structuredOutputConverter, Consumer<ChatClient.EntityParamSpec> entityParamSpecConsumer) Returns aResponseEntitycontaining both the completeChatResponseobject and an entity converted using a specifiedStructuredOutputConverter, with behaviour configured via theentityParamSpecConsumer.<T> ResponseEntity<ChatResponse,T> responseEntity(org.springframework.core.ParameterizedTypeReference<T> type) Returns aResponseEntitycontaining both the completeChatResponseobject and aCollectionof entity types.<T> ResponseEntity<ChatResponse,T> responseEntity(org.springframework.core.ParameterizedTypeReference<T> type, Consumer<ChatClient.EntityParamSpec> entityParamSpecConsumer) Returns aResponseEntitycontaining both the completeChatResponseobject and a specific entity type, with behaviour configured via theentityParamSpecConsumer.
-
Method Details
-
entity
<T> @Nullable T entity(org.springframework.core.ParameterizedTypeReference<T> type, Consumer<ChatClient.EntityParamSpec> entityParamSpecConsumer) Deserializes the response into aTinstance, with behaviour configured via theentityParamSpecConsumer.- Parameters:
type- the target parameterized typeentityParamSpecConsumer- configures options such asChatClient.EntityParamSpec.useProviderStructuredOutput()andChatClient.EntityParamSpec.validateSchema()- Returns:
- the deserialized entity, or
nullif the response is empty
-
entity
<T> @Nullable T entity(org.springframework.core.ParameterizedTypeReference<T> type) Deserializes the response into aTinstance.- Parameters:
type- the target parameterized type- Returns:
- the deserialized entity, or
nullif the response is empty
-
entity
<T> @Nullable T entity(StructuredOutputConverter<T> structuredOutputConverter, Consumer<ChatClient.EntityParamSpec> entityParamSpecConsumer) Deserializes the response using the given converter, with behaviour configured via theentityParamSpecConsumer.- Parameters:
structuredOutputConverter- the converter for parsing and schema resolutionentityParamSpecConsumer- configures options such asChatClient.EntityParamSpec.useProviderStructuredOutput()andChatClient.EntityParamSpec.validateSchema()- Returns:
- the deserialized entity, or
nullif the response is empty
-
entity
Deserializes the response using the given converter.- Parameters:
structuredOutputConverter- the converter for parsing and schema resolution- Returns:
- the deserialized entity, or
nullif the response is empty
-
entity
Deserializes the response into aTinstance, with behaviour configured via theentityParamSpecConsumer.- Parameters:
type- the target classentityParamSpecConsumer- configures options such asChatClient.EntityParamSpec.useProviderStructuredOutput()andChatClient.EntityParamSpec.validateSchema()- Returns:
- the deserialized entity, or
nullif the response is empty
-
entity
Deserializes the response into aTinstance.- Parameters:
type- the target class- Returns:
- the deserialized entity, or
nullif the response is empty
-
chatClientResponse
ChatClientResponse chatClientResponse() -
chatResponse
@Nullable ChatResponse chatResponse() -
content
@Nullable String content() -
responseEntity
<T> ResponseEntity<ChatResponse,T> responseEntity(Class<T> type, Consumer<ChatClient.EntityParamSpec> entityParamSpecConsumer) Returns aResponseEntitycontaining both the completeChatResponseobject and a specific entity type, with behaviour configured via theentityParamSpecConsumer.- Parameters:
type- the target classentityParamSpecConsumer- configures options such asChatClient.EntityParamSpec.useProviderStructuredOutput()andChatClient.EntityParamSpec.validateSchema()- Returns:
- the
ResponseEntitycontaining both the completeChatResponseobject and the deserialized entity
-
responseEntity
Returns aResponseEntitycontaining both the completeChatResponseobject and a specific entity type.- Parameters:
type- the target class- Returns:
- the
ResponseEntitycontaining both the completeChatResponseobject and the deserialized entity
-
responseEntity
<T> ResponseEntity<ChatResponse,T> responseEntity(org.springframework.core.ParameterizedTypeReference<T> type, Consumer<ChatClient.EntityParamSpec> entityParamSpecConsumer) Returns aResponseEntitycontaining both the completeChatResponseobject and a specific entity type, with behaviour configured via theentityParamSpecConsumer.- Parameters:
type- the target parameterized typeentityParamSpecConsumer- configures options such asChatClient.EntityParamSpec.useProviderStructuredOutput()andChatClient.EntityParamSpec.validateSchema()- Returns:
- the
ResponseEntitycontaining both the completeChatResponseobject and the deserialized entity
-
responseEntity
<T> ResponseEntity<ChatResponse,T> responseEntity(org.springframework.core.ParameterizedTypeReference<T> type) Returns aResponseEntitycontaining both the completeChatResponseobject and aCollectionof entity types.- Parameters:
type- the target parameterized type- Returns:
- the
ResponseEntitycontaining both the completeChatResponseobject and the deserialized entities
-
responseEntity
<T> ResponseEntity<ChatResponse,T> responseEntity(StructuredOutputConverter<T> structuredOutputConverter, Consumer<ChatClient.EntityParamSpec> entityParamSpecConsumer) Returns aResponseEntitycontaining both the completeChatResponseobject and an entity converted using a specifiedStructuredOutputConverter, with behaviour configured via theentityParamSpecConsumer.- Parameters:
structuredOutputConverter- the converter for parsing and schema resolutionentityParamSpecConsumer- configures options such asChatClient.EntityParamSpec.useProviderStructuredOutput()andChatClient.EntityParamSpec.validateSchema()- Returns:
- the
ResponseEntitycontaining both the completeChatResponseobject and the deserialized entity
-
responseEntity
<T> ResponseEntity<ChatResponse,T> responseEntity(StructuredOutputConverter<T> structuredOutputConverter) Returns aResponseEntitycontaining both the completeChatResponseobject and an entity converted using a specifiedStructuredOutputConverter.- Parameters:
structuredOutputConverter- the converter for parsing and schema resolution- Returns:
- the
ResponseEntitycontaining both the completeChatResponseobject and the deserialized entity
-