mirror of
https://github.com/andy-stack/vaultkeeper-ai.git
synced 2026-07-22 06:42:03 +00:00
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.
37 lines
626 B
TypeScript
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[];
|
|
};
|
|
};
|
|
}
|