@promptbook/remote-server
Version:
Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action
57 lines (56 loc) • 1.79 kB
TypeScript
import type OpenAI from 'openai';
import type { TODO_any } from '../../utils/organization/TODO_any';
/**
* Type describing Json schema definition entry.
*/
type JsonSchemaDefinitionEntry = {
type?: string;
description?: string;
properties?: Record<string, JsonSchemaDefinitionEntry>;
required?: Array<string>;
items?: JsonSchemaDefinitionEntry;
[key: string]: TODO_any;
};
/**
* Definition of Json schema.
*/
type JsonSchemaDefinition = {
type: 'json_schema';
name: string;
strict: boolean;
schema: {
type: 'object';
properties: Record<string, JsonSchemaDefinitionEntry>;
required: Array<string>;
additionalProperties: boolean;
description?: string;
};
};
/**
* Type describing open Ai chat response format.
*/
type OpenAiChatResponseFormat = OpenAI.Chat.Completions.ChatCompletionCreateParamsNonStreaming['response_format'];
/**
* Maps OpenAI `response_format` payloads to AgentKit output types.
*
* @private helper of `OpenAiAgentKitExecutionTools`
*/
export declare class OpenAiAgentKitExecutionToolsOutputTypeMapper {
/**
* Maps one OpenAI `response_format` payload to the AgentKit output type shape.
*/
static mapResponseFormatToAgentOutputType(responseFormat?: OpenAiChatResponseFormat): 'text' | JsonSchemaDefinition | undefined;
/**
* Determines whether a schema fragment includes meaningful constraints.
*/
private static hasJsonSchemaContent;
/**
* Normalizes inline OpenAI JSON schema payloads to the AgentKit structure.
*/
private static normalizeJsonSchemaInput;
/**
* Builds an AgentKit-compatible JSON schema definition from the supplied payload.
*/
private static buildJsonSchemaDefinition;
}
export {};