Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions examples/tracing/anthropic/anthropic_tracing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@
"metadata": {},
"outputs": [],
"source": [
"from openlayer.lib import trace_anthropic\n",
"from openlayer.lib import init\n",
"\n",
"anthropic_client = trace_anthropic(anthropic.Anthropic())"
"init()\n",
"\n",
"anthropic_client = anthropic.Anthropic() # auto-traced by Openlayer"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,18 @@
"from azure.ai.contentunderstanding import ContentUnderstandingClient\n",
"from azure.ai.contentunderstanding.models import AnalysisInput\n",
"\n",
"from openlayer.lib import configure, trace_azure_content_understanding\n",
"from openlayer.lib import init\n",
"\n",
"# Configure if you want to upload documents to Openlayer storage\n",
"configure(\n",
"# Set attachment options if you want to upload documents to Openlayer storage\n",
"init(\n",
" attachment_upload_enabled=True, # upload binary/file attachments\n",
" url_upload_enabled=True, # also download & re-upload external URLs\n",
")\n",
"\n",
"client = trace_azure_content_understanding(\n",
" ContentUnderstandingClient(\n",
" endpoint=os.environ.get(\"AZURE_CONTENT_UNDERSTANDING_ENDPOINT\"),\n",
" credential=AzureKeyCredential(os.environ.get(\"AZURE_CONTENT_UNDERSTANDING_KEY\")),\n",
" api_version=\"2025-11-01\",\n",
" )\n",
"client = ContentUnderstandingClient( # auto-traced by Openlayer\n",
" endpoint=os.environ.get(\"AZURE_CONTENT_UNDERSTANDING_ENDPOINT\"),\n",
" credential=AzureKeyCredential(os.environ.get(\"AZURE_CONTENT_UNDERSTANDING_KEY\")),\n",
" api_version=\"2025-11-01\",\n",
")"
]
},
Expand Down Expand Up @@ -148,4 +146,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}
14 changes: 7 additions & 7 deletions examples/tracing/azure-openai/azure_openai_tracing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@
"source": [
"from openai import AzureOpenAI\n",
"\n",
"from openlayer.lib import trace_openai\n",
"from openlayer.lib import init\n",
"\n",
"azure_client = trace_openai(\n",
" AzureOpenAI(\n",
" api_key=os.environ.get(\"AZURE_OPENAI_API_KEY\"),\n",
" api_version=\"2024-02-01\",\n",
" azure_endpoint=os.environ.get(\"AZURE_OPENAI_ENDPOINT\"),\n",
" )\n",
"init()\n",
"\n",
"azure_client = AzureOpenAI( # auto-traced by Openlayer\n",
" api_key=os.environ.get(\"AZURE_OPENAI_API_KEY\"),\n",
" api_version=\"2024-02-01\",\n",
" azure_endpoint=os.environ.get(\"AZURE_OPENAI_ENDPOINT\"),\n",
")"
]
},
Expand Down
6 changes: 3 additions & 3 deletions examples/tracing/google-adk/google_adk_tracing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@
"metadata": {},
"outputs": [],
"source": [
"from openlayer.lib.integrations import trace_google_adk\n",
"from openlayer.lib import init\n",
"\n",
"# Enable tracing (must be called before creating agents)\n",
"trace_google_adk()"
"# Auto-instrument the installed LLM SDKs (must be called before creating agents)\n",
"init()"
]
},
{
Expand Down
7 changes: 4 additions & 3 deletions examples/tracing/google-gemini/gemini_tracing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,13 @@
"metadata": {},
"outputs": [],
"source": [
"from openlayer.lib import trace_gemini\n",
"from openlayer.lib import init\n",
"\n",
"genai.configure(api_key=os.environ[\"GOOGLE_AI_API_KEY\"])\n",
"\n",
"model = genai.GenerativeModel(\"gemini-2.5-flash\")\n",
"traced_model = trace_gemini(model)"
"init()\n",
"\n",
"model = genai.GenerativeModel(\"gemini-2.5-flash\") # auto-traced by Openlayer"
]
},
{
Expand Down
6 changes: 4 additions & 2 deletions examples/tracing/groq/groq_tracing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@
"source": [
"import groq\n",
"\n",
"from openlayer.lib import trace_groq\n",
"from openlayer.lib import init\n",
"\n",
"groq_client = trace_groq(groq.Groq())"
"init()\n",
"\n",
"groq_client = groq.Groq() # auto-traced by Openlayer"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions examples/tracing/litellm/litellm_tracing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@
"metadata": {},
"outputs": [],
"source": [
"from openlayer.lib import trace_litellm\n",
"from openlayer.lib import init\n",
"\n",
"# Enable tracing for all LiteLLM completions\n",
"trace_litellm()\n"
"# Auto-instrument the installed LLM SDKs (LiteLLM, etc.)\n",
"init()"
]
},
{
Expand Down
6 changes: 4 additions & 2 deletions examples/tracing/mistral/mistral_tracing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,11 @@
"source": [
"import mistralai\n",
"\n",
"from openlayer.lib import trace_mistral\n",
"from openlayer.lib import init\n",
"\n",
"mistral_client = trace_mistral(mistralai.Mistral(api_key=\"YOUR_MISTRAL_AI_API_KEY_HERE\"))"
"init()\n",
"\n",
"mistral_client = mistralai.Mistral(api_key=\"YOUR_MISTRAL_AI_API_KEY_HERE\") # auto-traced by Openlayer"
]
},
{
Expand Down
6 changes: 4 additions & 2 deletions examples/tracing/openai/openai_tracing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@
"metadata": {},
"outputs": [],
"source": [
"from openlayer.lib import trace_openai\n",
"from openlayer.lib import init\n",
"\n",
"openai_client = trace_openai(openai.OpenAI())"
"init()\n",
"\n",
"openai_client = openai.OpenAI() # auto-traced by Openlayer"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions examples/tracing/portkey/portkey_tracing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@
"metadata": {},
"outputs": [],
"source": [
"from openlayer.lib import trace_portkey\n",
"from openlayer.lib import init\n",
"\n",
"# Enable openlayer tracing for all Portkey completions\n",
"trace_portkey()"
"# Auto-instrument the installed LLM SDKs (Portkey, etc.)\n",
"init()"
]
},
{
Expand Down
7 changes: 4 additions & 3 deletions examples/tracing/rag/rag_tracing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"from sklearn.metrics.pairwise import cosine_similarity\n",
"from sklearn.feature_extraction.text import TfidfVectorizer\n",
"\n",
"from openlayer.lib import trace, trace_openai"
"from openlayer.lib import init, trace"
]
},
{
Expand All @@ -76,8 +76,9 @@
"source": [
"class RagPipeline:\n",
" def __init__(self, context_path: str):\n",
" # Wrap OpenAI client with Openlayer's `trace_openai` to trace it\n",
" self.openai_client = trace_openai(OpenAI())\n",
" # Auto-instrument the installed LLM SDKs (OpenAI, etc.)\n",
" init()\n",
" self.openai_client = OpenAI() # auto-traced by Openlayer\n",
"\n",
" self.vectorizer = TfidfVectorizer()\n",
" with open(context_path, \"r\", encoding=\"utf-8\") as file:\n",
Expand Down