Skip to content

Abort on a function call example is confusing #996

Open
@hax

Description

@hax

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

Current doc "Abort on a function call" is confusing.

In general, I think use abort is not a good thing, we actually need end/finish method.

To Reproduce

The example code actually not work if use { tool_choice: "required" }? It seems await runner.finalFunctionCall() would just throw Error, and all async methods (eg. finalXXX and totalUsage) will throw error anyway after aborted.

Code snippets

No response

OS

macOS

Node version

Node 22

Library version

4.55.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions