mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-07 15:36:30 +00:00
community[patch]: callback before yield for google palm (#26882)
**Description:** Moves yield to after callback for `_stream` function for the google palm model in the community package **Issue:** #16913
This commit is contained in:
parent
121e79b1f0
commit
11e703a97e
@ -215,13 +215,13 @@ class GooglePalm(BaseLLM, BaseModel):
|
|||||||
**kwargs,
|
**kwargs,
|
||||||
):
|
):
|
||||||
chunk = GenerationChunk(text=stream_resp.text)
|
chunk = GenerationChunk(text=stream_resp.text)
|
||||||
yield chunk
|
|
||||||
if run_manager:
|
if run_manager:
|
||||||
run_manager.on_llm_new_token(
|
run_manager.on_llm_new_token(
|
||||||
stream_resp.text,
|
stream_resp.text,
|
||||||
chunk=chunk,
|
chunk=chunk,
|
||||||
verbose=self.verbose,
|
verbose=self.verbose,
|
||||||
)
|
)
|
||||||
|
yield chunk
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def _llm_type(self) -> str:
|
def _llm_type(self) -> str:
|
||||||
|
Loading…
Reference in New Issue
Block a user