Skip to content

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

Closed
@scott82anderson

Description

@scott82anderson

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions