Skip to content

Commit d172a59

Browse files
feat(api): manual updates
1 parent 1f31fae commit d172a59

File tree

5 files changed

+53
-4
lines changed

5 files changed

+53
-4
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 14
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zeroentropy%2Fzeroentropy-b5badb1383675a2606a4e65b515426cf70010d0e834372de7bcf39fda4939692.yml
3-
openapi_spec_hash: b3b0c03c89fe5ea66cc91fea2fa9726b
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zeroentropy%2Fzeroentropy-cd86445a8ef095a12e7bf74baddc7d5a8225531f8edb88ba613e12a52e219a42.yml
3+
openapi_spec_hash: 6da635b19c554a476ea9c967b619ae5b
44
config_hash: f5fb1effd4b0e263e1e93de3f573f46f

src/zeroentropy/resources/queries.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ def top_pages(
130130
query: str,
131131
filter: Optional[Dict[str, object]] | Omit = omit,
132132
include_content: bool | Omit = omit,
133+
include_metadata: bool | Omit = omit,
133134
latency_mode: Literal["low", "high"] | Omit = omit,
134135
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
135136
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -155,6 +156,9 @@ def top_pages(
155156
156157
include_content: If set to true, then the content of all pages will be returned.
157158
159+
include_metadata: Whether or not to include the document metadata in the response. If not
160+
provided, then the default will be `False`.
161+
158162
latency_mode: This option selects between our two latency modes. The higher latency mode takes
159163
longer, but can allow for more accurate responses. If desired, test both to
160164
customize your search experience for your particular use-case, or use the
@@ -178,6 +182,7 @@ def top_pages(
178182
"query": query,
179183
"filter": filter,
180184
"include_content": include_content,
185+
"include_metadata": include_metadata,
181186
"latency_mode": latency_mode,
182187
},
183188
query_top_pages_params.QueryTopPagesParams,
@@ -371,6 +376,7 @@ async def top_pages(
371376
query: str,
372377
filter: Optional[Dict[str, object]] | Omit = omit,
373378
include_content: bool | Omit = omit,
379+
include_metadata: bool | Omit = omit,
374380
latency_mode: Literal["low", "high"] | Omit = omit,
375381
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
376382
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -396,6 +402,9 @@ async def top_pages(
396402
397403
include_content: If set to true, then the content of all pages will be returned.
398404
405+
include_metadata: Whether or not to include the document metadata in the response. If not
406+
provided, then the default will be `False`.
407+
399408
latency_mode: This option selects between our two latency modes. The higher latency mode takes
400409
longer, but can allow for more accurate responses. If desired, test both to
401410
customize your search experience for your particular use-case, or use the
@@ -419,6 +428,7 @@ async def top_pages(
419428
"query": query,
420429
"filter": filter,
421430
"include_content": include_content,
431+
"include_metadata": include_metadata,
422432
"latency_mode": latency_mode,
423433
},
424434
query_top_pages_params.QueryTopPagesParams,

src/zeroentropy/types/query_top_pages_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ class QueryTopPagesParams(TypedDict, total=False):
3232
include_content: bool
3333
"""If set to true, then the content of all pages will be returned."""
3434

35+
include_metadata: bool
36+
"""Whether or not to include the document metadata in the response.
37+
38+
If not provided, then the default will be `False`.
39+
"""
40+
3541
latency_mode: Literal["low", "high"]
3642
"""This option selects between our two latency modes.
3743

src/zeroentropy/types/query_top_pages_response.py

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,33 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import List, Optional
3+
from typing import Dict, List, Union, Optional
44

55
from .._models import BaseModel
66

7-
__all__ = ["QueryTopPagesResponse", "Result"]
7+
__all__ = ["QueryTopPagesResponse", "DocumentResult", "Result"]
8+
9+
10+
class DocumentResult(BaseModel):
11+
file_url: str
12+
"""
13+
A URL to the document data, which can be used to download the raw document
14+
content or to display the document in frontend applications.
15+
16+
NOTE: If a `/documents/update-document` call returned a new document id, then
17+
this url will be invalidated and must be retrieved again.
18+
"""
19+
20+
metadata: Optional[Dict[str, Union[str, List[str]]]] = None
21+
"""The metadata for that document.
22+
23+
Will be `None` if `include_metadata` is `False`.
24+
"""
25+
26+
path: str
27+
"""The path of the document."""
28+
29+
score: float
30+
"""The relevancy score assigned to this document."""
831

932

1033
class Result(BaseModel):
@@ -43,4 +66,12 @@ class Result(BaseModel):
4366

4467

4568
class QueryTopPagesResponse(BaseModel):
69+
document_results: List[DocumentResult]
70+
"""The array of associated document information.
71+
72+
Note how each result page has an associated document path. After deduplicating
73+
the document paths, this array will contain document info for each document path
74+
that is referenced by at least one page result.
75+
"""
76+
4677
results: List[Result]

tests/api_resources/test_queries.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def test_method_top_pages_with_all_params(self, client: ZeroEntropy) -> None:
8888
query="query",
8989
filter={"foo": "bar"},
9090
include_content=True,
91+
include_metadata=True,
9192
latency_mode="low",
9293
)
9394
assert_matches_type(QueryTopPagesResponse, query, path=["response"])
@@ -243,6 +244,7 @@ async def test_method_top_pages_with_all_params(self, async_client: AsyncZeroEnt
243244
query="query",
244245
filter={"foo": "bar"},
245246
include_content=True,
247+
include_metadata=True,
246248
latency_mode="low",
247249
)
248250
assert_matches_type(QueryTopPagesResponse, query, path=["response"])

0 commit comments

Comments
 (0)