Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double remote call on DefaultChatClient with content and chatResponse #2098

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Grogdunn
Copy link
Contributor

This should fix the issue #2097 .

Copy link
Member

@chemicL chemicL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey! Since I've been summoned here by @tzolov, here's my view: The approach using a ThreadLocal is not appropriate. I don't know what the solution should be (most probably an architectural decision or some usage guidelines), but I can say that ThreadLocal will cause issues, e.g. if the client is shared across Threads. Also, resubscribing to the Flux of ChatResponse is most probably not permitted and actually would probably end up exercising the LLM call twice as well. I do not see any tests here either validating the approach, I think that would be necessary to make progress, but best to tackle the question of the intended usage and design. Implementing caching in any way might as well be unexpected in most scenarios regardless if it relies on ThreadLocal or some other mechanism.

@Grogdunn
Copy link
Contributor Author

Ok fine, the ThreadLocal is not the way to acheve this, we will continue to discuss on Issue, maybe only a renaming is needed to avoid confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants