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

Return multiple choices #576

Open
kstathou opened this issue Apr 7, 2024 · 3 comments
Open

Return multiple choices #576

kstathou opened this issue Apr 7, 2024 · 3 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@kstathou
Copy link

kstathou commented Apr 7, 2024

Describe the solution you'd like
Thanks a lot for making this library, it's been super helpful! I am working on a text classification task and I wanted to get multiple parsed responses from a single client.chat.completions.create call using OpenAI's n parameter.

The following would only parse the first completion I believe:

client.chat.completions.create_with_completion(
        model="gpt-3.5-turbo-0613",
        response_model=SinglePrediction,
        messages=[
            {
                "role": "user",
                "content": f"Classify the following text: {data}",
            },
        ],
        n=3,
    )

How would you recommend going on about it? Thank you!

@dosubot dosubot bot added enhancement New feature or request question Further information is requested labels Apr 7, 2024
@jxnl
Copy link
Owner

jxnl commented Apr 7, 2024

I think we can create a overload that does this thanks for the new sdk

@jxnl
Copy link
Owner

jxnl commented Apr 7, 2024

Will experiment with overloads.

@jxnl
Copy link
Owner

jxnl commented Apr 8, 2024

#578

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants