langchain-ai / langchainjs

🦜🔗 Build context-aware reasoning applications 🦜🔗
https://js.langchain.com/docs/
MIT License
12.41k stars 2.1k forks source link

Stream only the final answer when using an agent #1820

Closed dogfootruler-kr closed 6 months ago

dogfootruler-kr commented 1 year ago

I am using an agent and I would like to be able to stream only the final answer just like this question for the python lib that was resolved by creating this specific callback.

Is that also possible using the JS library?

Thank you very much!

dogfootruler-kr commented 1 year ago

I found my solution here https://js.langchain.com/docs/modules/chains/index_related_chains/conversational_retrieval#streaming

I'm closing this issue.

alexgitENI commented 10 months ago

Hello, do you have an example of code that worked for you? Thanks

rdroste commented 10 months ago

@dogfootruler-kr I don't see an implementation of a callback with functionality similar to the Python callback you linked under the link you provided as your solution. I believe that such a callback is missing in JS LangChain. Please consider re-opening the issue.

dogfootruler-kr commented 10 months ago

@rdroste @alexgitENI Indeed the callback is still missing and the link I shared did not work for me. I'll reopen this issue but I don't really care about it now. You can always make a PR to add this callback.

dosubot[bot] commented 7 months ago

🤖

Hi, @dogfootruler-kr,

I'm helping the langchainjs team manage their backlog and am marking this issue as stale. From what I understand, you initially asked about streaming only the final answer when using an agent in the JS library, found a solution, and closed the issue. However, another user pointed out the missing functionality and suggested reopening the issue. You mentioned that you don't really care about it now and others are welcome to make a pull request to add this callback.

Could you please confirm if this issue is still relevant to the latest version of the langchainjs repository? If it is, please let the langchainjs team know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days. Thank you!

Alexmhack commented 5 months ago

is this implemented or anyone has a custom solution?