Skip to content

Question about observability tool integration #524

Description

@boyangsvl

Discussed in #321

Originally posted by sr198 April 21, 2025
Going through the Opik integration example and couples of things stand out.

opik_tracer = OpikTracer()

root_agent = Agent(
name="weather_time_agent",
model="gemini-2.0-flash-exp",
description=("Agent to answer questions about the time and weather in a city."),
instruction=("I can answer your questions about the time and weather in a city."),
tools=[get_weather, get_current_time],
before_agent_callback=opik_tracer.before_agent_callback,
after_agent_callback=opik_tracer.after_agent_callback,
before_model_callback=opik_tracer.before_model_callback,
after_model_callback=opik_tracer.after_model_callback,
before_tool_callback=opik_tracer.before_tool_callback,
after_tool_callback=opik_tracer.after_tool_callback,
)

  1. The callback params take a single value today - which means, if I want to add my own callback for some guardrail feature then I will have to wrap OpikTracker in my code. Should we allow callbacks to accept lists for chained execution at the framework level?
    Agent(
    ...
    before_model_callback=[my_callback, opik_tracer.before_model_callback],
    )
  2. Also can we allow observability integration at a higher/global level, so it’s not repeated per agent.

What do you think?

Metadata

Metadata

Labels

core[Component] This issue is related to the core interface and implementationneeds review[Status] The PR/issue is awaiting review from the maintainer
No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions