Skip to content

Commit a0f4720

Browse files
feat(api): api update
1 parent 466a814 commit a0f4720

4 files changed

Lines changed: 21 additions & 2 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 30
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-8b0df513ca50dcaf708a82dec12d9cbbf4ac615203208373ea9b5394add77b17.yml
3-
openapi_spec_hash: 3514190bfcbb5f804d631c0fd3bc0505
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-1cb26e44dcabc61d707d60021634ddc0f49801a4df53e9d0a5b1a94c5cc7fdda.yml
3+
openapi_spec_hash: d79eaf4567192a98df6af149efe3dc86
44
config_hash: 0ed970a9634b33d0af471738b478740d

src/hyperspell/resources/memories.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@ def search(
451451
*,
452452
query: str,
453453
answer: bool | Omit = omit,
454+
effort: int | Omit = omit,
454455
max_results: int | Omit = omit,
455456
options: memory_search_params.Options | Omit = omit,
456457
sources: List[
@@ -487,6 +488,9 @@ def search(
487488
488489
answer: If true, the query will be answered along with matching source documents.
489490
491+
effort: Effort level. 0 = pass query through verbatim. 1 = LLM rewrites the query for
492+
better retrieval and extracts date filters.
493+
490494
max_results: Maximum number of results to return.
491495
492496
options: Search options for the query.
@@ -507,6 +511,7 @@ def search(
507511
{
508512
"query": query,
509513
"answer": answer,
514+
"effort": effort,
510515
"max_results": max_results,
511516
"options": options,
512517
"sources": sources,
@@ -1013,6 +1018,7 @@ async def search(
10131018
*,
10141019
query: str,
10151020
answer: bool | Omit = omit,
1021+
effort: int | Omit = omit,
10161022
max_results: int | Omit = omit,
10171023
options: memory_search_params.Options | Omit = omit,
10181024
sources: List[
@@ -1049,6 +1055,9 @@ async def search(
10491055
10501056
answer: If true, the query will be answered along with matching source documents.
10511057
1058+
effort: Effort level. 0 = pass query through verbatim. 1 = LLM rewrites the query for
1059+
better retrieval and extracts date filters.
1060+
10521061
max_results: Maximum number of results to return.
10531062
10541063
options: Search options for the query.
@@ -1069,6 +1078,7 @@ async def search(
10691078
{
10701079
"query": query,
10711080
"answer": answer,
1081+
"effort": effort,
10721082
"max_results": max_results,
10731083
"options": options,
10741084
"sources": sources,

src/hyperspell/types/memory_search_params.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ class MemorySearchParams(TypedDict, total=False):
3131
answer: bool
3232
"""If true, the query will be answered along with matching source documents."""
3333

34+
effort: int
35+
"""Effort level.
36+
37+
0 = pass query through verbatim. 1 = LLM rewrites the query for better retrieval
38+
and extracts date filters.
39+
"""
40+
3441
max_results: int
3542
"""Maximum number of results to return."""
3643

tests/api_resources/test_memories.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ def test_method_search_with_all_params(self, client: Hyperspell) -> None:
287287
memory = client.memories.search(
288288
query="query",
289289
answer=True,
290+
effort=0,
290291
max_results=0,
291292
options={
292293
"after": parse_datetime("2019-12-27T18:11:19.117Z"),
@@ -691,6 +692,7 @@ async def test_method_search_with_all_params(self, async_client: AsyncHyperspell
691692
memory = await async_client.memories.search(
692693
query="query",
693694
answer=True,
695+
effort=0,
694696
max_results=0,
695697
options={
696698
"after": parse_datetime("2019-12-27T18:11:19.117Z"),

0 commit comments

Comments
 (0)