Skip to content

Setting x-stainless-helper-method to null in defaultHeaders gets ignored #1499

Open
@shivambudhia

Description

@shivambudhia

Confirm this is a Node library issue and not an underlying OpenAI API issue

  • This is an issue with the Node library

Describe the bug

Hardcoding the header in the function declaration is causing the defaultHeader override to not work.

static runTools<T extends (string | object)[], ParsedT = null>(

static runTools<ParsedT>(

Image

To Reproduce

  1. Create a new OpenAI instance
  2. Set the defaultHeaders to include 'x-stainless-retry-count': null
  3. See the header being included nonetheless

Code snippets

new OpenAI({
        baseURL: baseURL,
        apiKey: '',
        defaultHeaders: {
          'x-stainless-os': null,
          'x-stainless-runtime': null,
          'x-stainless-arch': null,
          'x-stainless-lang': null,
          'x-stainless-helper-method': null,
          'x-stainless-timeout': null,
          'x-stainless-package-version': null,
          'x-stainless-runtime-version': null,
          'x-stainless-retry-count': null,
        },
      }),

OS

macOS

Node version

v20.17.0

Library version

openai@4.92.1:

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