@squidcloud/client
Version:
A typescript implementation of the Squid client
69 lines (68 loc) • 2.56 kB
TypeScript
import { Observable } from 'rxjs';
import { AiAnnotation, AiChatModelSelection, AiChatOptions } from '../../../internal-common/src/public-types/ai-agent.public-types';
/**
* Response format for transcribing audio and generating a chat response.
* Contains the transcribed text and a stream of AI-generated responses.
* @category AI
*/
export interface TranscribeAndChatResponse {
/** Transcribed text from the audio input. */
transcribedPrompt: string;
/** Stream of AI-generated responses. */
responseStream: Observable<string>;
}
/**
* Response format for transcribing audio and generating a text and voice response.
* Includes the transcribed prompt, the AI-generated response as text, and an audio file.
* @category AI
*/
export interface TranscribeAndAskWithVoiceResponse {
/** Transcribed text from the audio input. */
transcribedPrompt: string;
/** AI-generated response as a string. */
responseString: string;
/** AI-generated voice response as an audio file. */
voiceResponseFile: File;
}
/**
* Response from an AI agent when asked a question or given a task.
* @category AI
*/
export interface AskResponse {
/** The main text response from the AI agent. */
responseString: string;
/** Optional annotations that provide additional context or metadata about the response. */
annotations?: Record<string, AiAnnotation>;
}
/**
* Response format for AI-generated voice responses.
* Contains the AI-generated text response and the corresponding audio file.
* @category AI
*/
export interface AskWithVoiceResponse {
/** AI-generated response as a string. */
responseString: string;
/** AI-generated voice response as an audio file. */
voiceResponseFile: File;
}
/**
* Chat options that exclude voice-specific configurations.
* @category AI
*/
export type AiChatOptionsWithoutVoice<T extends AiChatModelSelection | undefined = undefined> = Omit<AiChatOptions<T>, 'voiceOptions'> & {
model?: T;
};
/**
* Options for AI-generated responses that exclude voice-specific settings and smooth typing behavior.
* @category AI
*/
export type AiAskOptions<T extends AiChatModelSelection | undefined = undefined> = Omit<AiChatOptions<T>, 'voiceOptions' | 'smoothTyping'> & {
model?: T;
};
/**
* Options for AI-generated responses that include voice-specific settings but excludes smooth typing.
* @category AI
*/
export type AiAskOptionsWithVoice<T extends AiChatModelSelection | undefined = undefined> = Omit<AiChatOptions<T>, 'smoothTyping'> & {
model?: T;
};