Skip to content

Double remote call on DefaultChatClient with content and chatResponse #2097

@Grogdunn

Description

@Grogdunn

Bug description
In DefaultChatClient#DefaultCallResponseSpec (also in streaming) call chatResponse or conent trigger the remote call twice.

Environment
Spring AI version M5 confirmed also on main

Steps to reproduce
simply call chatResponse and content and double remote service is invoked

Expected behavior
per "DefaultCallResponseSpec" access to same response (memoized)

Minimal Complete Reproducible example

var response = chatClient.prompt()
		.advisors(new ReReadingAdvisor())
		.call();
response.content();
response.chatResponse();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions