Skip to content

export stream types from root#1969

Open
sarptandoven wants to merge 1 commit into
openai:mainfrom
sarptandoven:fix/export-stream-types
Open

export stream types from root#1969
sarptandoven wants to merge 1 commit into
openai:mainfrom
sarptandoven:fix/export-stream-types

Conversation

@sarptandoven

Copy link
Copy Markdown

summary

  • exports Stream and ChatCompletionStream from the root package entrypoint
  • exposes the same stream types through the OpenAI namespace
  • adds a regression test covering root imports and namespace type access

why

validation

  • pnpm exec jest tests/stream-exports.test.ts --runInBand
  • pnpm exec tsc --noEmit --pretty false
  • pnpm lint
  • git diff --check

@sarptandoven sarptandoven requested a review from a team as a code owner July 6, 2026 18:01

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c930e05700

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/client.ts
Comment on lines +1399 to +1400
export import Stream = Streaming.Stream;
export import ChatCompletionStream = ChatCompletionStreams.ChatCompletionStream;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Don't declare missing OpenAI stream statics

These export import aliases are emitted in the declarations as value members, so TypeScript will now accept runtime code such as OpenAI.Stream.fromReadableStream(...) or OpenAI.ChatCompletionStream.fromReadableStream(...). client.ts never assigns those statics to the OpenAI class (unlike the resource classes assigned below), so those calls fail with OpenAI.Stream/OpenAI.ChatCompletionStream being undefined; if the namespace is intended only for type access, use type aliases instead, or add the matching static assignments.

Useful? React with 👍 / 👎.

@HAYDEN-OAI HAYDEN-OAI added the upstream Needs to be addressed in Stainless upstream label Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

upstream Needs to be addressed in Stainless upstream

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stream nor ChatCompletionStream types not exported

2 participants