The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
community[patch]: Invoke callback prior to yielding token fix [DeepInfra] (#20427)
ballooniob66a4f48fa56
diff --git a/libs/community/langchain_community/llms/deepinfra.py b/libs/community/langchain_community/llms/deepinfra.pyindex 412de97cf7..65911921a2 100644--- a/libs/community/langchain_community/llms/deepinfra.py+++ b/libs/community/langchain_community/llms/deepinfra.py@@ -155,9 +155,9 @@ class DeepInfra(LLM):for line in _parse_stream(response.iter_lines()):chunk = _handle_sse_line(line)if chunk:- yield chunkif run_manager:run_manager.on_llm_new_token(chunk.text)+ yield chunkasync def _astream(self,@@ -174,9 +174,9 @@ class DeepInfra(LLM):async for line in _parse_stream_async(response.content):chunk = _handle_sse_line(line)if chunk:- yield chunkif run_manager:await run_manager.on_llm_new_token(chunk.text)+ yield chunkdef _parse_stream(rbody: Iterator[bytes]) -> Iterator[str]: