-
Notifications
You must be signed in to change notification settings - Fork 485
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
Modify openai model to receive openai client as argument during initialization #593
Conversation
53c6108
to
5c218b7
Compare
Can't we remove |
There are small differences:
I think we could fit all of them in a single class with some optional parameters and conditions based on them in the initialization. I'm not sure it would be simpler to use though |
10508a1
to
a73d4c4
Compare
I've merged the 3 into a single model/class, let me know if you think it's better like that |
Please add |
Please rebase, |
2d8f284
to
c261f47
Compare
Done, but I still have the issue of the conflict between the name of the module and the name of the |
Ya the import structure is tricky, we might consider doing |
Looks good! I can take a look at the import issue. We will also need to update the documentation, this is a big interface change. |
I've made a few modifications based on your comments to simplify the model and have fewer elements specific to OpenAI vs. Azure vs. OpenAICompatible. Sorry for the back and forth |
I thought a little more about this, and given the changes I made in #727 I suggest the following interface:
There are a few details that need to be fleshed out, but I think this solves many issues, like the impossibility to use choice with 3-rd party APIs. |
f488ba1
to
1d12afe
Compare
1d12afe
to
f64a3d1
Compare
@RobinPicard I implemented what I suggested above and fixed the issue with mocking. Could you please review? |
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.
The interface makes sense to me!
f64a3d1
to
ad23b2d
Compare
PR to solve issue #563
I have an issue with testing though. The fact that there's an object named
openai
in theopenai
module creates an import conflict when trying to usewith patch('outlines.models.openai.generate_chat') as mocked_generate_chat
. I see 2 solutions:unittest.mock.patch
to mock functions in that module. Maybe there's another way with theunittest
package I'm unaware of. Otherwise I've used the package expectise in the past and find it quite convenient, but that implies adding another dependency to outlines