openai / openai-node

Official JavaScript / TypeScript library for the OpenAI API
https://www.npmjs.com/package/openai
Apache License 2.0
7.92k stars 862 forks source link

REALLY Support for max_num_results in FileSearchTool #1004

Open metaskills opened 2 months ago

metaskills commented 2 months ago

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

Describe the bug

Little to none and conflicting documentation on using max number of results. It was added, removed, changed???

Screenshot 2024-08-18 at 10 20 47 PM

To Reproduce

Try using max file results anywhere.

Code snippets

None.

OS

macOS

Node version

v18

Library version

4.56.0

athyuttamre commented 2 months ago

Hi @metaskills, what is the issue you're running into?

max_num_results can be specified when creating a Run, documented here: https://platform.openai.com/docs/api-reference/runs/createRun#runs-createrun-tools.

The previous issue you linked to was a bug in our OpenAPI spec, where max_num_results was accidentally added to the thread.message.attachments field.

metaskills commented 2 months ago

Yup, using the run options was listed in the failure locations above. I can do another test to show you the output for that specific case.

metaskills commented 2 months ago

Also, you say documented here but noting on that page shows max_num_results much less in attachments?