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

Support top level List[T] type for iterable's, partial's and raw responses #1146

Open
aretrace opened this issue Nov 5, 2024 · 1 comment

Comments

@aretrace
Copy link

aretrace commented Nov 5, 2024

It would be really useful to be able to return an object type of list when using client.chat.completions.create_iterable / create_partial / create_with_completion. The patched client currently only supports list with vanilla create:

class T(BaseModel):
        ...

response = client.chat.completions.create(
        model="gpt-3.5-turbo",
        messages=[
            {"role": "system", "content": "..."},
            {"role": "user", "content": "..."},
        ],
        response_model=List[T],
    )

create_with_completion would be a priority for this support (create already works).

@Mr-Ruben
Copy link

Mr-Ruben commented Dec 6, 2024

Maybe related with
#1078
#776

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

No branches or pull requests

2 participants