mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-12 07:50:39 +00:00
community[patch]: Invoke callback prior to yielding token (sparkllm) (#18625)
## PR title community[patch]: Invoke callback prior to yielding token ## PR message - Description: Invoke callback prior to yielding token in _stream_ method in llms/sparkllm. - Issue: #16913 - Dependencies: None
This commit is contained in:
parent
5ac1860484
commit
455a74486b
@ -169,9 +169,9 @@ class SparkLLM(LLM):
|
||||
if "data" not in content:
|
||||
continue
|
||||
delta = content["data"]
|
||||
yield GenerationChunk(text=delta["content"])
|
||||
if run_manager:
|
||||
run_manager.on_llm_new_token(delta)
|
||||
yield GenerationChunk(text=delta["content"])
|
||||
|
||||
|
||||
class _SparkLLMClient:
|
||||
|
Loading…
Reference in New Issue
Block a user