diff --git a/agents-api/agents_api/autogen/Docs.py b/agents-api/agents_api/autogen/Docs.py
index b9da3646d..36d0c5a95 100644
--- a/agents-api/agents_api/autogen/Docs.py
+++ b/agents-api/agents_api/autogen/Docs.py
@@ -13,18 +13,7 @@ class BaseDocSearchRequest(BaseModel):
model_config = ConfigDict(
populate_by_name=True,
)
- confidence: Annotated[float, Field(0.5, ge=0.0, le=1.0)]
- """
- The confidence cutoff level
- """
- alpha: Annotated[float, Field(0.75, ge=0.0, le=1.0)]
- """
- The weight to apply to BM25 vs Vector search results. 0 => pure BM25; 1 => pure vector;
- """
- mmr: bool = False
- """
- Whether to include the MMR algorithm in the search. Optimizes for diversity in search results.
- """
+ limit: Annotated[int, Field(10, ge=1, le=100)]
lang: Literal["en-US"] = "en-US"
"""
The language to be used for text-only search. Support for other languages coming soon.
@@ -105,6 +94,20 @@ class DocReference(BaseModel):
distance: float | None = None
+class DocSearchResponse(BaseModel):
+ model_config = ConfigDict(
+ populate_by_name=True,
+ )
+ docs: list[DocReference]
+ """
+ The documents that were found
+ """
+ time: Annotated[float, Field(gt=0.0)]
+ """
+ The time taken to search in seconds
+ """
+
+
class EmbedQueryRequest(BaseModel):
model_config = ConfigDict(
populate_by_name=True,
@@ -129,6 +132,14 @@ class HybridDocSearchRequest(BaseDocSearchRequest):
model_config = ConfigDict(
populate_by_name=True,
)
+ confidence: Annotated[float, Field(0.5, ge=0.0, le=1.0)]
+ """
+ The confidence cutoff level
+ """
+ alpha: Annotated[float, Field(0.75, ge=0.0, le=1.0)]
+ """
+ The weight to apply to BM25 vs Vector search results. 0 => pure BM25; 1 => pure vector;
+ """
text: str
"""
Text to use in the search. In `hybrid` search mode, either `text` or both `text` and `vector` fields are required.
@@ -161,6 +172,10 @@ class VectorDocSearchRequest(BaseDocSearchRequest):
model_config = ConfigDict(
populate_by_name=True,
)
+ confidence: Annotated[float, Field(0.5, ge=0.0, le=1.0)]
+ """
+ The confidence cutoff level
+ """
vector: list[float]
"""
Vector to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown.
diff --git a/agents-api/agents_api/models/docs/search_docs_hybrid.py b/agents-api/agents_api/models/docs/search_docs_hybrid.py
index b9d6a1ec0..82f550ac9 100644
--- a/agents-api/agents_api/models/docs/search_docs_hybrid.py
+++ b/agents-api/agents_api/models/docs/search_docs_hybrid.py
@@ -97,6 +97,7 @@ def search_docs_hybrid(
query: str,
query_embedding: list[float],
k: int = 3,
+ alpha: float = 0.7, # Weight of the embedding search results (this is a good default)
embed_search_options: dict = {},
text_search_options: dict = {},
**kwargs,
@@ -122,4 +123,4 @@ def search_docs_hybrid(
**kwargs,
)
- return dbsf_fuse(text_results, embedding_results)[:k]
+ return dbsf_fuse(text_results, embedding_results, alpha)[:k]
diff --git a/agents-api/agents_api/routers/docs/__init__.py b/agents-api/agents_api/routers/docs/__init__.py
index 062db6a67..2db2d042a 100644
--- a/agents-api/agents_api/routers/docs/__init__.py
+++ b/agents-api/agents_api/routers/docs/__init__.py
@@ -4,3 +4,4 @@
from .get_doc import get_doc
from .list_docs import list_agent_docs, list_user_docs
from .router import router
+from .search_docs import search_agent_docs, search_user_docs
diff --git a/agents-api/agents_api/routers/docs/search_docs.py b/agents-api/agents_api/routers/docs/search_docs.py
new file mode 100644
index 000000000..8de06dd17
--- /dev/null
+++ b/agents-api/agents_api/routers/docs/search_docs.py
@@ -0,0 +1,111 @@
+import time
+from typing import Annotated
+
+from fastapi import Depends
+from pydantic import UUID4
+
+from ...autogen.openapi_model import (
+ DocSearchResponse,
+ HybridDocSearchRequest,
+ TextOnlyDocSearchRequest,
+ VectorDocSearchRequest,
+)
+from ...dependencies.developer_id import get_developer_id
+from ...models.docs.search_docs_by_embedding import search_docs_by_embedding
+from ...models.docs.search_docs_by_text import search_docs_by_text
+from ...models.docs.search_docs_hybrid import search_docs_hybrid
+from .router import router
+
+
+def get_search_fn_and_params(search_params):
+ search_fn, params = None, None
+
+ match search_params:
+ case TextOnlyDocSearchRequest(text=query, limit=k):
+ search_fn = search_docs_by_text
+ params = dict(
+ query=query,
+ k=k,
+ )
+
+ case VectorDocSearchRequest(
+ vector=query_embedding, limit=k, confidence=confidence
+ ):
+ search_fn = search_docs_by_embedding
+ params = dict(
+ query_embedding=query_embedding,
+ k=k,
+ confidence=confidence,
+ )
+
+ case HybridDocSearchRequest(
+ text=query,
+ vector=query_embedding,
+ limit=k,
+ confidence=confidence,
+ alpha=alpha,
+ ):
+ search_fn = search_docs_hybrid
+ params = dict(
+ query=query,
+ query_embedding=query_embedding,
+ k=k,
+ embed_search_options=dict(confidence=confidence),
+ alpha=alpha,
+ )
+
+ return search_fn, params
+
+
+@router.post("/users/{user_id}/search", tags=["docs"])
+async def search_user_docs(
+ x_developer_id: Annotated[UUID4, Depends(get_developer_id)],
+ search_params: (
+ TextOnlyDocSearchRequest | VectorDocSearchRequest | HybridDocSearchRequest
+ ),
+ user_id: UUID4,
+) -> DocSearchResponse:
+ search_fn, params = get_search_fn_and_params(search_params)
+
+ start = time.time()
+ docs = search_fn(
+ developer_id=x_developer_id,
+ owner_type="user",
+ owner_id=user_id,
+ **params,
+ )
+ end = time.time()
+
+ time_taken = end - start
+
+ return DocSearchResponse(
+ docs=docs,
+ time=time_taken,
+ )
+
+
+@router.post("/agents/{agent_id}/search", tags=["docs"])
+async def search_agent_docs(
+ x_developer_id: Annotated[UUID4, Depends(get_developer_id)],
+ search_params: (
+ TextOnlyDocSearchRequest | VectorDocSearchRequest | HybridDocSearchRequest
+ ),
+ agent_id: UUID4,
+) -> DocSearchResponse:
+ search_fn, params = get_search_fn_and_params(search_params)
+
+ start = time.time()
+ docs = search_fn(
+ developer_id=x_developer_id,
+ owner_type="agent",
+ owner_id=agent_id,
+ **params,
+ )
+ end = time.time()
+
+ time_taken = end - start
+
+ return DocSearchResponse(
+ docs=docs,
+ time=time_taken,
+ )
diff --git a/sdks/python/julep/api/__init__.py b/sdks/python/julep/api/__init__.py
index fbcacb597..30f156d29 100644
--- a/sdks/python/julep/api/__init__.py
+++ b/sdks/python/julep/api/__init__.py
@@ -14,9 +14,6 @@
AgentsCreateAgentRequestDefaultSettings,
AgentsCreateAgentRequestInstructions,
AgentsDocsSearchRouteSearchRequestBody,
- AgentsDocsSearchRouteSearchRequestDirection,
- AgentsDocsSearchRouteSearchRequestSortBy,
- AgentsDocsSearchRouteSearchResponse,
AgentsPatchAgentRequestDefaultSettings,
AgentsPatchAgentRequestInstructions,
AgentsRouteListRequestDirection,
@@ -70,6 +67,7 @@
DocsDocOwner,
DocsDocOwnerRole,
DocsDocReference,
+ DocsDocSearchResponse,
DocsEmbedQueryRequest,
DocsEmbedQueryRequestText,
DocsEmbedQueryResponse,
@@ -210,9 +208,6 @@
UserDocsRouteListRequestSortBy,
UserDocsRouteListResponse,
UserDocsSearchRouteSearchRequestBody,
- UserDocsSearchRouteSearchRequestDirection,
- UserDocsSearchRouteSearchRequestSortBy,
- UserDocsSearchRouteSearchResponse,
UsersRouteListRequestDirection,
UsersRouteListRequestSortBy,
UsersRouteListResponse,
@@ -235,9 +230,6 @@
"AgentsCreateAgentRequestDefaultSettings",
"AgentsCreateAgentRequestInstructions",
"AgentsDocsSearchRouteSearchRequestBody",
- "AgentsDocsSearchRouteSearchRequestDirection",
- "AgentsDocsSearchRouteSearchRequestSortBy",
- "AgentsDocsSearchRouteSearchResponse",
"AgentsPatchAgentRequestDefaultSettings",
"AgentsPatchAgentRequestInstructions",
"AgentsRouteListRequestDirection",
@@ -291,6 +283,7 @@
"DocsDocOwner",
"DocsDocOwnerRole",
"DocsDocReference",
+ "DocsDocSearchResponse",
"DocsEmbedQueryRequest",
"DocsEmbedQueryRequestText",
"DocsEmbedQueryResponse",
@@ -432,9 +425,6 @@
"UserDocsRouteListRequestSortBy",
"UserDocsRouteListResponse",
"UserDocsSearchRouteSearchRequestBody",
- "UserDocsSearchRouteSearchRequestDirection",
- "UserDocsSearchRouteSearchRequestSortBy",
- "UserDocsSearchRouteSearchResponse",
"UsersRouteListRequestDirection",
"UsersRouteListRequestSortBy",
"UsersRouteListResponse",
diff --git a/sdks/python/julep/api/client.py b/sdks/python/julep/api/client.py
index f8eb4cae5..207aa7c32 100644
--- a/sdks/python/julep/api/client.py
+++ b/sdks/python/julep/api/client.py
@@ -33,15 +33,6 @@
from .types.agents_docs_search_route_search_request_body import (
AgentsDocsSearchRouteSearchRequestBody,
)
-from .types.agents_docs_search_route_search_request_direction import (
- AgentsDocsSearchRouteSearchRequestDirection,
-)
-from .types.agents_docs_search_route_search_request_sort_by import (
- AgentsDocsSearchRouteSearchRequestSortBy,
-)
-from .types.agents_docs_search_route_search_response import (
- AgentsDocsSearchRouteSearchResponse,
-)
from .types.agents_patch_agent_request_default_settings import (
AgentsPatchAgentRequestDefaultSettings,
)
@@ -69,6 +60,7 @@
from .types.common_valid_python_identifier import CommonValidPythonIdentifier
from .types.docs_create_doc_request_content import DocsCreateDocRequestContent
from .types.docs_doc import DocsDoc
+from .types.docs_doc_search_response import DocsDocSearchResponse
from .types.docs_embed_query_request import DocsEmbedQueryRequest
from .types.docs_embed_query_response import DocsEmbedQueryResponse
from .types.entries_history import EntriesHistory
@@ -116,15 +108,6 @@
from .types.user_docs_search_route_search_request_body import (
UserDocsSearchRouteSearchRequestBody,
)
-from .types.user_docs_search_route_search_request_direction import (
- UserDocsSearchRouteSearchRequestDirection,
-)
-from .types.user_docs_search_route_search_request_sort_by import (
- UserDocsSearchRouteSearchRequestSortBy,
-)
-from .types.user_docs_search_route_search_response import (
- UserDocsSearchRouteSearchResponse,
-)
from .types.users_route_list_request_direction import UsersRouteListRequestDirection
from .types.users_route_list_request_sort_by import UsersRouteListRequestSortBy
from .types.users_route_list_response import UsersRouteListResponse
@@ -842,14 +825,9 @@ def agents_docs_search_route_search(
self,
id: CommonUuid,
*,
- limit: CommonLimit,
- offset: CommonOffset,
- sort_by: AgentsDocsSearchRouteSearchRequestSortBy,
- direction: AgentsDocsSearchRouteSearchRequestDirection,
- metadata_filter: str,
body: AgentsDocsSearchRouteSearchRequestBody,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AgentsDocsSearchRouteSearchResponse:
+ ) -> DocsDocSearchResponse:
"""
Search Docs owned by an Agent
@@ -858,21 +836,6 @@ def agents_docs_search_route_search(
id : CommonUuid
ID of the parent
- limit : CommonLimit
- Limit the number of items returned
-
- offset : CommonOffset
- Offset the items returned
-
- sort_by : AgentsDocsSearchRouteSearchRequestSortBy
- Sort by a field
-
- direction : AgentsDocsSearchRouteSearchRequestDirection
- Sort direction
-
- metadata_filter : str
- JSON string of object that should be used to filter objects by metadata
-
body : AgentsDocsSearchRouteSearchRequestBody
request_options : typing.Optional[RequestOptions]
@@ -880,7 +843,7 @@ def agents_docs_search_route_search(
Returns
-------
- AgentsDocsSearchRouteSearchResponse
+ DocsDocSearchResponse
The request has succeeded.
Examples
@@ -894,15 +857,9 @@ def agents_docs_search_route_search(
)
client.agents_docs_search_route_search(
id="id",
- limit=1,
- offset=1,
- sort_by="created_at",
- direction="asc",
- metadata_filter="metadata_filter",
body=DocsVectorDocSearchRequest(
+ limit=1,
confidence=1.1,
- alpha=1.1,
- mmr=True,
vector=[1.1],
),
)
@@ -910,20 +867,13 @@ def agents_docs_search_route_search(
_response = self._client_wrapper.httpx_client.request(
f"agents/{jsonable_encoder(id)}/search",
method="POST",
- params={
- "limit": limit,
- "offset": offset,
- "sort_by": sort_by,
- "direction": direction,
- "metadata_filter": metadata_filter,
- },
json={"body": body},
request_options=request_options,
omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
- return pydantic_v1.parse_obj_as(AgentsDocsSearchRouteSearchResponse, _response.json()) # type: ignore
+ return pydantic_v1.parse_obj_as(DocsDocSearchResponse, _response.json()) # type: ignore
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -3552,14 +3502,9 @@ def user_docs_search_route_search(
self,
id: CommonUuid,
*,
- limit: CommonLimit,
- offset: CommonOffset,
- sort_by: UserDocsSearchRouteSearchRequestSortBy,
- direction: UserDocsSearchRouteSearchRequestDirection,
- metadata_filter: str,
body: UserDocsSearchRouteSearchRequestBody,
request_options: typing.Optional[RequestOptions] = None,
- ) -> UserDocsSearchRouteSearchResponse:
+ ) -> DocsDocSearchResponse:
"""
Search Docs owned by a User
@@ -3568,21 +3513,6 @@ def user_docs_search_route_search(
id : CommonUuid
ID of the parent
- limit : CommonLimit
- Limit the number of items returned
-
- offset : CommonOffset
- Offset the items returned
-
- sort_by : UserDocsSearchRouteSearchRequestSortBy
- Sort by a field
-
- direction : UserDocsSearchRouteSearchRequestDirection
- Sort direction
-
- metadata_filter : str
- JSON string of object that should be used to filter objects by metadata
-
body : UserDocsSearchRouteSearchRequestBody
request_options : typing.Optional[RequestOptions]
@@ -3590,7 +3520,7 @@ def user_docs_search_route_search(
Returns
-------
- UserDocsSearchRouteSearchResponse
+ DocsDocSearchResponse
The request has succeeded.
Examples
@@ -3604,15 +3534,9 @@ def user_docs_search_route_search(
)
client.user_docs_search_route_search(
id="id",
- limit=1,
- offset=1,
- sort_by="created_at",
- direction="asc",
- metadata_filter="metadata_filter",
body=DocsVectorDocSearchRequest(
+ limit=1,
confidence=1.1,
- alpha=1.1,
- mmr=True,
vector=[1.1],
),
)
@@ -3620,20 +3544,13 @@ def user_docs_search_route_search(
_response = self._client_wrapper.httpx_client.request(
f"users/{jsonable_encoder(id)}/search",
method="POST",
- params={
- "limit": limit,
- "offset": offset,
- "sort_by": sort_by,
- "direction": direction,
- "metadata_filter": metadata_filter,
- },
json={"body": body},
request_options=request_options,
omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
- return pydantic_v1.parse_obj_as(UserDocsSearchRouteSearchResponse, _response.json()) # type: ignore
+ return pydantic_v1.parse_obj_as(DocsDocSearchResponse, _response.json()) # type: ignore
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -4420,14 +4337,9 @@ async def agents_docs_search_route_search(
self,
id: CommonUuid,
*,
- limit: CommonLimit,
- offset: CommonOffset,
- sort_by: AgentsDocsSearchRouteSearchRequestSortBy,
- direction: AgentsDocsSearchRouteSearchRequestDirection,
- metadata_filter: str,
body: AgentsDocsSearchRouteSearchRequestBody,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AgentsDocsSearchRouteSearchResponse:
+ ) -> DocsDocSearchResponse:
"""
Search Docs owned by an Agent
@@ -4436,21 +4348,6 @@ async def agents_docs_search_route_search(
id : CommonUuid
ID of the parent
- limit : CommonLimit
- Limit the number of items returned
-
- offset : CommonOffset
- Offset the items returned
-
- sort_by : AgentsDocsSearchRouteSearchRequestSortBy
- Sort by a field
-
- direction : AgentsDocsSearchRouteSearchRequestDirection
- Sort direction
-
- metadata_filter : str
- JSON string of object that should be used to filter objects by metadata
-
body : AgentsDocsSearchRouteSearchRequestBody
request_options : typing.Optional[RequestOptions]
@@ -4458,7 +4355,7 @@ async def agents_docs_search_route_search(
Returns
-------
- AgentsDocsSearchRouteSearchResponse
+ DocsDocSearchResponse
The request has succeeded.
Examples
@@ -4477,15 +4374,9 @@ async def agents_docs_search_route_search(
async def main() -> None:
await client.agents_docs_search_route_search(
id="id",
- limit=1,
- offset=1,
- sort_by="created_at",
- direction="asc",
- metadata_filter="metadata_filter",
body=DocsVectorDocSearchRequest(
+ limit=1,
confidence=1.1,
- alpha=1.1,
- mmr=True,
vector=[1.1],
),
)
@@ -4496,20 +4387,13 @@ async def main() -> None:
_response = await self._client_wrapper.httpx_client.request(
f"agents/{jsonable_encoder(id)}/search",
method="POST",
- params={
- "limit": limit,
- "offset": offset,
- "sort_by": sort_by,
- "direction": direction,
- "metadata_filter": metadata_filter,
- },
json={"body": body},
request_options=request_options,
omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
- return pydantic_v1.parse_obj_as(AgentsDocsSearchRouteSearchResponse, _response.json()) # type: ignore
+ return pydantic_v1.parse_obj_as(DocsDocSearchResponse, _response.json()) # type: ignore
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -7458,14 +7342,9 @@ async def user_docs_search_route_search(
self,
id: CommonUuid,
*,
- limit: CommonLimit,
- offset: CommonOffset,
- sort_by: UserDocsSearchRouteSearchRequestSortBy,
- direction: UserDocsSearchRouteSearchRequestDirection,
- metadata_filter: str,
body: UserDocsSearchRouteSearchRequestBody,
request_options: typing.Optional[RequestOptions] = None,
- ) -> UserDocsSearchRouteSearchResponse:
+ ) -> DocsDocSearchResponse:
"""
Search Docs owned by a User
@@ -7474,21 +7353,6 @@ async def user_docs_search_route_search(
id : CommonUuid
ID of the parent
- limit : CommonLimit
- Limit the number of items returned
-
- offset : CommonOffset
- Offset the items returned
-
- sort_by : UserDocsSearchRouteSearchRequestSortBy
- Sort by a field
-
- direction : UserDocsSearchRouteSearchRequestDirection
- Sort direction
-
- metadata_filter : str
- JSON string of object that should be used to filter objects by metadata
-
body : UserDocsSearchRouteSearchRequestBody
request_options : typing.Optional[RequestOptions]
@@ -7496,7 +7360,7 @@ async def user_docs_search_route_search(
Returns
-------
- UserDocsSearchRouteSearchResponse
+ DocsDocSearchResponse
The request has succeeded.
Examples
@@ -7515,15 +7379,9 @@ async def user_docs_search_route_search(
async def main() -> None:
await client.user_docs_search_route_search(
id="id",
- limit=1,
- offset=1,
- sort_by="created_at",
- direction="asc",
- metadata_filter="metadata_filter",
body=DocsVectorDocSearchRequest(
+ limit=1,
confidence=1.1,
- alpha=1.1,
- mmr=True,
vector=[1.1],
),
)
@@ -7534,20 +7392,13 @@ async def main() -> None:
_response = await self._client_wrapper.httpx_client.request(
f"users/{jsonable_encoder(id)}/search",
method="POST",
- params={
- "limit": limit,
- "offset": offset,
- "sort_by": sort_by,
- "direction": direction,
- "metadata_filter": metadata_filter,
- },
json={"body": body},
request_options=request_options,
omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
- return pydantic_v1.parse_obj_as(UserDocsSearchRouteSearchResponse, _response.json()) # type: ignore
+ return pydantic_v1.parse_obj_as(DocsDocSearchResponse, _response.json()) # type: ignore
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, body=_response.text)
diff --git a/sdks/python/julep/api/reference.md b/sdks/python/julep/api/reference.md
index 77af661e3..c7b27f1a6 100644
--- a/sdks/python/julep/api/reference.md
+++ b/sdks/python/julep/api/reference.md
@@ -976,15 +976,9 @@ client = JulepApi(
)
client.agents_docs_search_route_search(
id="id",
- limit=1,
- offset=1,
- sort_by="created_at",
- direction="asc",
- metadata_filter="metadata_filter",
body=DocsVectorDocSearchRequest(
+ limit=1,
confidence=1.1,
- alpha=1.1,
- mmr=True,
vector=[1.1],
),
)
@@ -1011,46 +1005,6 @@ client.agents_docs_search_route_search(
-
-**limit:** `CommonLimit` — Limit the number of items returned
-
-
-
-
-
--
-
-**offset:** `CommonOffset` — Offset the items returned
-
-
-
-
-
--
-
-**sort_by:** `AgentsDocsSearchRouteSearchRequestSortBy` — Sort by a field
-
-
-
-
-
--
-
-**direction:** `AgentsDocsSearchRouteSearchRequestDirection` — Sort direction
-
-
-
-
-
--
-
-**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata
-
-
-
-
-
--
-
**body:** `AgentsDocsSearchRouteSearchRequestBody`
@@ -5098,15 +5052,9 @@ client = JulepApi(
)
client.user_docs_search_route_search(
id="id",
- limit=1,
- offset=1,
- sort_by="created_at",
- direction="asc",
- metadata_filter="metadata_filter",
body=DocsVectorDocSearchRequest(
+ limit=1,
confidence=1.1,
- alpha=1.1,
- mmr=True,
vector=[1.1],
),
)
@@ -5133,46 +5081,6 @@ client.user_docs_search_route_search(
-
-**limit:** `CommonLimit` — Limit the number of items returned
-
-
-
-
-
--
-
-**offset:** `CommonOffset` — Offset the items returned
-
-
-
-
-
--
-
-**sort_by:** `UserDocsSearchRouteSearchRequestSortBy` — Sort by a field
-
-
-
-
-
--
-
-**direction:** `UserDocsSearchRouteSearchRequestDirection` — Sort direction
-
-
-
-
-
--
-
-**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata
-
-
-
-
-
--
-
**body:** `UserDocsSearchRouteSearchRequestBody`
diff --git a/sdks/python/julep/api/types/__init__.py b/sdks/python/julep/api/types/__init__.py
index 6da79d6ab..a2ab207d0 100644
--- a/sdks/python/julep/api/types/__init__.py
+++ b/sdks/python/julep/api/types/__init__.py
@@ -21,15 +21,6 @@
from .agents_docs_search_route_search_request_body import (
AgentsDocsSearchRouteSearchRequestBody,
)
-from .agents_docs_search_route_search_request_direction import (
- AgentsDocsSearchRouteSearchRequestDirection,
-)
-from .agents_docs_search_route_search_request_sort_by import (
- AgentsDocsSearchRouteSearchRequestSortBy,
-)
-from .agents_docs_search_route_search_response import (
- AgentsDocsSearchRouteSearchResponse,
-)
from .agents_patch_agent_request_default_settings import (
AgentsPatchAgentRequestDefaultSettings,
)
@@ -97,6 +88,7 @@
from .docs_doc_owner import DocsDocOwner
from .docs_doc_owner_role import DocsDocOwnerRole
from .docs_doc_reference import DocsDocReference
+from .docs_doc_search_response import DocsDocSearchResponse
from .docs_embed_query_request import DocsEmbedQueryRequest
from .docs_embed_query_request_text import DocsEmbedQueryRequestText
from .docs_embed_query_response import DocsEmbedQueryResponse
@@ -274,13 +266,6 @@
from .user_docs_search_route_search_request_body import (
UserDocsSearchRouteSearchRequestBody,
)
-from .user_docs_search_route_search_request_direction import (
- UserDocsSearchRouteSearchRequestDirection,
-)
-from .user_docs_search_route_search_request_sort_by import (
- UserDocsSearchRouteSearchRequestSortBy,
-)
-from .user_docs_search_route_search_response import UserDocsSearchRouteSearchResponse
from .users_route_list_request_direction import UsersRouteListRequestDirection
from .users_route_list_request_sort_by import UsersRouteListRequestSortBy
from .users_route_list_response import UsersRouteListResponse
@@ -301,9 +286,6 @@
"AgentsCreateAgentRequestDefaultSettings",
"AgentsCreateAgentRequestInstructions",
"AgentsDocsSearchRouteSearchRequestBody",
- "AgentsDocsSearchRouteSearchRequestDirection",
- "AgentsDocsSearchRouteSearchRequestSortBy",
- "AgentsDocsSearchRouteSearchResponse",
"AgentsPatchAgentRequestDefaultSettings",
"AgentsPatchAgentRequestInstructions",
"AgentsRouteListRequestDirection",
@@ -357,6 +339,7 @@
"DocsDocOwner",
"DocsDocOwnerRole",
"DocsDocReference",
+ "DocsDocSearchResponse",
"DocsEmbedQueryRequest",
"DocsEmbedQueryRequestText",
"DocsEmbedQueryResponse",
@@ -497,9 +480,6 @@
"UserDocsRouteListRequestSortBy",
"UserDocsRouteListResponse",
"UserDocsSearchRouteSearchRequestBody",
- "UserDocsSearchRouteSearchRequestDirection",
- "UserDocsSearchRouteSearchRequestSortBy",
- "UserDocsSearchRouteSearchResponse",
"UsersRouteListRequestDirection",
"UsersRouteListRequestSortBy",
"UsersRouteListResponse",
diff --git a/sdks/python/julep/api/types/agents_docs_search_route_search_request_direction.py b/sdks/python/julep/api/types/agents_docs_search_route_search_request_direction.py
deleted file mode 100644
index 07c53fe78..000000000
--- a/sdks/python/julep/api/types/agents_docs_search_route_search_request_direction.py
+++ /dev/null
@@ -1,7 +0,0 @@
-# This file was auto-generated by Fern from our API Definition.
-
-import typing
-
-AgentsDocsSearchRouteSearchRequestDirection = typing.Union[
- typing.Literal["asc", "desc"], typing.Any
-]
diff --git a/sdks/python/julep/api/types/agents_docs_search_route_search_request_sort_by.py b/sdks/python/julep/api/types/agents_docs_search_route_search_request_sort_by.py
deleted file mode 100644
index a85bdee6c..000000000
--- a/sdks/python/julep/api/types/agents_docs_search_route_search_request_sort_by.py
+++ /dev/null
@@ -1,7 +0,0 @@
-# This file was auto-generated by Fern from our API Definition.
-
-import typing
-
-AgentsDocsSearchRouteSearchRequestSortBy = typing.Union[
- typing.Literal["created_at", "updated_at"], typing.Any
-]
diff --git a/sdks/python/julep/api/types/agents_docs_search_route_search_response.py b/sdks/python/julep/api/types/agents_docs_search_route_search_response.py
deleted file mode 100644
index 400d1a51d..000000000
--- a/sdks/python/julep/api/types/agents_docs_search_route_search_response.py
+++ /dev/null
@@ -1,43 +0,0 @@
-# This file was auto-generated by Fern from our API Definition.
-
-import datetime as dt
-import typing
-
-from ..core.datetime_utils import serialize_datetime
-from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
-from .docs_doc_reference import DocsDocReference
-
-
-class AgentsDocsSearchRouteSearchResponse(pydantic_v1.BaseModel):
- results: typing.List[DocsDocReference]
-
- def json(self, **kwargs: typing.Any) -> str:
- kwargs_with_defaults: typing.Any = {
- "by_alias": True,
- "exclude_unset": True,
- **kwargs,
- }
- return super().json(**kwargs_with_defaults)
-
- def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
- kwargs_with_defaults_exclude_unset: typing.Any = {
- "by_alias": True,
- "exclude_unset": True,
- **kwargs,
- }
- kwargs_with_defaults_exclude_none: typing.Any = {
- "by_alias": True,
- "exclude_none": True,
- **kwargs,
- }
-
- return deep_union_pydantic_dicts(
- super().dict(**kwargs_with_defaults_exclude_unset),
- super().dict(**kwargs_with_defaults_exclude_none),
- )
-
- class Config:
- frozen = True
- smart_union = True
- extra = pydantic_v1.Extra.allow
- json_encoders = {dt.datetime: serialize_datetime}
diff --git a/sdks/python/julep/api/types/docs_base_doc_search_request.py b/sdks/python/julep/api/types/docs_base_doc_search_request.py
index f7c1ecfa2..1b9646593 100644
--- a/sdks/python/julep/api/types/docs_base_doc_search_request.py
+++ b/sdks/python/julep/api/types/docs_base_doc_search_request.py
@@ -8,21 +8,7 @@
class DocsBaseDocSearchRequest(pydantic_v1.BaseModel):
- confidence: float = pydantic_v1.Field()
- """
- The confidence cutoff level
- """
-
- alpha: float = pydantic_v1.Field()
- """
- The weight to apply to BM25 vs Vector search results. 0 => pure BM25; 1 => pure vector;
- """
-
- mmr: bool = pydantic_v1.Field()
- """
- Whether to include the MMR algorithm in the search. Optimizes for diversity in search results.
- """
-
+ limit: int
lang: typing.Literal["en-US"] = pydantic_v1.Field(default="en-US")
"""
The language to be used for text-only search. Support for other languages coming soon.
diff --git a/sdks/python/julep/api/types/user_docs_search_route_search_response.py b/sdks/python/julep/api/types/docs_doc_search_response.py
similarity index 82%
rename from sdks/python/julep/api/types/user_docs_search_route_search_response.py
rename to sdks/python/julep/api/types/docs_doc_search_response.py
index 9206fc909..59d26bdb9 100644
--- a/sdks/python/julep/api/types/user_docs_search_route_search_response.py
+++ b/sdks/python/julep/api/types/docs_doc_search_response.py
@@ -8,8 +8,16 @@
from .docs_doc_reference import DocsDocReference
-class UserDocsSearchRouteSearchResponse(pydantic_v1.BaseModel):
- results: typing.List[DocsDocReference]
+class DocsDocSearchResponse(pydantic_v1.BaseModel):
+ docs: typing.List[DocsDocReference] = pydantic_v1.Field()
+ """
+ The documents that were found
+ """
+
+ time: float = pydantic_v1.Field()
+ """
+ The time taken to search in seconds
+ """
def json(self, **kwargs: typing.Any) -> str:
kwargs_with_defaults: typing.Any = {
diff --git a/sdks/python/julep/api/types/docs_hybrid_doc_search_request.py b/sdks/python/julep/api/types/docs_hybrid_doc_search_request.py
index 51de991e1..8e460c40f 100644
--- a/sdks/python/julep/api/types/docs_hybrid_doc_search_request.py
+++ b/sdks/python/julep/api/types/docs_hybrid_doc_search_request.py
@@ -9,6 +9,16 @@
class DocsHybridDocSearchRequest(DocsBaseDocSearchRequest):
+ confidence: float = pydantic_v1.Field()
+ """
+ The confidence cutoff level
+ """
+
+ alpha: float = pydantic_v1.Field()
+ """
+ The weight to apply to BM25 vs Vector search results. 0 => pure BM25; 1 => pure vector;
+ """
+
text: str = pydantic_v1.Field()
"""
Text to use in the search. In `hybrid` search mode, either `text` or both `text` and `vector` fields are required.
diff --git a/sdks/python/julep/api/types/docs_vector_doc_search_request.py b/sdks/python/julep/api/types/docs_vector_doc_search_request.py
index 4ea4e9632..f9c103ec6 100644
--- a/sdks/python/julep/api/types/docs_vector_doc_search_request.py
+++ b/sdks/python/julep/api/types/docs_vector_doc_search_request.py
@@ -9,6 +9,11 @@
class DocsVectorDocSearchRequest(DocsBaseDocSearchRequest):
+ confidence: float = pydantic_v1.Field()
+ """
+ The confidence cutoff level
+ """
+
vector: typing.List[float] = pydantic_v1.Field()
"""
Vector to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown.
diff --git a/sdks/python/julep/api/types/user_docs_search_route_search_request_direction.py b/sdks/python/julep/api/types/user_docs_search_route_search_request_direction.py
deleted file mode 100644
index 3a2ef70a8..000000000
--- a/sdks/python/julep/api/types/user_docs_search_route_search_request_direction.py
+++ /dev/null
@@ -1,7 +0,0 @@
-# This file was auto-generated by Fern from our API Definition.
-
-import typing
-
-UserDocsSearchRouteSearchRequestDirection = typing.Union[
- typing.Literal["asc", "desc"], typing.Any
-]
diff --git a/sdks/python/julep/api/types/user_docs_search_route_search_request_sort_by.py b/sdks/python/julep/api/types/user_docs_search_route_search_request_sort_by.py
deleted file mode 100644
index 8cf9538a6..000000000
--- a/sdks/python/julep/api/types/user_docs_search_route_search_request_sort_by.py
+++ /dev/null
@@ -1,7 +0,0 @@
-# This file was auto-generated by Fern from our API Definition.
-
-import typing
-
-UserDocsSearchRouteSearchRequestSortBy = typing.Union[
- typing.Literal["created_at", "updated_at"], typing.Any
-]
diff --git a/sdks/ts/src/api/index.ts b/sdks/ts/src/api/index.ts
index f279f2bb9..b38e497f5 100644
--- a/sdks/ts/src/api/index.ts
+++ b/sdks/ts/src/api/index.ts
@@ -53,6 +53,7 @@ export type { Docs_CreateDocRequest } from "./models/Docs_CreateDocRequest";
export type { Docs_Doc } from "./models/Docs_Doc";
export type { Docs_DocOwner } from "./models/Docs_DocOwner";
export type { Docs_DocReference } from "./models/Docs_DocReference";
+export type { Docs_DocSearchResponse } from "./models/Docs_DocSearchResponse";
export type { Docs_EmbedQueryRequest } from "./models/Docs_EmbedQueryRequest";
export type { Docs_EmbedQueryResponse } from "./models/Docs_EmbedQueryResponse";
export type { Docs_HybridDocSearchRequest } from "./models/Docs_HybridDocSearchRequest";
@@ -167,6 +168,7 @@ export { $Docs_CreateDocRequest } from "./schemas/$Docs_CreateDocRequest";
export { $Docs_Doc } from "./schemas/$Docs_Doc";
export { $Docs_DocOwner } from "./schemas/$Docs_DocOwner";
export { $Docs_DocReference } from "./schemas/$Docs_DocReference";
+export { $Docs_DocSearchResponse } from "./schemas/$Docs_DocSearchResponse";
export { $Docs_EmbedQueryRequest } from "./schemas/$Docs_EmbedQueryRequest";
export { $Docs_EmbedQueryResponse } from "./schemas/$Docs_EmbedQueryResponse";
export { $Docs_HybridDocSearchRequest } from "./schemas/$Docs_HybridDocSearchRequest";
diff --git a/sdks/ts/src/api/models/Docs_BaseDocSearchRequest.ts b/sdks/ts/src/api/models/Docs_BaseDocSearchRequest.ts
index d99eefaf9..b6dd20f99 100644
--- a/sdks/ts/src/api/models/Docs_BaseDocSearchRequest.ts
+++ b/sdks/ts/src/api/models/Docs_BaseDocSearchRequest.ts
@@ -3,18 +3,7 @@
/* tslint:disable */
/* eslint-disable */
export type Docs_BaseDocSearchRequest = {
- /**
- * The confidence cutoff level
- */
- confidence: number;
- /**
- * The weight to apply to BM25 vs Vector search results. 0 => pure BM25; 1 => pure vector;
- */
- alpha: number;
- /**
- * Whether to include the MMR algorithm in the search. Optimizes for diversity in search results.
- */
- mmr: boolean;
+ limit: number;
/**
* The language to be used for text-only search. Support for other languages coming soon.
*/
diff --git a/sdks/ts/src/api/models/Docs_DocSearchResponse.ts b/sdks/ts/src/api/models/Docs_DocSearchResponse.ts
new file mode 100644
index 000000000..cfb8ad225
--- /dev/null
+++ b/sdks/ts/src/api/models/Docs_DocSearchResponse.ts
@@ -0,0 +1,15 @@
+/* generated using openapi-typescript-codegen -- do no edit */
+/* istanbul ignore file */
+/* tslint:disable */
+/* eslint-disable */
+import type { Docs_DocReference } from "./Docs_DocReference";
+export type Docs_DocSearchResponse = {
+ /**
+ * The documents that were found
+ */
+ docs: Array;
+ /**
+ * The time taken to search in seconds
+ */
+ time: number;
+};
diff --git a/sdks/ts/src/api/models/Docs_HybridDocSearchRequest.ts b/sdks/ts/src/api/models/Docs_HybridDocSearchRequest.ts
index 93b099294..a1ba32811 100644
--- a/sdks/ts/src/api/models/Docs_HybridDocSearchRequest.ts
+++ b/sdks/ts/src/api/models/Docs_HybridDocSearchRequest.ts
@@ -4,6 +4,14 @@
/* eslint-disable */
import type { Docs_BaseDocSearchRequest } from "./Docs_BaseDocSearchRequest";
export type Docs_HybridDocSearchRequest = Docs_BaseDocSearchRequest & {
+ /**
+ * The confidence cutoff level
+ */
+ confidence: number;
+ /**
+ * The weight to apply to BM25 vs Vector search results. 0 => pure BM25; 1 => pure vector;
+ */
+ alpha: number;
/**
* Text to use in the search. In `hybrid` search mode, either `text` or both `text` and `vector` fields are required.
*/
diff --git a/sdks/ts/src/api/models/Docs_VectorDocSearchRequest.ts b/sdks/ts/src/api/models/Docs_VectorDocSearchRequest.ts
index 8839067b0..7a720c46a 100644
--- a/sdks/ts/src/api/models/Docs_VectorDocSearchRequest.ts
+++ b/sdks/ts/src/api/models/Docs_VectorDocSearchRequest.ts
@@ -4,6 +4,10 @@
/* eslint-disable */
import type { Docs_BaseDocSearchRequest } from "./Docs_BaseDocSearchRequest";
export type Docs_VectorDocSearchRequest = Docs_BaseDocSearchRequest & {
+ /**
+ * The confidence cutoff level
+ */
+ confidence: number;
/**
* Vector to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown.
*/
diff --git a/sdks/ts/src/api/schemas/$Docs_BaseDocSearchRequest.ts b/sdks/ts/src/api/schemas/$Docs_BaseDocSearchRequest.ts
index 00b992770..99188755e 100644
--- a/sdks/ts/src/api/schemas/$Docs_BaseDocSearchRequest.ts
+++ b/sdks/ts/src/api/schemas/$Docs_BaseDocSearchRequest.ts
@@ -4,22 +4,12 @@
/* eslint-disable */
export const $Docs_BaseDocSearchRequest = {
properties: {
- confidence: {
+ limit: {
type: "number",
- description: `The confidence cutoff level`,
- isRequired: true,
- maximum: 1,
- },
- alpha: {
- type: "number",
- description: `The weight to apply to BM25 vs Vector search results. 0 => pure BM25; 1 => pure vector;`,
- isRequired: true,
- maximum: 1,
- },
- mmr: {
- type: "boolean",
- description: `Whether to include the MMR algorithm in the search. Optimizes for diversity in search results.`,
isRequired: true,
+ format: "uint16",
+ maximum: 100,
+ minimum: 1,
},
lang: {
type: "Enum",
diff --git a/sdks/ts/src/api/schemas/$Docs_DocSearchResponse.ts b/sdks/ts/src/api/schemas/$Docs_DocSearchResponse.ts
new file mode 100644
index 000000000..df2b37b48
--- /dev/null
+++ b/sdks/ts/src/api/schemas/$Docs_DocSearchResponse.ts
@@ -0,0 +1,21 @@
+/* generated using openapi-typescript-codegen -- do no edit */
+/* istanbul ignore file */
+/* tslint:disable */
+/* eslint-disable */
+export const $Docs_DocSearchResponse = {
+ properties: {
+ docs: {
+ type: "array",
+ contains: {
+ type: "Docs_DocReference",
+ },
+ isRequired: true,
+ },
+ time: {
+ type: "number",
+ description: `The time taken to search in seconds`,
+ isRequired: true,
+ exclusiveMinimum: true,
+ },
+ },
+} as const;
diff --git a/sdks/ts/src/api/schemas/$Docs_HybridDocSearchRequest.ts b/sdks/ts/src/api/schemas/$Docs_HybridDocSearchRequest.ts
index 14948c59a..2bc5005fb 100644
--- a/sdks/ts/src/api/schemas/$Docs_HybridDocSearchRequest.ts
+++ b/sdks/ts/src/api/schemas/$Docs_HybridDocSearchRequest.ts
@@ -10,6 +10,18 @@ export const $Docs_HybridDocSearchRequest = {
},
{
properties: {
+ confidence: {
+ type: "number",
+ description: `The confidence cutoff level`,
+ isRequired: true,
+ maximum: 1,
+ },
+ alpha: {
+ type: "number",
+ description: `The weight to apply to BM25 vs Vector search results. 0 => pure BM25; 1 => pure vector;`,
+ isRequired: true,
+ maximum: 1,
+ },
text: {
type: "string",
description: `Text to use in the search. In \`hybrid\` search mode, either \`text\` or both \`text\` and \`vector\` fields are required.`,
diff --git a/sdks/ts/src/api/schemas/$Docs_VectorDocSearchRequest.ts b/sdks/ts/src/api/schemas/$Docs_VectorDocSearchRequest.ts
index 54ba49bf5..af6de0b12 100644
--- a/sdks/ts/src/api/schemas/$Docs_VectorDocSearchRequest.ts
+++ b/sdks/ts/src/api/schemas/$Docs_VectorDocSearchRequest.ts
@@ -10,6 +10,12 @@ export const $Docs_VectorDocSearchRequest = {
},
{
properties: {
+ confidence: {
+ type: "number",
+ description: `The confidence cutoff level`,
+ isRequired: true,
+ maximum: 1,
+ },
vector: {
type: "array",
contains: {
diff --git a/sdks/ts/src/api/services/DefaultService.ts b/sdks/ts/src/api/services/DefaultService.ts
index c25ff685a..c71a6d7e9 100644
--- a/sdks/ts/src/api/services/DefaultService.ts
+++ b/sdks/ts/src/api/services/DefaultService.ts
@@ -20,7 +20,7 @@ import type { Common_ResourceUpdatedResponse } from "../models/Common_ResourceUp
import type { Common_uuid } from "../models/Common_uuid";
import type { Docs_CreateDocRequest } from "../models/Docs_CreateDocRequest";
import type { Docs_Doc } from "../models/Docs_Doc";
-import type { Docs_DocReference } from "../models/Docs_DocReference";
+import type { Docs_DocSearchResponse } from "../models/Docs_DocSearchResponse";
import type { Docs_EmbedQueryRequest } from "../models/Docs_EmbedQueryRequest";
import type { Docs_EmbedQueryResponse } from "../models/Docs_EmbedQueryResponse";
import type { Docs_HybridDocSearchRequest } from "../models/Docs_HybridDocSearchRequest";
@@ -315,17 +315,12 @@ export class DefaultService {
}
/**
* Search Docs owned by an Agent
- * @returns any The request has succeeded.
+ * @returns Docs_DocSearchResponse The request has succeeded.
* @throws ApiError
*/
public agentsDocsSearchRouteSearch({
id,
requestBody,
- limit = 100,
- offset,
- sortBy = "created_at",
- direction = "asc",
- metadataFilter = "{}",
}: {
/**
* ID of the parent
@@ -337,42 +332,13 @@ export class DefaultService {
| Docs_TextOnlyDocSearchRequest
| Docs_HybridDocSearchRequest;
};
- /**
- * Limit the number of items returned
- */
- limit?: Common_limit;
- /**
- * Offset the items returned
- */
- offset: Common_offset;
- /**
- * Sort by a field
- */
- sortBy?: "created_at" | "updated_at";
- /**
- * Sort direction
- */
- direction?: "asc" | "desc";
- /**
- * JSON string of object that should be used to filter objects by metadata
- */
- metadataFilter?: string;
- }): CancelablePromise<{
- results: Array;
- }> {
+ }): CancelablePromise {
return this.httpRequest.request({
method: "POST",
url: "/agents/{id}/search",
path: {
id: id,
},
- query: {
- limit: limit,
- offset: offset,
- sort_by: sortBy,
- direction: direction,
- metadata_filter: metadataFilter,
- },
body: requestBody,
mediaType: "application/json",
});
@@ -1758,17 +1724,12 @@ export class DefaultService {
}
/**
* Search Docs owned by a User
- * @returns any The request has succeeded.
+ * @returns Docs_DocSearchResponse The request has succeeded.
* @throws ApiError
*/
public userDocsSearchRouteSearch({
id,
requestBody,
- limit = 100,
- offset,
- sortBy = "created_at",
- direction = "asc",
- metadataFilter = "{}",
}: {
/**
* ID of the parent
@@ -1780,42 +1741,13 @@ export class DefaultService {
| Docs_TextOnlyDocSearchRequest
| Docs_HybridDocSearchRequest;
};
- /**
- * Limit the number of items returned
- */
- limit?: Common_limit;
- /**
- * Offset the items returned
- */
- offset: Common_offset;
- /**
- * Sort by a field
- */
- sortBy?: "created_at" | "updated_at";
- /**
- * Sort direction
- */
- direction?: "asc" | "desc";
- /**
- * JSON string of object that should be used to filter objects by metadata
- */
- metadataFilter?: string;
- }): CancelablePromise<{
- results: Array;
- }> {
+ }): CancelablePromise {
return this.httpRequest.request({
method: "POST",
url: "/users/{id}/search",
path: {
id: id,
},
- query: {
- limit: limit,
- offset: offset,
- sort_by: sortBy,
- direction: direction,
- metadata_filter: metadataFilter,
- },
body: requestBody,
mediaType: "application/json",
});
diff --git a/typespec/docs/endpoints.tsp b/typespec/docs/endpoints.tsp
index a493f9b86..143d18f33 100644
--- a/typespec/docs/endpoints.tsp
+++ b/typespec/docs/endpoints.tsp
@@ -37,11 +37,8 @@ interface SearchEndpoints pure BM25; 1 => pure vector; */
- @minValue(0)
- @maxValue(1)
- alpha: float = 0.75;
-
- /** Whether to include the MMR algorithm in the search. Optimizes for diversity in search results. */
- mmr: boolean = false;
+ @minValue(1)
+ @maxValue(100)
+ limit: uint16 = 10;
/** The language to be used for text-only search. Support for other languages coming soon. */
lang: "en-US" = "en-US";
}
model VectorDocSearchRequest extends BaseDocSearchRequest {
+ /** The confidence cutoff level */
+ @minValue(0)
+ @maxValue(1)
+ confidence: float = 0.5;
+
/** Vector to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown. */
vector: float[];
@@ -98,6 +94,16 @@ model TextOnlyDocSearchRequest extends BaseDocSearchRequest {
}
model HybridDocSearchRequest extends BaseDocSearchRequest {
+ /** The confidence cutoff level */
+ @minValue(0)
+ @maxValue(1)
+ confidence: float = 0.5;
+
+ /** The weight to apply to BM25 vs Vector search results. 0 => pure BM25; 1 => pure vector; */
+ @minValue(0)
+ @maxValue(1)
+ alpha: float = 0.75;
+
/** Text to use in the search. In `hybrid` search mode, either `text` or both `text` and `vector` fields are required. */
text: string;