Skip to content

Add support for Opik tracking#5

Merged
pmenendz merged 5 commits intomainfrom
opik-support
Jun 25, 2025
Merged

Add support for Opik tracking#5
pmenendz merged 5 commits intomainfrom
opik-support

Conversation

@pmenendz
Copy link
Copy Markdown
Collaborator

Track conversations using opik: https://www.comet.com/site/products/opik/

@pmenendz pmenendz requested a review from Copilot June 23, 2025 16:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds optional Opik support to trace agent conversations and configures it via environment or project settings.

  • Validates and reports Opik configuration in Config
  • Integrates OpikTracer in the agent setup and conversation loop
  • Updates dependencies, examples, and documentation for Opik

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/expert/config.py Added Opik API key validation and new config properties
src/expert/agent.py Hooked in OpikTracer during setup and chat loop
pyproject.toml Added opik dependency
config.yaml Added default opik section
README.md Documented Opik setup and env variables
.env.example Added Opik environment variable examples
Comments suppressed due to low confidence (3)

README.md:168

  • The README and .env example reference OPIK_WORKSPACE, but the code does not consume or use this variable. Either implement support for it or remove it from the documentation to avoid confusion.
- `OPIK_WORKSPACE` (optional): Your Opik workspace name for conversation tracing

src/expert/agent.py:96

  • There are no tests covering the new Opik tracer initialization and the conditional callback attachment in the chat loop. Please add unit or integration tests to verify both enabled and disabled tracing behaviors.
        if self.config.opik_api_key:

src/expert/config.py:63

  • The openai_api_key property was removed during this change, which may break existing references to config.openai_api_key. Please re-add it or update callers to use the correct method for retrieving the OpenAI key.
    def opik_config(self) -> dict[str, Any]:

Comment thread src/expert/agent.py Outdated
@pmenendz pmenendz merged commit 88a5efb into main Jun 25, 2025
5 checks passed
@pmenendz pmenendz deleted the opik-support branch June 25, 2025 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants