Skip to content

Commit 4969d03

Browse files
viniciusdsmellogustavocidornelas
authored andcommitted
feat(closes OPEN-7543): update trace openai to support responses api
1 parent edfa186 commit 4969d03

File tree

3 files changed

+754
-112
lines changed

3 files changed

+754
-112
lines changed

examples/tracing/openai/openai_tracing.ipynb

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@
8686
"That's it! Now you can continue using the traced OpenAI client normally. The data is automatically published to Openlayer and you can start creating tests around it!"
8787
]
8888
},
89+
{
90+
"cell_type": "markdown",
91+
"id": "fb5ebdad",
92+
"metadata": {},
93+
"source": [
94+
"### 3.1 Chat Completions API"
95+
]
96+
},
8997
{
9098
"cell_type": "code",
9199
"execution_count": null,
@@ -98,18 +106,32 @@
98106
")"
99107
]
100108
},
109+
{
110+
"cell_type": "markdown",
111+
"id": "4e6fb396",
112+
"metadata": {},
113+
"source": [
114+
"### 3.2 Responses API"
115+
]
116+
},
101117
{
102118
"cell_type": "code",
103119
"execution_count": null,
104-
"id": "abaf6987-c257-4f0d-96e7-3739b24c7206",
120+
"id": "21369c42",
105121
"metadata": {},
106122
"outputs": [],
107-
"source": []
123+
"source": [
124+
"response = openai_client.responses.create(\n",
125+
" model=\"gpt-4o-mini\",\n",
126+
" input=\"What is 3 + 3?\",\n",
127+
" max_output_tokens=50\n",
128+
")"
129+
]
108130
}
109131
],
110132
"metadata": {
111133
"kernelspec": {
112-
"display_name": "Python 3 (ipykernel)",
134+
"display_name": "bedrock-test",
113135
"language": "python",
114136
"name": "python3"
115137
},
@@ -123,7 +145,7 @@
123145
"name": "python",
124146
"nbconvert_exporter": "python",
125147
"pygments_lexer": "ipython3",
126-
"version": "3.9.18"
148+
"version": "3.12.3"
127149
}
128150
},
129151
"nbformat": 4,

0 commit comments

Comments
 (0)