Skip to content

Commit 96986a4

Browse files
fix: update OpenAI responses API tracing example to accumulate response content
1 parent f020976 commit 96986a4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/tracing/openai/openai_responses_api_tracing.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,13 @@
146146
" messages=[{\"role\": \"user\", \"content\": \"Count from 1 to 3\"}],\n",
147147
" stream=True\n",
148148
")\n",
149+
"response = ''\n",
149150
"\n",
150151
"# Consume the stream - automatically traced\n",
151152
"for chunk in stream:\n",
152153
" if chunk.choices[0].delta.content:\n",
153-
" pass # Process chunks as needed\n",
154-
"\n",
155-
"# ✓ All requests automatically traced to Openlayer!"
154+
" response += chunk.choices[0].delta.content\n",
155+
"response"
156156
]
157157
},
158158
{

0 commit comments

Comments
 (0)