Skip to content

Commit

Permalink
fix streaming
Browse files Browse the repository at this point in the history
  • Loading branch information
StpMax committed Aug 19, 2024
1 parent 8b8d296 commit 55ea569
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mindsdb_sdk/connectors/rest_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def agent_completion(self, project: str, name: str, messages: List[dict]):
@_try_relogin
def agent_completion_stream(self, project: str, name: str, messages: List[dict]):
url = self.url + f'/api/projects/{project}/agents/{name}/completions/stream'
stream = requests.post(url, json={'messages': messages}, stream=True)
stream = self.session.post(url, json={'messages': messages}, stream=True)
client = SSEClient(stream)
for chunk in client.events():
# Stream objects loaded from SSE events 'data' param.
Expand Down

0 comments on commit 55ea569

Please sign in to comment.