@qvac/sdk
API reference — v0.7.0
Overview
@qvac/sdk npm package exposes a function-centric, typed JS API.
Functions
| Function | Summary | Signature |
|---|---|---|
cancel() | Cancels an ongoing operation. | cancel(params: infer): Promise |
close() | No description available | close(): Promise |
completion() | Generates completion from a language model based on conversation history. | completion(params: CompletionParams): { stats: Promise<any>; text: Promise<string>; tokenStream: AsyncGenerator<string>; toolCalls: Promise<any[]>; toolCallStream: AsyncGenerator<infer<any>> } |
defineHandler() | Helper function to define a handler with full type inference. | defineHandler(definition: PluginHandlerDefinition): PluginHandlerDefinition |
definePlugin() | Helper function to define a plugin with full type inference. | definePlugin(plugin: T): T |
deleteCache() | Deletes KV cache files. | deleteCache(params: { all: true } | { kvCacheKey: string; modelId?: string }): Promise |
downloadAsset() | Downloads an asset (model file) without loading it into memory. | downloadAsset(options: any): Promise |
embed() | Generates embeddings for a single text using a specified model. | embed(params: { modelId: string; text: string }): Promise |
getLogger() | No description available | getLogger(namespace: string, options?: LoggerOptions): Logger |
getModelByName() | No description available | getModelByName(name: string): RegistryItem | undefined |
getModelByPath() | No description available | getModelByPath(registryPath: string): RegistryItem | undefined |
getModelBySrc() | No description available | getModelBySrc(modelId: string, blobCoreKey: string): RegistryItem | undefined |
getModelInfo() | No description available | getModelInfo(params: input): Promise |
invokePlugin() | Invoke a non-streaming plugin handler. | invokePlugin(options: InvokePluginOptions): Promise |
invokePluginStream() | Invoke a streaming plugin handler. | invokePluginStream(options: InvokePluginOptions): AsyncGenerator |
loadModel() | Loads a machine learning model from a local path, remote URL, or Hyperdrive key. | loadModel(options: any): Promise |
loggingStream() | Opens a logging stream to receive real-time logs. | loggingStream(params: infer): AsyncGenerator |
modelRegistryGetModel() | No description available | modelRegistryGetModel(registryPath: string, registrySource: string): Promise |
modelRegistryList() | No description available | modelRegistryList(): Promise |
modelRegistrySearch() | No description available | modelRegistrySearch(params: ModelRegistrySearchParams): Promise |
ocr() | Performs Optical Character Recognition (OCR) on an image to extract text. | ocr(params: OCRClientParams): { blocks: Promise<infer<any>[]>; blockStream: AsyncGenerator<infer<any>[]>; stats: Promise<any> } |
ping() | Sends a ping request to the server and returns the pong response. | ping(): Promise |
ragChunk() | Chunks documents into smaller pieces for embedding. | ragChunk(params: infer): Promise |
ragCloseWorkspace() | Closes a RAG workspace, releasing in-memory resources (Corestore, HyperDB adapter, RAG instance). | ragCloseWorkspace(params?: any): Promise |
ragDeleteEmbeddings() | Deletes document embeddings from the RAG vector database. | ragDeleteEmbeddings(params: infer): Promise |
ragDeleteWorkspace() | Deletes a RAG workspace and all its data. | ragDeleteWorkspace(params: infer): Promise |
ragIngest() | Ingests documents into the RAG vector database. | ragIngest(params: any): Promise |
ragListWorkspaces() | Lists all RAG workspaces with their open status. | ragListWorkspaces(): Promise |
ragReindex() | Reindexes the RAG database to optimize search performance. | ragReindex(params: any): Promise |
ragSaveEmbeddings() | Saves pre-embedded documents to the RAG vector database. | ragSaveEmbeddings(params: any): Promise |
ragSearch() | Searches for similar documents in the RAG vector database. | ragSearch(params: input): Promise |
startQVACProvider() | Starts a provider service that offers QVAC capabilities to remote peers. | startQVACProvider(params: infer): Promise |
stopQVACProvider() | Stops a running provider service and leaves the specified topic. | stopQVACProvider(params: infer): Promise |
textToSpeech() | No description available | textToSpeech(params: infer): { buffer: Promise<number[]>; bufferStream: AsyncGenerator<number>; done: Promise<boolean> } |
transcribe() | This function provides a simple interface for transcribing audio by | |
| collecting all streaming results into a single string response. | transcribe(params: TranscribeClientParams): Promise | |
transcribeStream() | This function streams audio transcription results in real-time, yielding | |
| text chunks as they become available from the model. | transcribeStream(params: TranscribeClientParams): AsyncGenerator | |
translate() | Translates text from one language to another using a specified translation model. | translate(params: TranslateClientParams): { stats: Promise<any>; text: Promise<string>; tokenStream: AsyncGenerator<string> } |
unloadModel() | Unloads a previously loaded model from the server. | unloadModel(params: input): Promise |