Skip to main content
Module

x/openai/resources/beta/chat/mod.ts>Completions#runTools

Deno build of the official Typescript library for the OpenAI API.
Extremely Popular
Go to Latest
method Completions.prototype.runTools
import { Completions } from "https://deno.land/x/openai@v4.58.1/resources/beta/chat/mod.ts";

A convenience helper for using tool calls with the /chat/completions endpoint which automatically calls the JavaScript functions you provide and sends their results back to the /chat/completions endpoint, looping as long as the model requests function calls.

For more details and examples, see the docs

Type Parameters

Params extends ChatCompletionToolRunnerParams<any>
optional
ParsedT = ExtractParsedContentFromParams<Params>

Parameters

body: Params
optional
options: Core.RequestOptions

Returns

ChatCompletionRunner<ParsedT>

Type Parameters

Params extends ChatCompletionStreamingToolRunnerParams<any>
optional
ParsedT = ExtractParsedContentFromParams<Params>

Parameters

body: Params
optional
options: Core.RequestOptions

Returns

ChatCompletionStreamingRunner<ParsedT>