Model Providers
OpenAI
If you use OpenAI models within your application, you can trace, monitor, and analyze them with Judgment. You can do this by either
- Judgeval Wrap: Add our wrap around the initialization of your client
- OpenTelemetry: Use the OpenAIInstrumentor library to wrap OpenAI SDK calls and send Otel spans to Judgment.
Judgeval Wrap
from openai import OpenAI
from judgeval import Judgeval
client = Judgeval(project_name="openai_project")
tracer = client.tracer.create()
openai_client = OpenAI()
wrapped_client = tracer.wrap(openai_client) # Use wrapped_client from here onOpenTelemetry
from judgeval import Judgeval
# Make sure you installed the dependency: opentelemetry-instrumentation-openai
from opentelemetry.instrumentation.openai import OpenAIInstrumentor
client = Judgeval(project_name="openai_project")
tracer = client.tracer.create()
OpenAIInstrumentor().instrument()Last updated on