Skip to content

Commit

Permalink
Merge pull request #147 from mindsdb/fix-streaming
Browse files Browse the repository at this point in the history
Fix streaming for agents /completion
  • Loading branch information
StpMax authored Aug 19, 2024
2 parents b6ff4a7 + 55ea569 commit 1c27215
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 1c27215

Please sign in to comment.