Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeldking committed Jan 22, 2024
1 parent b14a9cb commit 43f6e6c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
6 changes: 6 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"version": "0.2",
"language": "en",
"words": ["arize", "chatbot", "dspy", "Instrumentor"],
"flagWords": ["hte"]
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
from typing import Collection

from openinference.instrumentation.dspy.package import _instruments
from openinference.instrumentation.dspy.version import __version__
from opentelemetry import trace as trace_api
from opentelemetry.instrumentation.instrumentor import BaseInstrumentor


Expand All @@ -6,4 +11,20 @@ class DSPyInstrumentor(BaseInstrumentor):
OpenInference Instrumentor for DSPy
"""




def instrumentation_dependencies(self) -> Collection[str]:
return _instruments



def _instrument(self, **kwargs):
if not (tracer_provider := kwargs.get("tracer_provider")):
tracer_provider = trace_api.get_tracer_provider()
tracer = trace_api.get_tracer(__name__, __version__, tracer_provider)


def _uninstrument(self, **kwargs):
from dspy import DSPy

DSPy.request = self._original_request

0 comments on commit 43f6e6c

Please sign in to comment.