UNPKG

@langchain/community

Version:
1 lines • 2.69 kB
{"version":3,"file":"fireworks.d.cts","names":["Embeddings","EmbeddingsParams","FireworksEmbeddingsParams","CreateFireworksEmbeddingRequest","FireworksEmbeddings","Record","Partial","Promise"],"sources":["../../src/embeddings/fireworks.d.ts"],"sourcesContent":["import { Embeddings, type EmbeddingsParams } from \"@langchain/core/embeddings\";\n/**\n * Interface that extends EmbeddingsParams and defines additional\n * parameters specific to the FireworksEmbeddings class.\n */\nexport interface FireworksEmbeddingsParams extends EmbeddingsParams {\n /**\n * Model name to use.\n */\n model: string;\n /**\n * The maximum number of documents to embed in a single request. This is\n * limited by the Fireworks AI API to a maximum of 8.\n */\n batchSize?: number;\n}\n/**\n * Interface for the request body to generate embeddings.\n */\nexport interface CreateFireworksEmbeddingRequest {\n /**\n * @type {string}\n * @memberof CreateFireworksEmbeddingRequest\n */\n model: string;\n /**\n * Text to generate vector expectation\n * @type {CreateEmbeddingRequestInput}\n * @memberof CreateFireworksEmbeddingRequest\n */\n input: string | string[];\n}\n/**\n * A class for generating embeddings using the Fireworks AI API.\n */\nexport declare class FireworksEmbeddings extends Embeddings implements FireworksEmbeddingsParams {\n model: string;\n batchSize: number;\n private apiKey;\n basePath?: string;\n apiUrl: string;\n headers?: Record<string, string>;\n /**\n * Constructor for the FireworksEmbeddings class.\n * @param fields - An optional object with properties to configure the instance.\n */\n constructor(fields?: Partial<FireworksEmbeddingsParams> & {\n verbose?: boolean;\n apiKey?: string;\n });\n /**\n * Generates embeddings for an array of texts.\n * @param texts - An array of strings to generate embeddings for.\n * @returns A Promise that resolves to an array of embeddings.\n */\n embedDocuments(texts: string[]): Promise<number[][]>;\n /**\n * Generates an embedding for a single text.\n * @param text - A string to generate an embedding for.\n * @returns A Promise that resolves to an array of numbers representing the embedding.\n */\n embedQuery(text: string): Promise<number[]>;\n private embeddingWithRetry;\n}\n//# sourceMappingURL=fireworks.d.ts.map"],"mappings":";;;;;;AAKA;AAcA;AAgBqBI,UA9BJF,yBAAAA,SAAkCD,gBA8BX,CAAA;EAM1BI;;;EAcuBE,KAAAA,EAAAA,MAAAA;EAMPA;;;AA1BkE;;;;;;UAhB/EJ,+BAAAA;;;;;;;;;;;;;;;;cAgBIC,mBAAAA,SAA4BJ,UAAAA,YAAsBE;;;;;;YAMzDG;;;;;uBAKWC,QAAQJ;;;;;;;;;mCASIK;;;;;;4BAMPA"}