mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-30 17:29:56 +00:00
community[patch]: Invoke callback prior to yielding token (#18447)
## PR title community[patch]: Invoke callback prior to yielding token ## PR message Description: Invoke callback prior to yielding token in _stream method in llms/vertexai. Issue: https://github.com/langchain-ai/langchain/issues/16913 Dependencies: None
This commit is contained in:
parent
67375e96e0
commit
275877980e
@ -382,13 +382,13 @@ class VertexAI(_VertexAICommon, BaseLLM):
|
||||
**params,
|
||||
):
|
||||
chunk = self._response_to_generation(stream_resp)
|
||||
yield chunk
|
||||
if run_manager:
|
||||
run_manager.on_llm_new_token(
|
||||
chunk.text,
|
||||
chunk=chunk,
|
||||
verbose=self.verbose,
|
||||
)
|
||||
yield chunk
|
||||
|
||||
|
||||
@deprecated(
|
||||
|
Loading…
Reference in New Issue
Block a user