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

[Bug]: No Parameters passable for files()->list() #500

Open
bytes-commerce opened this issue Nov 15, 2024 · 0 comments
Open

[Bug]: No Parameters passable for files()->list() #500

bytes-commerce opened this issue Nov 15, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@bytes-commerce
Copy link

Description

The documentation describes how you can pass parameters to list calls, and the PHP wrapper has most of it, too.

However, not so much for the files-list. It does not accept parameters which makes querying for pages impossible.

Steps To Reproduce

return $client->vectorStores()->files()->list($vectorStoreId, array_filter([
            'limit' => 100,
            'after' => $after,
        ]));

This works.

return $client->files()->list();

This works only without params. Reason is the way its being built:

public function list(): ListResponse
    {
        $payload = Payload::list('files');

        /** @var Response<array{object: string, data: array<int, array{id: string, object: string, created_at: int, bytes: ?int, filename: string, purpose: string, status: string, status_details: array<array-key, mixed>|string|null}>}> $response */
        $response = $this->transporter->requestObject($payload);

        return ListResponse::from($response->data(), $response->meta());
    }

Just adapt the method to accept a payload, then pass it to the static method call.

OpenAI PHP Client Version

v0.10.1

PHP Version

8.3

Notes

No response

@bytes-commerce bytes-commerce added the bug Something isn't working label Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant