@ifzai/connect2dify
Version:
A comprehensive TypeScript client for the Dify API, providing a clean and modular interface for chat, workflow, file management, and application interactions.
39 lines (38 loc) • 1.46 kB
TypeScript
/**
* Application info and completion-related API methods for Dify client
*/
import type { AppInfo, AppMeta, AppParameters, CompletionMessageChunkResponse, CompletionMessageResponse, DifyConfiguration, SendCompletionMessageParams, StopCompletionMessageParams, StopCompletionMessageResult } from './types.js';
/**
* Application and Completion API methods
*/
export declare class AppAPI {
private config;
constructor(config: DifyConfiguration);
/**
* Get application parameters
* @returns Promise resolving to app parameters
*/
getParameters(): Promise<AppParameters>;
/**
* Get application basic information
* @returns Promise resolving to app info
*/
getInfo(): Promise<AppInfo>;
/**
* Get application meta information (tool icons, etc.)
* @returns Promise resolving to app meta
*/
getMeta(): Promise<AppMeta>;
/**
* Send a completion message (text generation)
* @param params - Completion parameters
* @returns Promise resolving to completion response or stream chunks
*/
sendCompletionMessage(params: SendCompletionMessageParams): Promise<CompletionMessageResponse | CompletionMessageChunkResponse[]>;
/**
* Stop a completion message stream
* @param params - Stop parameters
* @returns Promise resolving to stop result
*/
stopCompletionMessage(params: StopCompletionMessageParams): Promise<StopCompletionMessageResult>;
}