Skip to content

Commit

Permalink
commit notes
Browse files Browse the repository at this point in the history
  • Loading branch information
axiomofjoy committed Jan 17, 2025
1 parent 2a93dd0 commit a2c7e46
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions python/openinference-instrumentation/examples/tracer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"Proposed imports:\n",
"\n",
"```python\n",
"from openinference.semconv.trace import (\n",
"from openinference.instrumentation import (\n",
" get_input_value_and_mime_type,\n",
" get_openinference_span_kind,\n",
" get_output_value_and_mime_type,\n",
Expand Down Expand Up @@ -43,11 +43,12 @@
"\n",
"from openinference.instrumentation import using_attributes\n",
"from openinference.instrumentation.config import (\n",
" OpenInferenceTracerProvider,\n",
" # imagine these imports are different\n",
" OpenInferenceTracerProvider, # rename to TracerProvider\n",
" chain,\n",
" get_current_openinference_span,\n",
" get_current_openinference_span, # rename to get_current_span\n",
" get_input_value_and_mime_type,\n",
" get_openinference_span_kind,\n",
" get_openinference_span_kind, # rename to get_span_kind\n",
" get_output_value_and_mime_type,\n",
" get_tool_attributes,\n",
" suppress_tracing,\n",
Expand All @@ -67,7 +68,7 @@
"tracer_provider = OpenInferenceTracerProvider(resource=resource)\n",
"tracer_provider.add_span_processor(SimpleSpanProcessor(OTLPSpanExporter(endpoint)))\n",
"tracer_provider.add_span_processor(SimpleSpanProcessor(ConsoleSpanExporter()))\n",
"set_tracer_provider(tracer_provider)\n",
"# set_tracer_provider(tracer_provider)\n",
"tracer = tracer_provider.get_tracer(__name__)"
]
},
Expand Down Expand Up @@ -489,6 +490,7 @@
" name=\"tool-name\",\n",
" description=\"tool-description\",\n",
" parameters={\"input\": \"input\"},\n",
" id=\"1234\",\n",
" )\n",
" )\n",
" span.set_status(Status(StatusCode.OK))"
Expand All @@ -500,7 +502,7 @@
"metadata": {},
"outputs": [],
"source": [
"@tool\n",
"@tool(parameters=\"\")\n",
"def decorated_tool(input1: str, input2: int) -> None:\n",
" \"\"\"\n",
" tool-description\n",
Expand Down

0 comments on commit a2c7e46

Please sign in to comment.