UNPKG

ollama-api-facade-js

Version:

OllamaApiFacadeJS is an open-source library for running an ExpressJS backend as an Ollama API using LangChainJS. It supports local language models services like LmStudio and allows seamless message conversion and streaming between LangChainJS and Ollama c

19 lines 795 B
import { Response } from 'express'; import { AIMessageChunk } from '@langchain/core/messages'; import { IterableReadableStream } from '@langchain/core/utils/stream'; /** * Class representing a chat response that streams LangChain data to the client. */ export declare class ChatResponse { private response; constructor(response: Response); /** * Streams LangChain data to the client as a series of chunks. * @param {string | AIMessageChunk | IterableReadableStream<AIMessageChunk>} streamSource - The source of the stream data. */ asStream(streamSource: string | AIMessageChunk | IterableReadableStream<AIMessageChunk>): Promise<void>; private sendStream; private transformStream; private splitIntoChunks; } //# sourceMappingURL=ChatResponse.d.ts.map