-
Notifications
You must be signed in to change notification settings - Fork 854
Feature/add atomic agents integration #2783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Feature/add atomic agents integration #2783
Conversation
…suggestive aliases
I wanted to mention that 4 of the tests do not pass: hower, the issue is manifesting in the main branch as well; FAILED tests/e2e/evaluation/test_threads_evaluate.py::test_evaluate_threads__happy_path - AssertionError: Failed to get feedback scores for thread with id '234f7d'.
FAILED tests/e2e/test_guardrails.py::test_passing_guardrails__happyflow[e2e-tests-manual-project-name] - json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
FAILED tests/e2e/test_guardrails.py::test_passing_guardrails__happyflow[None] - json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
FAILED tests/e2e/test_guardrails.py::test_failing_guardrails__happyflow - json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) |
Thank you very much for your contribution! I assigned the following people to this PR, in order to review:
They'll get back to you soon with a review. |
@@ -1,15 +1,15 @@ | |||
import React from "react"; | |||
import { BASE_TRACE_DATA_TYPE, SPAN_TYPE } from "@/types/traces"; | |||
import TooltipWrapper from "@/components/shared/TooltipWrapper/TooltipWrapper"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please revert the automatic import formatting changes? These adjustments aren’t necessary for this PR.
The same applies to all frontend files modified here. Once this is addressed, we’ll be able to begin reviewing the frontend portion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andriidudar hi, I rectified this :)
1ca8c0f
to
a18979e
Compare
@@ -0,0 +1,114 @@ | |||
# Opik × Atomic Agents Integration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably should be somewhere in the documentation, but not here.
@@ -0,0 +1,5 @@ | |||
atomic-agents | |||
pydantic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All these dependencies except for atomic-agents
are already in tests/test_requirements.txt
so no need to install them.
def test_error_info_present(fake_backend): | ||
track_atomic_agents(project_name="err-test") | ||
|
||
BaseAgent = sys.modules["atomic_agents.agents.base_agent"].BaseAgent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not to move it to regular import?
@@ -1,3 +1,18 @@ | |||
[project] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't use pyproject toml for dependencies management at the moment, please remove it to avoid confusion.
@@ -0,0 +1,17 @@ | |||
"""Atomic Agents integration package for Opik SDK. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for this comment (so as every other AI generated comment at the top of the file can be omitted).
return info | ||
|
||
|
||
__all__: list[str] = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for this
tracer.end(error_info=error_info_collector.collect(exc)) | ||
raise | ||
|
||
BaseAgent.run = _agent_run # type: ignore[assignment] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All track-like decorators must be inherited from BaseTrackDecorator, similarly to other integrations. It encapsulates all the context-related work, you only need to define how to process inputs and outputs before submitting a span/trace.
@@ -0,0 +1,124 @@ | |||
"""Pytest fixtures for the atomic_agents integration tests.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of these tests are not needed, once the integration is re-implemented to use BaseTrackDecorator logic, tests can be simplified.
Please look at our other integrations and integration tests for them: openai, genai, crewai, etc.
They all have similar pattern. New integration should have it as well.
__IS_TRACKING_ENABLED = False | ||
|
||
|
||
def track_atomic_agents( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't got an experience with atomic-agents yet, but if it's possible - track_atomic_agents should take an agent instance as input instead of patching an entire library. It gives more granular control over the code.
Details
track_atomic_agents(project_name="my-project")
general
span → agent runtool
span → tool callllm
span → model requestOpikContextProvider
lets you inject trace IDs into promptspip install "opik[atomic_agents]"
Testing
.github/workflows/lib-atomic-agents-tests.yml
(Py 3.10-3.12)Documentation
atomic_agents_quickstart.ipynb
– hands-on tutorialatomic_agents_context_provider.ipynb
– advanced prompt injectionsdks/python/examples/atomic_agents_quickstart.py