Skip to content
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

OPIK-615 [SDK] DSPY integration #940

Merged
merged 15 commits into from
Dec 27, 2024
Merged

OPIK-615 [SDK] DSPY integration #940

merged 15 commits into from
Dec 27, 2024

Conversation

japdubengsub
Copy link
Contributor

@japdubengsub japdubengsub commented Dec 19, 2024

Details

Added DSPy integration. You can use Opik callback:

import os

import dspy

from opik import track
from opik.integrations.dspy.callback import OpikCallback


project_name = "DSPY"

lm = dspy.LM(
    model='openai/gpt-4o-mini',
)
dspy.configure(lm=lm)


opik_callback = OpikCallback(project_name=project_name)
dspy.settings.configure(
    callbacks=[opik_callback]
)

cot = dspy.ChainOfThought("question -> answer")
cot(question="What is the meaning of life?")

Testing

Integration tests are added.

Copy link
Collaborator

@alexkuzmik alexkuzmik left a comment

Choose a reason for hiding this comment

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

Please take a look at our langchain integration, many pain points that I mentioned in this review were already addressed there. It has quite similar nature and similar problems.

sdks/python/src/opik/integrations/dspy/callback.py Outdated Show resolved Hide resolved
sdks/python/src/opik/integrations/dspy/callback.py Outdated Show resolved Hide resolved
sdks/python/src/opik/integrations/dspy/callback.py Outdated Show resolved Hide resolved
@japdubengsub japdubengsub marked this pull request as ready for review December 26, 2024 15:43
@japdubengsub japdubengsub requested review from a team as code owners December 26, 2024 15:43
@alexkuzmik
Copy link
Collaborator

Nice 👍

@alexkuzmik alexkuzmik merged commit 7537149 into main Dec 27, 2024
38 checks passed
@alexkuzmik alexkuzmik deleted the OPIK-615 branch December 27, 2024 09:15
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