-
Notifications
You must be signed in to change notification settings - Fork 2.4k
feat(dspy) PremAI python sdk #1007
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
Conversation
| else: | ||
| self.client = premai.Prem(api_key=api_key) | ||
| self.provider = "premai" | ||
|
|
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.
missing the line self.history: list[dict[str, Any]] = []
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.
Thanks for pointing this out, but I wonder, self.history is also been initialized in the abstract base class, so why we also define it here?
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.
defining the history here gives some flexibility with the typing (that is not done in the LM class). This behavior is maintained in most of the other LM classes (gpt3.py, Ollama, etc.).
Feel free to test the PremAI behavior with lm.inspect_history(n=1) on your end (where lm is defined as your dspy.PremAI model) as well.
|
Hi @Anindyadeep , thanks for the PR! Added a few comments to resolve the failing build tests. Could you also add documentation for the PremAI LM to provide context as done for the LMs in our documentation here? Ready to merge after that! |
Hey thanks for doing the reviews, I will add the requested changes soon, also I would also like to discuss more on the pointers raised in replies. |
|
Hey @arnavsinghvi11, I added some of the changes and feedbacks you provided, but for some reason, I am not able to pass the lint tests (with pre-commit), even for files like |
|
Hi @arnavsinghvi11, it would great, if we can do one or two more iterations on this whenever you have some time. Thanks |
|
Hi @Anindyadeep , left a few comments. Please refer to these lines in the failing tests on how to resolve and push the changes https://github.com/stanfordnlp/dspy/actions/runs/9067260753/job/25022498634?pr=1007#step:5:10 https://github.com/stanfordnlp/dspy/actions/runs/9067260753/job/25022499093?pr=1007#step:8:28 |
|
Hi @arnavsinghvi11 , So, all tests passing now, and fixed some bugs, hopefully it should pass the ci workflow checks. For ruff, I got this: Which are nothing related to files on this integration. |
Hi @Anindyadeep , seems like those are just warnings. the ruff check passes within the PR so ready to merge whenever you are ready! |
Thats, awesome, thanks I will ping you once, we are ready for merge. |
|
Hi @arnavsinghvi11, we are now ready get this merge. |
|
Hi @arnavsinghvi11, sorry have to bother you again, but it would be awesome, if you could approve this one, so that it checks the CI and we ready to merge thanks :) |
|
Thanks @Anindyadeep ! |
|
Thanks @arnavsinghvi11 for the review :) |
feat(dspy) PremAI python sdk
This PR adds a integration of premai python sdk to dspy modules.
Fixes issue: #1006