UNPKG

@langchain/community

Version:
1 lines • 5.07 kB
{"version":3,"file":"ibm.d.cts","names":["Embeddings","EmbeddingsParams","WatsonXAI","CreateEmbeddingsParams","Gateway","WatsonxAuth","WatsonxEmbeddingsBasicOptions","XOR","WatsonxEmbeddingsParams","TextEmbeddingsParams","EmbeddingReturnOptions","Omit","WatsonxInputEmbeddings","WatsonxEmbeddingsGatewayKwargs","WatsonxEmbeddingsGatewayParams","WatsonxInputGatewayEmbeddings","WatsonxEmbeddingsConstructor","WatsonxEmbeddings","Promise"],"sources":["../../src/embeddings/ibm.d.ts"],"sourcesContent":["import { Embeddings, EmbeddingsParams } from \"@langchain/core/embeddings\";\nimport { WatsonXAI } from \"@ibm-cloud/watsonx-ai\";\nimport { CreateEmbeddingsParams, Gateway } from \"@ibm-cloud/watsonx-ai/gateway\";\nimport { WatsonxAuth, WatsonxEmbeddingsBasicOptions, XOR } from \"../types/ibm.js\";\nexport interface WatsonxEmbeddingsParams extends EmbeddingsParams, Omit<WatsonXAI.TextEmbeddingsParams, \"modelId\" | \"inputs\" | \"parameters\"> {\n /** Represents the maximum number of input tokens accepted. This can be used to avoid requests failing due to\n * input being longer than configured limits. If the text is truncated, then it truncates the end of the input (on\n * the right), so the start of the input will remain the same. If this value exceeds the `maximum sequence length`\n * (refer to the documentation to find this value for the model) then the call will fail if the total number of\n * tokens exceeds the `maximum sequence length`.\n */\n truncateInputTokens?: number;\n /** The return options for text embeddings. */\n returnOptions?: WatsonXAI.EmbeddingReturnOptions;\n /** The `id` of the model to be used for this request. Please refer to the [list of\n * models](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/fm-models-embed.html?context=wx&audience=wdp).\n */\n model: string;\n}\nexport interface WatsonxInputEmbeddings extends WatsonxEmbeddingsBasicOptions, WatsonxEmbeddingsParams {\n}\nexport type WatsonxEmbeddingsGatewayKwargs = Omit<CreateEmbeddingsParams, \"input\" | keyof WatsonxEmbeddingsParams>;\nexport interface WatsonxEmbeddingsGatewayParams extends EmbeddingsParams {\n modelGatewayKwargs?: WatsonxEmbeddingsGatewayKwargs;\n modelGateway: boolean;\n}\nexport interface WatsonxInputGatewayEmbeddings extends WatsonxEmbeddingsBasicOptions, WatsonxEmbeddingsGatewayParams, Omit<CreateEmbeddingsParams, keyof WatsonxEmbeddingsGatewayKwargs | \"input\"> {\n}\nexport type WatsonxEmbeddingsConstructor = XOR<WatsonxInputEmbeddings, WatsonxInputGatewayEmbeddings> & WatsonxAuth;\nexport declare class WatsonxEmbeddings extends Embeddings implements WatsonxEmbeddingsParams, WatsonxInputGatewayEmbeddings {\n model: string;\n serviceUrl: string;\n version: string;\n spaceId?: string;\n projectId?: string;\n truncateInputTokens?: number;\n returnOptions?: WatsonXAI.EmbeddingReturnOptions;\n maxRetries?: number;\n maxConcurrency: number;\n modelGatewayKwargs?: WatsonxEmbeddingsGatewayKwargs | undefined;\n modelGateway: boolean;\n protected service?: WatsonXAI;\n protected gateway?: Gateway;\n private checkValidProperties;\n constructor(fields: WatsonxEmbeddingsConstructor);\n scopeId(): {\n projectId: string;\n modelId: string;\n } | {\n spaceId: string;\n modelId: string;\n } | {\n model: string;\n };\n invocationParams(): {\n truncate_input_tokens: number | undefined;\n return_options: WatsonXAI.EmbeddingReturnOptions | undefined;\n };\n listModels(): Promise<string[] | undefined>;\n private embedSingleText;\n embedDocuments(documents: string[]): Promise<number[][]>;\n embedQuery(document: string): Promise<number[]>;\n}\n//# sourceMappingURL=ibm.d.ts.map"],"mappings":";;;;;;UAIiBQ,uBAAAA,SAAgCP,kBAAkBU,KAAKT,SAAAA,CAAUO;;AAAlF;;;;;EAAuE,mBAAA,CAAA,EAAA,MAAA;EAetDG;EAELC,aAAAA,CAAAA,EARQX,SAAAA,CAAUQ,sBAQY;EAAQP;;;EAAD,KAAA,EAAA,MAAA;AACjD;AAIiBY,UAPAH,sBAAAA,SAA+BN,6BAOF,EAPiCE,uBAOjC,CAAA;AAA2GK,KAL7IA,8BAAAA,GAAiCF,IAK4GE,CALvGV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