openai-tokens-count
Version:
OpenAI tokens calculator with function calls, images, and messages in one call
124 lines (123 loc) • 3.67 kB
TypeScript
export declare const schemas: {
title: string;
type: string;
items: {
type: string;
properties: {
function: {
type: string;
properties: {
name: {
type: string;
};
description: {
type: string;
};
parameters: {
type: string;
};
};
required: string[];
};
type: {
type: string;
enum: string[];
};
};
required: string[];
};
};
export declare const messageSchema: {
title: string;
type: string;
properties: {
role: {
type: string;
};
content: {
oneOf: ({
type: string;
items?: undefined;
} | {
type: string;
items: {
oneOf: ({
type: string;
properties?: undefined;
required?: undefined;
} | {
type: string;
properties: {
type: {
type: string;
enum: string[];
};
text: {
type: string;
};
image_url?: undefined;
};
required: string[];
} | {
type: string;
properties: {
type: {
type: string;
enum: string[];
};
image_url: {
type: string;
properties: {
url: {
type: string;
};
detail: {
type: string;
};
};
required: string[];
};
text?: undefined;
};
required: string[];
})[];
};
})[];
};
refusal: {
type: string[];
};
name: {
type: string;
};
tool_calls: {
type: string;
items: {
type: string;
properties: {
id: {
type: string;
};
function: {
type: string;
properties: {
name: {
type: string;
};
arguments: {
type: string;
};
};
required: string[];
};
type: {
type: string;
enum: string[];
};
};
required: string[];
};
};
};
required: string[];
};