Skip to content

Support for mocking streamed chat completions #1013

Open
@rjcorwin

Description

@rjcorwin

Is your feature request related to a problem? Please describe.
I'm working on a project that mocks client responses. In our context, we thread the go-openai client through. On context, that client is defined as an interface so in our unit tests, we can mock it with a test client we've developed. We can currently mock non-stream chat requests, but for streamed chat requests we are currently unable to mock the stream returned.

Describe the solution you'd like
We would like the stream reader to be able to be mocked.

Describe alternatives you've considered
See our proposed solution in the PR here: #1016

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions