andy-stack_vaultkeeper-ai/AIClasses/OpenAI/OpenAIInterfaces.ts
Andrew Beal 15f1a01e4a Strengthen type safety across AI provider implementations
Replace `any` types with proper TypeScript interfaces and type assertions throughout Claude, Gemini, and OpenAI implementations. Add explicit typing for streaming events, function parameters, and conversation content to improve type checking and reduce runtime errors.
2025-11-10 11:55:19 +00:00

37 lines
626 B
TypeScript

// Type definitions for OpenAI API responses
export interface OpenAIStreamResponse {
choices?: OpenAIChoice[];
}
export interface OpenAIChoice {
delta?: OpenAIDelta;
finish_reason?: string;
}
export interface OpenAIDelta {
content?: string;
tool_calls?: OpenAIToolCallDelta[];
}
export interface OpenAIToolCallDelta {
index: number;
id?: string;
function?: {
name?: string;
arguments?: string;
};
}
export interface OpenAITool {
type: "function";
function: {
name: string;
description: string;
parameters: {
type: string;
properties: Record<string, unknown>;
required?: string[];
};
};
}