Skip to content

Commit b7ba124

Browse files
Updating chat completions inference data retrieval logic (#1199)
1 parent 762b12e commit b7ba124

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ads/aqua/extension/deployment_handler.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,10 @@ def _get_model_deployment_response(
246246
stream=True,
247247
):
248248
try:
249-
yield chunk["choices"][0]["delta"]["content"]
249+
if "text" in chunk["choices"][0]:
250+
yield chunk["choices"][0]["text"]
251+
elif "content" in chunk["choices"][0]["delta"]:
252+
yield chunk["choices"][0]["delta"]["content"]
250253
except Exception as e:
251254
logger.debug(
252255
f"Exception occurred while parsing streaming response: {e}"

0 commit comments

Comments
 (0)