mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-08 20:41:52 +00:00
Community[patch]: Missing "stream" parameter in cloudflare_workersai (#23987)
### Description Missing "stream" parameter. Without it, you'd never receive a stream of tokens when using stream() or astream() ### Issue No existing issue available
This commit is contained in:
parent
570566b858
commit
0dec72cab0
@ -70,7 +70,9 @@ class CloudflareWorkersAI(LLM):
|
||||
"""Call Cloudflare Workers API"""
|
||||
headers = {"Authorization": f"Bearer {self.api_token}"}
|
||||
data = {"prompt": prompt, "stream": self.streaming, **params}
|
||||
response = requests.post(self.endpoint_url, headers=headers, json=data)
|
||||
response = requests.post(
|
||||
self.endpoint_url, headers=headers, json=data, stream=self.streaming
|
||||
)
|
||||
return response
|
||||
|
||||
def _process_response(self, response: requests.Response) -> str:
|
||||
|
Loading…
Reference in New Issue
Block a user