openai-node icon indicating copy to clipboard operation
openai-node copied to clipboard

REALLY Support for max_num_results in FileSearchTool

Open metaskills opened this issue 1 year ago • 3 comments

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

  • [X] This is an issue with the Node library

Describe the bug

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

  • https://github.com/openai/openai-node/issues/886

Screenshot 2024-08-18 at 10 20 47 PM

To Reproduce

Try using max file results anywhere.

  • Run options max_num_results
  • Run options file_search.max_num_results
  • Tools file_search.max_num_results

Code snippets

None.

OS

macOS

Node version

v18

Library version

4.56.0

metaskills avatar Aug 19 '24 02:08 metaskills

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.

athyuttamre avatar Aug 19 '24 22:08 athyuttamre

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 avatar Aug 19 '24 22:08 metaskills

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

metaskills avatar Aug 19 '24 22:08 metaskills