Skip to content

Commit c0ae879

Browse files
viniciusdsmellogustavocidornelas
authored andcommitted
feat(tracing): enhance OCI Generative AI tracing notebook and integration
- Updated the `oci_genai_tracing.ipynb` notebook to include new prerequisites for Openlayer setup, emphasizing the need for an Openlayer account and API key. - Improved the configuration section with detailed instructions for setting up Openlayer environment variables. - Refined the tracing logic in the `oci_tracer.py` module to handle streaming and non-streaming chat completions more effectively, including enhanced error handling and metadata extraction. - Added comprehensive logging for better observability of token usage and response metadata. - Ensured all changes adhere to coding standards with thorough type annotations and Google-style docstrings for maintainability.
1 parent fbad796 commit c0ae879

File tree

2 files changed

+341
-97
lines changed

2 files changed

+341
-97
lines changed

examples/tracing/oci/oci_genai_tracing.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@
165165
"\n",
166166
"print(\"🚀 Making non-streaming chat completion request...\")\n",
167167
"\n",
168-
"# Make the request with custom inference ID for tracking\n",
168+
"# Make the request - the tracer will automatically capture with custom inference ID\n",
169169
"response = traced_client.chat(\n",
170170
" chat_details,\n",
171171
" inference_id=\"oci-example-1-non-streaming\"\n",
@@ -223,7 +223,7 @@
223223
"print(\"📡 Streaming response:\")\n",
224224
"print(\"-\" * 50)\n",
225225
"\n",
226-
"# Make the streaming request\n",
226+
"# Make the streaming request with custom inference ID for tracking\n",
227227
"streaming_response = traced_client.chat(\n",
228228
" streaming_chat_details,\n",
229229
" inference_id=\"oci-example-2-streaming\"\n",

0 commit comments

Comments
 (0)