Please do a quick search on GitHub issues first, the feature you are about to request might have already been requested.

Expected Behavior

Will there be plans to merge them into a single component in the future?

Current Behavior

example: openAiChatModel.call(new Prompt(DEFAULT_PROMPT)).getResult().getOutput().getContent(); openAiChatClient.prompt(DEFAULT_PROMPT).call().content(); The final result returned by the two lines of code above is the same.

Context

I have some questions while learning SpringAi, and I would appreciate your insights. What are the main differences between the ChatClient and ChatModel components? Since ChatModel can be converted into ChatClient and they share the same functionality, could it be that they have redundant designs? What is the reasoning behind this design choice? Will there be plans to merge them into a single component in the future? Thank you in advance for your response.

I’ve searched online, but it seems I couldn’t find any related explanations.

Comment From: ilayaperumalg

Hi @xiaohai-78, Thanks for reaching out.

ChatClient provides the fluent API around the Chat Model to provide more flexible client centric patterns around prompt, advisor etc., While you can still use ChatModel to achieve some of the operations, ChatClient provides the flexible approach to construct your client side options to interact with the model.

Comment From: xiaohai-78

ok, I have a rough understanding now. Thank you for your answer.