[WIP] Initial chatcall implementation #606
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ChatCall
encapsulates the steps of usingChatClient
into an object namedChatCall
. TheChatCall
is created using a fluent-api, often registered as a Spring@Bean
and then calling anexecute
method with some runtime parameters, such as the variables to substitute into the prompt.Similar to Spring's
RdbmsOperation
interface, which models RDBMS operations as objects with theSqlCall
implementation handling SQL-based calls like stored procedures or functions, and akin toJdbcClient
offering a fluent API for JDBC operations, we introduce a helper class namedChatCall
.This class aims to streamline the process of gathering all necessary parameters for making calls to an AI model. It provides an easily shareable object encapsulating various options for calling an AI model and also helping to more easily chaining multiple calls to the model.
open issues
T...
as last parameter so don't have to specifyMyDomainObject.class
ParameterizedTypeReference