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

[Question]: Unable to test fake Threads Runs streamed response #510

Open
scott82anderson opened this issue Jan 14, 2025 · 0 comments
Open
Labels
bug Something isn't working

Comments

@scott82anderson
Copy link

Description

I'm trying to write a test for a function that calls $client->threads()->runs()->createStreamed();

For other methods we use the ClientFake() class with the appropriate fake response.

I tried the following

$client = new ClientFake(ThreadRunStreamResponse::fake($expectedStreamResponse));

However this doesn't work because ThreadRunStreamResponse doesn't use the Fakeable trait like ThreadMessageResponse or CreateResponse.

Is there another Response class I should be using instead or has this response's fake / fixtures not been implemented yet?

Steps To Reproduce

You can test with

$client = new ClientFake(ThreadRunStreamResponse::fake($expectedStreamResponse));

OpenAI PHP Client Version

v0.10.3

PHP Version

8.2.12

Notes

No response

@scott82anderson scott82anderson added the bug Something isn't working label Jan 14, 2025
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