Namespace: EmbeddingSimilarity
A scorer that uses cosine similarity to compare two strings.
Param
Param
A prefix to prepend to the prompt. This is useful for specifying the domain of the inputs.
Param
The model to use for the embedding distance. Defaults to "text-embedding-ada-002".
Param
The minimum expected score. Defaults to 0.7. Values below this will be scored as 0, and values between this and 1 will be scaled linearly.
Functions
partial
▸ partial<T>(args): Scorer<string, Omit<{ expectedMin?: number ; model?: string ; prefix?: string } & OpenAIAuth, T> & Partial<Pick<{ expectedMin?: number ; model?: string ; prefix?: string } & OpenAIAuth, T>>>
Type parameters
| Name | Type |
|---|---|
T | extends "prefix" | "expectedMin" | "model" | keyof OpenAIAuth |
Parameters
| Name | Type |
|---|---|
args | { [K in "prefix" | "expectedMin" | "model" | keyof OpenAIAuth]: (Object & OpenAIAuth)[K] } |
Returns
Scorer<string, Omit<{ expectedMin?: number ; model?: string ; prefix?: string } & OpenAIAuth, T> & Partial<Pick<{ expectedMin?: number ; model?: string ; prefix?: string } & OpenAIAuth, T>>>