parsed_arguments: isAutoParsableTool()

in lib/ChatCompletionStream.ts [355:374]


        parsed_arguments: isAutoParsableTool(inputTool)
          ? inputTool.$parseRaw(toolCallSnapshot.function.arguments)
          : inputTool?.function.strict
          ? JSON.parse(toolCallSnapshot.function.arguments)
          : null,
      });
    } else {
      assertNever(toolCallSnapshot.type);
    }
  }

  #emitContentDoneEvents(choiceSnapshot: ChatCompletionSnapshot.Choice) {
    const state = this.#getChoiceEventState(choiceSnapshot);

    if (choiceSnapshot.message.content && !state.content_done) {
      state.content_done = true;

      const responseFormat = this.#getAutoParseableResponseFormat();

      this._emit("content.done", {