Skip to content

The agent engineering platform.

community[patch]: OpenLLM Async Client Fixes and Timeout Parameter (#20007)

serayadd31f46d0c6
diff --git a/libs/community/langchain_community/llms/openllm.py b/libs/community/langchain_community/llms/openllm.py
index fa3b03e1f9..5d43e7ea26 100644
--- a/libs/community/langchain_community/llms/openllm.py
+++ b/libs/community/langchain_community/llms/openllm.py
@@ -308,10 +308,12 @@ class OpenLLM(LLM):
self._identifying_params["model_name"], **copied
)
if self._client:
- async_client = openllm.client.AsyncHTTPClient(self.server_url)
+ async_client = openllm.client.AsyncHTTPClient(self.server_url, self.timeout)
res = (
- await async_client.generate(prompt, **config.model_dump(flatten=True))
- ).responses[0]
+ (await async_client.generate(prompt, **config.model_dump(flatten=True)))
+ .outputs[0]
+ .text
+ )
else:
assert self._runner is not None
(