Skip to content

Commit efbe786

Browse files
fix(docs): ruff linting issues
1 parent c9ad449 commit efbe786

File tree

6 files changed

+14
-10
lines changed

6 files changed

+14
-10
lines changed

examples/tracing/anthropic/anthropic_tracing.ipynb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"outputs": [],
4040
"source": [
4141
"import os\n",
42+
"\n",
4243
"import anthropic\n",
4344
"\n",
4445
"# OpenAI env variables\n",

examples/tracing/azure-openai/azure_openai_tracing.ipynb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
"outputs": [],
4040
"source": [
4141
"import os\n",
42-
"import openai\n",
4342
"\n",
4443
"# Azure OpenAI env variables\n",
4544
"os.environ[\"AZURE_OPENAI_ENDPOINT\"] = \"YOUR_AZURE_OPENAI_ENDPOINT_HERE\"\n",
@@ -66,10 +65,10 @@
6665
"metadata": {},
6766
"outputs": [],
6867
"source": [
69-
"from openlayer.lib import trace_openai\n",
70-
"\n",
7168
"from openai import AzureOpenAI\n",
7269
"\n",
70+
"from openlayer.lib import trace_openai\n",
71+
"\n",
7372
"azure_client = trace_openai(\n",
7473
" AzureOpenAI(\n",
7574
" api_key=os.environ.get(\"AZURE_OPENAI_API_KEY\"),\n",

examples/tracing/groq/groq_tracing.ipynb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"outputs": [],
6565
"source": [
6666
"import groq\n",
67+
"\n",
6768
"from openlayer.lib import trace_groq\n",
6869
"\n",
6970
"groq_client = trace_groq(groq.Groq())"

examples/tracing/mistral/mistral_tracing.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
"outputs": [],
6262
"source": [
6363
"import mistralai\n",
64+
"\n",
6465
"from openlayer.lib import trace_mistral\n",
6566
"\n",
6667
"mistral_client = trace_mistral(mistralai.Mistral(api_key=\"YOUR_MISTRAL_AI_API_KEY_HERE\"))"
@@ -115,10 +116,7 @@
115116
" \"content\": \"What's the meaning of life?\",\n",
116117
" },\n",
117118
" ]\n",
118-
")\n",
119-
"\n",
120-
"for chunk in stream_response:\n",
121-
" print(chunk.data.choices[0].delta.content)"
119+
") "
122120
]
123121
},
124122
{
@@ -127,7 +125,9 @@
127125
"id": "2654f47f-fadd-4142-b185-4d992a30c46a",
128126
"metadata": {},
129127
"outputs": [],
130-
"source": []
128+
"source": [
129+
"chunks = [chunk.data.choices[0].delta.content for chunk in stream_response]"
130+
]
131131
}
132132
],
133133
"metadata": {
@@ -146,7 +146,7 @@
146146
"name": "python",
147147
"nbconvert_exporter": "python",
148148
"pygments_lexer": "ipython3",
149-
"version": "3.9.19"
149+
"version": "3.9.18"
150150
}
151151
},
152152
"nbformat": 4,

examples/tracing/openai-assistant/openai_assistant_tracing.ipynb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"outputs": [],
4040
"source": [
4141
"import os\n",
42+
"\n",
4243
"import openai\n",
4344
"\n",
4445
"# OpenAI env variables\n",
@@ -127,9 +128,10 @@
127128
"metadata": {},
128129
"outputs": [],
129130
"source": [
130-
"from openlayer.lib import trace_openai_assistant_thread_run\n",
131131
"import time\n",
132132
"\n",
133+
"from openlayer.lib import trace_openai_assistant_thread_run\n",
134+
"\n",
133135
"# Keep polling the run results\n",
134136
"while run.status != \"completed\":\n",
135137
" run = openai_client.beta.threads.runs.retrieve(thread_id=thread.id, run_id=run.id)\n",

examples/tracing/openai/openai_tracing.ipynb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"outputs": [],
4040
"source": [
4141
"import os\n",
42+
"\n",
4243
"import openai\n",
4344
"\n",
4445
"# OpenAI env variables\n",

0 commit comments

Comments
 (0)