@n8n/n8n-nodes-langchain
Version:

60 lines (54 loc) • 1.85 kB
text/typescript
/**
* Embeddings OpenAI Node - Version 1
* Use Embeddings OpenAI
*/
export interface LcEmbeddingsOpenAiV1Params {
/**
* The model which will generate the embeddings. <a href="https://platform.openai.com/docs/models/overview">Learn more</a>.
* @default text-embedding-ada-002
*/
model?: string | Expression<string>;
/**
* Additional options to add
* @default {}
*/
options?: {
/** The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models.
* @default 1536
*/
dimensions?: 256 | 512 | 1024 | 1536 | 3072 | Expression<number>;
/** Override the default base URL for the API
* @default https://api.openai.com/v1
*/
baseURL?: string | Expression<string> | PlaceholderValue;
/** Maximum number of documents to send in each request
* @default 512
*/
batchSize?: number | Expression<number>;
/** Whether to strip new lines from the input text
* @default true
*/
stripNewLines?: boolean | Expression<boolean>;
/** Maximum amount of time a request is allowed to take in seconds. Set to -1 for no timeout.
* @default -1
*/
timeout?: number | Expression<number>;
/** The format to return the embeddings in
* @default float
*/
encodingFormat?: 'float' | 'base64' | Expression<string>;
};
}
export interface LcEmbeddingsOpenAiV1Credentials {
openAiApi: CredentialReference;
}
interface LcEmbeddingsOpenAiV1NodeBase {
type: '@n8n/n8n-nodes-langchain.embeddingsOpenAi';
version: 1;
credentials?: LcEmbeddingsOpenAiV1Credentials;
isTrigger: true;
}
export type LcEmbeddingsOpenAiV1ParamsNode = LcEmbeddingsOpenAiV1NodeBase & {
config: NodeConfig<LcEmbeddingsOpenAiV1Params>;
};
export type LcEmbeddingsOpenAiV1Node = LcEmbeddingsOpenAiV1ParamsNode;