Skip to content

Commit

Permalink
feat(typespec,agents-api): Add mmr_strength to typespec
Browse files Browse the repository at this point in the history
Signed-off-by: Diwank Singh Tomer <[email protected]>
  • Loading branch information
creatorrr committed Oct 28, 2024
1 parent 7892cd7 commit 010b1d3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions agents-api/agents_api/autogen/Docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ class BaseDocSearchRequest(BaseModel):
The language to be used for text-only search. Support for other languages coming soon.
"""
metadata_filter: dict[str, float | str | StrictBool | None] = {}
mmr_strength: Annotated[float, Field(0, ge=0.0, lt=1.0)]
"""
MMR Strength (mmr_strength = 1 - mmr_lambda)
"""


class CreateDocRequest(BaseModel):
Expand Down
7 changes: 7 additions & 0 deletions typespec/docs/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ model BaseDocSearchRequest {
/** The language to be used for text-only search. Support for other languages coming soon. */
lang: "en-US" = "en-US";
metadata_filter: MetadataFilter = #{},

/** MMR Strength (mmr_strength = 1 - mmr_lambda) */
@minValue(0)
@maxValueExclusive(1)
mmr_strength?: float = 0.0;
}

model VectorDocSearchRequest extends BaseDocSearchRequest {
Expand All @@ -107,6 +112,8 @@ model VectorDocSearchRequest extends BaseDocSearchRequest {
vector: float[];

text?: never;

mmr_strength?: never;
}

model TextOnlyDocSearchRequest extends BaseDocSearchRequest {
Expand Down
7 changes: 7 additions & 0 deletions typespec/tsp-output/@typespec/openapi3/openapi-1.0.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2450,6 +2450,13 @@ components:
- type: boolean
nullable: true
default: {}
mmr_strength:
type: number
minimum: 0
maximum: 1
exclusiveMaximum: true
description: MMR Strength (mmr_strength = 1 - mmr_lambda)
default: 0
Docs.CreateDocRequest:
type: object
required:
Expand Down

0 comments on commit 010b1d3

Please sign in to comment.