fix: support async iterator for AI chat streaming mode in types

This commit is contained in:
Kishan_Singh
2025-10-03 16:38:44 -04:00
committed by Neal Shah
parent 4eab7167e6
commit 1affbb4cc8
+10 -5
View File
@@ -32,11 +32,11 @@ declare class Puter {
// AI Module
interface AI {
chat(prompt: string, options?: ChatOptions): Promise<ChatResponse>;
chat(prompt: string, testMode?: boolean, options?: ChatOptions): Promise<ChatResponse>;
chat(prompt: string, imageURL?: string, testMode?: boolean, options?: ChatOptions): Promise<ChatResponse>;
chat(prompt: string, imageURLArray?: string[], testMode?: boolean, options?: ChatOptions): Promise<ChatResponse>;
chat(messages: ChatMessage[], testMode?: boolean, options?: ChatOptions): Promise<ChatResponse>;
chat(prompt: string, options?: ChatOptions): Promise<ChatResponse> | AsyncIterable<ChatResponseChunk>;
chat(prompt: string, testMode?: boolean, options?: ChatOptions): Promise<ChatResponse> | AsyncIterable<ChatResponseChunk>;
chat(prompt: string, imageURL?: string, testMode?: boolean, options?: ChatOptions): Promise<ChatResponse> | AsyncIterable<ChatResponseChunk>;
chat(prompt: string, imageURLArray?: string[], testMode?: boolean, options?: ChatOptions): Promise<ChatResponse> | AsyncIterable<ChatResponseChunk>;
chat(messages: ChatMessage[], testMode?: boolean, options?: ChatOptions): Promise<ChatResponse> | AsyncIterable<ChatResponseChunk>;
img2txt(image: string | File | Blob, testMode?: boolean): Promise<string>;
@@ -109,6 +109,11 @@ interface Txt2SpeechOptions {
engine?: 'standard' | 'neural' | 'generative';
}
interface ChatResponseChunk {
text?: string;
[key: string]: any;
}
// Apps Module
interface Apps {
create(name: string, indexURL: string): Promise<App>;