Replies: 1 comment
-
Hi @tubedude! Thanks for taking the time to explain and document your use-case and reasoning. I like the idea of passing the context through. I hadn't considered that. Here's the challenge I'm trying to resolve: A ChatModel module's job is to handle the actual communication with the LLM. Specifically, it converts external concepts to and from something specific that LLM. That's where the deltas are actually received. Additionally, a ChatModel's That being said, I think a changed to the ChatModel.call function behaviour to add a context map However, I also agree with your point about the confusion of the callback handlers as to what belongs to the ChatModel and what belongs to the LLMChain. A combined, full set of callbacks could be used and set on the LLMChain which could be passed through in the At that point, it makes me wonder about just passing in the full LLMChain to the ChatModel.call function. Circular references aside, it might be a smoother experience. What do you think? Would that adequately address your needs? Anything else I'm missing or should consider? |
Beta Was this translation helpful? Give feedback.
-
For context, I'm using LangChain to analise large documents all within one LLMChain. The messages I receive are treated differently at each
step
of the analysis.The problem I'm facing (besides the fact I'm struggling to understand the JS way of implementing callbacks) is the fact that the
custom_context
is not available inChatModel
callbacks, as it is only available in theLLMChain
callbacks.So the idea here would be to make
custom_context
available to all callbacks. What do you think?My use case would look like this:
... and those functions would be called from a LiveView at each user interaction...
On a more conceptual discussion, I'm not understanding why the stream related callbacks are under Model callbacks and not under Chain callbacks, as it feels
new_delta
is something generated within the Chain, and not the Model in itself.And I feel even the distinction between Chain and Model callbacks are not actually necessary if you have the Chain available in the in the callback, you can go up to the Model.
Beta Was this translation helpful? Give feedback.
All reactions