Conversation
Contributor
There was a problem hiding this comment.
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
OpikTracerin 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
.envexample referenceOPIK_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_keyproperty was removed during this change, which may break existing references toconfig.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]:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Track conversations using opik: https://www.comet.com/site/products/opik/