generative-ts

Interface OpenAiChatOptions

interface OpenAiChatOptions {
    $prompt: string;
    examplePairs?: {
        assistant: string;
        user: string;
    }[];
    frequency_penalty?: number;
    function_call?: string;
    functions?: {
        description?: string;
        name: string;
        parameters?: object;
    }[];
    logit_bias?: Record<string, number>;
    logprobs?: boolean;
    max_tokens?: number;
    messages?: ChatCompletionRequestMessage[];
    modelId: string;
    n?: number;
    presence_penalty?: number;
    response_format?: {
        type: "text" | "json_object";
    };
    seed?: number;
    stop?: string | string[];
    stream?: boolean;
    stream_options?: {
        include_usage: boolean;
    };
    system?: string;
    temperature?: number;
    tool_choice?: "required" | "none" | "auto" | {
        function: {
            name: string;
        };
        type: "function";
    };
    tools?: {
        function: {
            description?: string;
            name: string;
            parameters?: object;
        };
        type: "function";
    }[];
    top_logprobs?: number;
    top_p?: number;
    user?: string;
}

Hierarchy

  • ModelRequestOptions
  • FewShotRequestOptions
  • OpenAiChatToolsOptions
    • OpenAiChatOptions

Properties

$prompt: string
examplePairs?: {
    assistant: string;
    user: string;
}[]

Type declaration

  • assistant: string
  • user: string
frequency_penalty?: number
function_call?: string
functions?: {
    description?: string;
    name: string;
    parameters?: object;
}[]

Type declaration

  • Optional description?: string
  • name: string
  • Optional parameters?: object
logit_bias?: Record<string, number>
logprobs?: boolean
max_tokens?: number
messages?: ChatCompletionRequestMessage[]
modelId: string
n?: number
presence_penalty?: number
response_format?: {
    type: "text" | "json_object";
}

Type declaration

  • type: "text" | "json_object"
seed?: number
stop?: string | string[]
stream?: boolean
stream_options?: {
    include_usage: boolean;
}

Type declaration

  • include_usage: boolean
system?: string
temperature?: number
tool_choice?: "required" | "none" | "auto" | {
    function: {
        name: string;
    };
    type: "function";
}

Type declaration

  • function: {
        name: string;
    }
    • name: string
  • type: "function"
tools?: {
    function: {
        description?: string;
        name: string;
        parameters?: object;
    };
    type: "function";
}[]

Type declaration

  • function: {
        description?: string;
        name: string;
        parameters?: object;
    }
    • Optional description?: string
    • name: string
    • Optional parameters?: object
  • type: "function"
top_logprobs?: number
top_p?: number
user?: string