add streaming for together-ai

This commit is contained in:
ishaan-jaff 2023-08-09 17:58:54 -07:00
parent 23fc936b65
commit 3c3d144584
3 changed files with 36 additions and 3 deletions

View file

@ -375,9 +375,13 @@ def completion(
"model": model,
"prompt": prompt,
"request_type": "language-model-inference",
**optional_params
},
headers=headers
)
if stream == True:
response = CustomStreamWrapper(res, "together_ai")
return response
completion_response = res.json()['output']['choices'][0]['text']