diff --git a/output/schema/schema.json b/output/schema/schema.json index ffcf25fed..f029deb7a 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -45906,7 +45906,7 @@ } } ], - "specLocation": "_types/Retriever.ts#L58-L71" + "specLocation": "_types/Retriever.ts#L62-L75" }, { "kind": "interface", @@ -47413,7 +47413,7 @@ } } ], - "specLocation": "_types/Retriever.ts#L73-L80" + "specLocation": "_types/Retriever.ts#L77-L84" }, { "kind": "interface", @@ -47840,7 +47840,7 @@ } } ], - "specLocation": "_types/Retriever.ts#L38-L41" + "specLocation": "_types/Retriever.ts#L42-L45" }, { "kind": "interface", @@ -47884,9 +47884,21 @@ "namespace": "_types" } } + }, + { + "description": "A retriever that replaces the functionality of a rule query.", + "name": "rule", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "RuleRetriever", + "namespace": "_types" + } + } } ], - "specLocation": "_types/Retriever.ts#L26-L36", + "specLocation": "_types/Retriever.ts#L28-L40", "variants": { "kind": "container" } @@ -47946,6 +47958,69 @@ ], "specLocation": "_types/Rank.ts#L32-L37" }, + { + "kind": "interface", + "inherits": { + "type": { + "name": "RetrieverBase", + "namespace": "_types" + } + }, + "name": { + "name": "RuleRetriever", + "namespace": "_types" + }, + "properties": [ + { + "description": "The ruleset IDs containing the rules this retriever is evaluating against.", + "name": "ruleset_ids", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "Id", + "namespace": "_types" + } + } + } + }, + { + "description": "The match criteria that will determine if a rule in the provided rulesets should be applied.", + "name": "match_criteria", + "required": true, + "type": { + "kind": "user_defined_value" + } + }, + { + "description": "The retriever whose results rules should be applied to.", + "name": "retriever", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "RetrieverContainer", + "namespace": "_types" + } + } + }, + { + "description": "This value determines the size of the individual result set.", + "name": "rank_window_size", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + } + ], + "specLocation": "_types/Retriever.ts#L86-L95" + }, { "kind": "type_alias", "codegenNames": [ @@ -49547,7 +49622,7 @@ } } ], - "specLocation": "_types/Retriever.ts#L43-L56" + "specLocation": "_types/Retriever.ts#L47-L60" }, { "kind": "interface", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 5864413f9..9d164b51b 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -2703,6 +2703,7 @@ export interface RetrieverContainer { standard?: StandardRetriever knn?: KnnRetriever rrf?: RRFRetriever + rule?: RuleRetriever } export type Routing = string @@ -2712,6 +2713,13 @@ export interface RrfRank { rank_window_size?: long } +export interface RuleRetriever extends RetrieverBase { + ruleset_ids: Id[] + match_criteria: any + retriever: RetrieverContainer + rank_window_size?: integer +} + export type ScalarValue = long | double | string | boolean | null export interface ScoreSort { diff --git a/specification/_types/Retriever.ts b/specification/_types/Retriever.ts index 511803392..3b39cf7b5 100644 --- a/specification/_types/Retriever.ts +++ b/specification/_types/Retriever.ts @@ -18,9 +18,11 @@ */ import { FieldCollapse } from '@global/search/_types/FieldCollapse' +import { UserDefinedValue } from '@spec_utils/UserDefinedValue' import { QueryVector, QueryVectorBuilder } from '@_types/Knn' import { float, integer } from '@_types/Numeric' import { Sort, SortResults } from '@_types/sort' +import { Id } from './common' import { QueryContainer } from './query_dsl/abstractions' /** @@ -33,6 +35,8 @@ export class RetrieverContainer { knn?: KnnRetriever /** A retriever that produces top documents from reciprocal rank fusion (RRF). */ rrf?: RRFRetriever + /** A retriever that replaces the functionality of a rule query. */ + rule?: RuleRetriever } export class RetrieverBase { @@ -78,3 +82,14 @@ export class RRFRetriever extends RetrieverBase { /** This value determines the size of the individual result sets per query. */ rank_window_size?: integer } + +export class RuleRetriever extends RetrieverBase { + /** The ruleset IDs containing the rules this retriever is evaluating against. */ + ruleset_ids: Id[] + /** The match criteria that will determine if a rule in the provided rulesets should be applied. */ + match_criteria: UserDefinedValue + /** The retriever whose results rules should be applied to. */ + retriever: RetrieverContainer + /** This value determines the size of the individual result set. */ + rank_window_size?: integer +}