Skip to content

Commit 08bae2f

Browse files
feat(api): api update (#30)
1 parent e2312ba commit 08bae2f

File tree

3 files changed

+33
-6
lines changed

3 files changed

+33
-6
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 2
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-05fcf73e2de271c4168a5c2a3c68046fbf65d9ea1c3c5a81de77c4a0b56471b2.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-7ff5aa8df478efbb456eaf85bd0509e79c857e5e2d9328d465316870c13b4ffe.yml

src/hyperspell/types/document.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from .._models import BaseModel
88

9-
__all__ = ["Document", "Section", "SectionElement", "SectionElementMetadata"]
9+
__all__ = ["Document", "Section", "SectionElement", "SectionElementMetadata", "SectionScores"]
1010

1111

1212
class SectionElementMetadata(BaseModel):
@@ -32,7 +32,7 @@ class SectionElementMetadata(BaseModel):
3232
class SectionElement(BaseModel):
3333
text: str
3434

35-
type: Literal["text", "markdown", "image", "table", "title"]
35+
type: Literal["text", "markdown", "image", "table", "title", "query"]
3636

3737
id: Optional[str] = None
3838

@@ -41,6 +41,17 @@ class SectionElement(BaseModel):
4141
summary: Optional[str] = None
4242

4343

44+
class SectionScores(BaseModel):
45+
full_text_search: Optional[float] = None
46+
"""How relevant the section is based on full text search"""
47+
48+
semantic_search: Optional[float] = None
49+
"""How relevant the section is based on vector search"""
50+
51+
weighted: Optional[float] = None
52+
"""The final weighted score of the section"""
53+
54+
4455
class Section(BaseModel):
4556
document_id: int
4657

@@ -50,10 +61,12 @@ class Section(BaseModel):
5061

5162
embedding_e5_large: Optional[List[float]] = None
5263

53-
fts: Optional[List[float]] = None
64+
embedding_ts: Optional[str] = None
5465

5566
metadata: Optional[object] = None
5667

68+
scores: Optional[SectionScores] = None
69+
5770
text: Optional[str] = None
5871

5972

src/hyperspell/types/query_retrieve_response.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"DocumentSection",
1313
"DocumentSectionElement",
1414
"DocumentSectionElementMetadata",
15+
"DocumentSectionScores",
1516
]
1617

1718

@@ -38,7 +39,7 @@ class DocumentSectionElementMetadata(BaseModel):
3839
class DocumentSectionElement(BaseModel):
3940
text: str
4041

41-
type: Literal["text", "markdown", "image", "table", "title"]
42+
type: Literal["text", "markdown", "image", "table", "title", "query"]
4243

4344
id: Optional[str] = None
4445

@@ -47,6 +48,17 @@ class DocumentSectionElement(BaseModel):
4748
summary: Optional[str] = None
4849

4950

51+
class DocumentSectionScores(BaseModel):
52+
full_text_search: Optional[float] = None
53+
"""How relevant the section is based on full text search"""
54+
55+
semantic_search: Optional[float] = None
56+
"""How relevant the section is based on vector search"""
57+
58+
weighted: Optional[float] = None
59+
"""The final weighted score of the section"""
60+
61+
5062
class DocumentSection(BaseModel):
5163
document_id: int
5264

@@ -56,10 +68,12 @@ class DocumentSection(BaseModel):
5668

5769
embedding_e5_large: Optional[List[float]] = None
5870

59-
fts: Optional[List[float]] = None
71+
embedding_ts: Optional[str] = None
6072

6173
metadata: Optional[object] = None
6274

75+
scores: Optional[DocumentSectionScores] = None
76+
6377
text: Optional[str] = None
6478

6579

0 commit comments

Comments
 (0)