Skip to content

ERROR | query parameter | array of strings in VectorStoreSearch #1453

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

Open
1 task
MwSpaceLLC opened this issue Apr 8, 2025 · 2 comments
Open
1 task

ERROR | query parameter | array of strings in VectorStoreSearch #1453

MwSpaceLLC opened this issue Apr 8, 2025 · 2 comments
Labels
openai api Related to underlying OpenAI API

Comments

@MwSpaceLLC
Copy link

MwSpaceLLC commented Apr 8, 2025

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

When using the OpenAI SDK to search a vector store, sending an array of query strings (as stated in the SDK’s TypeScript definition and the official documentation) causes a server error (HTTP 500).

Link to documentation: Open AI Vector Storage Search | Array

To Reproduce

Steps to reproduce the behavior:

Use the following code (where openai is an instance of OpenAI initialized with a valid API key).

Notice the HTTP 500 error in response.

const openai = new OpenAI({ apiKey: inSessionUserActive.OpenAiToken });

const results = await openai.vectorStores.search({
  vector_store_id: "vector_store.id",
  query: [
    "allowed per passenger",
    "How many woodchucks are allowed per passenger?"
  ]
});

Code snippets

The OpenAI SDK TypeScript definition indicates an array of strings should be valid:

.... openai\src\resources\vector-stores\vector-stores.ts

export interface VectorStoreSearchParams {
  /**
   * A query string for a search
   */
  query: string | Array<string>;
}

OS

Windows

Node version

v20.12.2

Library version

4.92.1

@MwSpaceLLC MwSpaceLLC added the bug Something isn't working label Apr 8, 2025
@MwSpaceLLC
Copy link
Author

@RobertCraigie

@Lucas-Levandoski
Copy link

It seems to be a bug on Open AI API and not on node.js package, using the raw HTTP request following the cURL from the docs it also fails!

Image

It works just fine with a string instead of an array of strings on query

@RobertCraigie RobertCraigie added openai api Related to underlying OpenAI API and removed bug Something isn't working labels Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
openai api Related to underlying OpenAI API
Projects
None yet
Development

No branches or pull requests

3 participants