client: regenerate from hanzo-inc/cloud@1a819b53e3 (8.5.547)

Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
2026-10-03 05:59:55 +00:00
co-authored by Hanzo Dev
parent 440b022036
commit 608ba2fd52
38 changed files with 6897 additions and 6 deletions
+29
View File
@@ -1254,8 +1254,19 @@ pkg/hanzoai/cloud/models/kms_kms_token.py
pkg/hanzoai/cloud/models/kms_secret_meta.py
pkg/hanzoai/cloud/models/knowledge_catalog_entry.py
pkg/hanzoai/cloud/models/knowledge_catalog_out.py
pkg/hanzoai/cloud/models/knowledge_cited_passage.py
pkg/hanzoai/cloud/models/knowledge_connection_out.py
pkg/hanzoai/cloud/models/knowledge_connector_view.py
pkg/hanzoai/cloud/models/knowledge_file.py
pkg/hanzoai/cloud/models/knowledge_file_brief.py
pkg/hanzoai/cloud/models/knowledge_file_entity.py
pkg/hanzoai/cloud/models/knowledge_file_graph.py
pkg/hanzoai/cloud/models/knowledge_file_in.py
pkg/hanzoai/cloud/models/knowledge_file_link.py
pkg/hanzoai/cloud/models/knowledge_file_search_in.py
pkg/hanzoai/cloud/models/knowledge_file_search_out.py
pkg/hanzoai/cloud/models/knowledge_files_out.py
pkg/hanzoai/cloud/models/knowledge_forgotten.py
pkg/hanzoai/cloud/models/knowledge_graph_edge.py
pkg/hanzoai/cloud/models/knowledge_graph_node.py
pkg/hanzoai/cloud/models/knowledge_graph_out.py
@@ -1263,9 +1274,17 @@ pkg/hanzoai/cloud/models/knowledge_hit.py
pkg/hanzoai/cloud/models/knowledge_kb_authorize_out.py
pkg/hanzoai/cloud/models/knowledge_kb_connectors_out.py
pkg/hanzoai/cloud/models/knowledge_kb_sync_out.py
pkg/hanzoai/cloud/models/knowledge_picked_section.py
pkg/hanzoai/cloud/models/knowledge_reindex_out.py
pkg/hanzoai/cloud/models/knowledge_retrieve_in.py
pkg/hanzoai/cloud/models/knowledge_retrieve_out.py
pkg/hanzoai/cloud/models/knowledge_search_in.py
pkg/hanzoai/cloud/models/knowledge_search_out.py
pkg/hanzoai/cloud/models/knowledge_section_brief.py
pkg/hanzoai/cloud/models/knowledge_section_link.py
pkg/hanzoai/cloud/models/knowledge_section_out.py
pkg/hanzoai/cloud/models/knowledge_toc_entry.py
pkg/hanzoai/cloud/models/knowledge_toc_out.py
pkg/hanzoai/cloud/models/kv_bucket_record.py
pkg/hanzoai/cloud/models/kv_bucket_write.py
pkg/hanzoai/cloud/models/kv_kv_ack.py
@@ -2676,9 +2695,19 @@ pkg/hanzoai/cloud/models/s3_bucket_item.py
pkg/hanzoai/cloud/models/s3_bucket_list.py
pkg/hanzoai/cloud/models/s3_object_item.py
pkg/hanzoai/cloud/models/s3_object_list.py
pkg/hanzoai/cloud/models/s3_part_url.py
pkg/hanzoai/cloud/models/s3_part_urls.py
pkg/hanzoai/cloud/models/s3_presign_response.py
pkg/hanzoai/cloud/models/s3_s3_health.py
pkg/hanzoai/cloud/models/s3_stored_part.py
pkg/hanzoai/cloud/models/s3_stored_parts.py
pkg/hanzoai/cloud/models/s3_upload_done.py
pkg/hanzoai/cloud/models/s3_upload_gone.py
pkg/hanzoai/cloud/models/s3_upload_in.py
pkg/hanzoai/cloud/models/s3_upload_parts.py
pkg/hanzoai/cloud/models/s3_upload_ref.py
pkg/hanzoai/cloud/models/s3_upload_start.py
pkg/hanzoai/cloud/models/s3_upload_started.py
pkg/hanzoai/cloud/models/sandbox_blob.py
pkg/hanzoai/cloud/models/sandbox_end_in.py
pkg/hanzoai/cloud/models/sandbox_exec_request.py
+2 -2
View File
@@ -1,4 +1,4 @@
ref=7936e460415de6eaeefd795c8f6ed58dcff76347
sha256=41bbd8edb1d51e6dfb67fc38c0846a744bec13c1ef668d71d029d363b0b50783
ref=1a819b53e3842c5579a32e29b952c6487b074ad0
sha256=83947035c0653c8c2f95acca1ed17e5d212c6d014d1c40927ad2920baa5712b0
repo=hanzo-inc/cloud
path=openapi.yaml
+58
View File
@@ -1276,8 +1276,19 @@ __all__ = [
"KmsSecretMeta",
"KnowledgeCatalogEntry",
"KnowledgeCatalogOut",
"KnowledgeCitedPassage",
"KnowledgeConnectionOut",
"KnowledgeConnectorView",
"KnowledgeFile",
"KnowledgeFileBrief",
"KnowledgeFileEntity",
"KnowledgeFileGraph",
"KnowledgeFileIn",
"KnowledgeFileLink",
"KnowledgeFileSearchIn",
"KnowledgeFileSearchOut",
"KnowledgeFilesOut",
"KnowledgeForgotten",
"KnowledgeGraphEdge",
"KnowledgeGraphNode",
"KnowledgeGraphOut",
@@ -1285,9 +1296,17 @@ __all__ = [
"KnowledgeKbAuthorizeOut",
"KnowledgeKbConnectorsOut",
"KnowledgeKbSyncOut",
"KnowledgePickedSection",
"KnowledgeReindexOut",
"KnowledgeRetrieveIn",
"KnowledgeRetrieveOut",
"KnowledgeSearchIn",
"KnowledgeSearchOut",
"KnowledgeSectionBrief",
"KnowledgeSectionLink",
"KnowledgeSectionOut",
"KnowledgeTocEntry",
"KnowledgeTocOut",
"KvBucketRecord",
"KvBucketWrite",
"KvKvAck",
@@ -2698,9 +2717,19 @@ __all__ = [
"S3BucketList",
"S3ObjectItem",
"S3ObjectList",
"S3PartURL",
"S3PartURLs",
"S3PresignResponse",
"S3S3Health",
"S3StoredPart",
"S3StoredParts",
"S3UploadDone",
"S3UploadGone",
"S3UploadIn",
"S3UploadParts",
"S3UploadRef",
"S3UploadStart",
"S3UploadStarted",
"SandboxBlob",
"SandboxEndIn",
"SandboxExecRequest",
@@ -4308,8 +4337,19 @@ from hanzoai.cloud.models.kms_kms_token import KmsKmsToken as KmsKmsToken
from hanzoai.cloud.models.kms_secret_meta import KmsSecretMeta as KmsSecretMeta
from hanzoai.cloud.models.knowledge_catalog_entry import KnowledgeCatalogEntry as KnowledgeCatalogEntry
from hanzoai.cloud.models.knowledge_catalog_out import KnowledgeCatalogOut as KnowledgeCatalogOut
from hanzoai.cloud.models.knowledge_cited_passage import KnowledgeCitedPassage as KnowledgeCitedPassage
from hanzoai.cloud.models.knowledge_connection_out import KnowledgeConnectionOut as KnowledgeConnectionOut
from hanzoai.cloud.models.knowledge_connector_view import KnowledgeConnectorView as KnowledgeConnectorView
from hanzoai.cloud.models.knowledge_file import KnowledgeFile as KnowledgeFile
from hanzoai.cloud.models.knowledge_file_brief import KnowledgeFileBrief as KnowledgeFileBrief
from hanzoai.cloud.models.knowledge_file_entity import KnowledgeFileEntity as KnowledgeFileEntity
from hanzoai.cloud.models.knowledge_file_graph import KnowledgeFileGraph as KnowledgeFileGraph
from hanzoai.cloud.models.knowledge_file_in import KnowledgeFileIn as KnowledgeFileIn
from hanzoai.cloud.models.knowledge_file_link import KnowledgeFileLink as KnowledgeFileLink
from hanzoai.cloud.models.knowledge_file_search_in import KnowledgeFileSearchIn as KnowledgeFileSearchIn
from hanzoai.cloud.models.knowledge_file_search_out import KnowledgeFileSearchOut as KnowledgeFileSearchOut
from hanzoai.cloud.models.knowledge_files_out import KnowledgeFilesOut as KnowledgeFilesOut
from hanzoai.cloud.models.knowledge_forgotten import KnowledgeForgotten as KnowledgeForgotten
from hanzoai.cloud.models.knowledge_graph_edge import KnowledgeGraphEdge as KnowledgeGraphEdge
from hanzoai.cloud.models.knowledge_graph_node import KnowledgeGraphNode as KnowledgeGraphNode
from hanzoai.cloud.models.knowledge_graph_out import KnowledgeGraphOut as KnowledgeGraphOut
@@ -4317,9 +4357,17 @@ from hanzoai.cloud.models.knowledge_hit import KnowledgeHit as KnowledgeHit
from hanzoai.cloud.models.knowledge_kb_authorize_out import KnowledgeKbAuthorizeOut as KnowledgeKbAuthorizeOut
from hanzoai.cloud.models.knowledge_kb_connectors_out import KnowledgeKbConnectorsOut as KnowledgeKbConnectorsOut
from hanzoai.cloud.models.knowledge_kb_sync_out import KnowledgeKbSyncOut as KnowledgeKbSyncOut
from hanzoai.cloud.models.knowledge_picked_section import KnowledgePickedSection as KnowledgePickedSection
from hanzoai.cloud.models.knowledge_reindex_out import KnowledgeReindexOut as KnowledgeReindexOut
from hanzoai.cloud.models.knowledge_retrieve_in import KnowledgeRetrieveIn as KnowledgeRetrieveIn
from hanzoai.cloud.models.knowledge_retrieve_out import KnowledgeRetrieveOut as KnowledgeRetrieveOut
from hanzoai.cloud.models.knowledge_search_in import KnowledgeSearchIn as KnowledgeSearchIn
from hanzoai.cloud.models.knowledge_search_out import KnowledgeSearchOut as KnowledgeSearchOut
from hanzoai.cloud.models.knowledge_section_brief import KnowledgeSectionBrief as KnowledgeSectionBrief
from hanzoai.cloud.models.knowledge_section_link import KnowledgeSectionLink as KnowledgeSectionLink
from hanzoai.cloud.models.knowledge_section_out import KnowledgeSectionOut as KnowledgeSectionOut
from hanzoai.cloud.models.knowledge_toc_entry import KnowledgeTocEntry as KnowledgeTocEntry
from hanzoai.cloud.models.knowledge_toc_out import KnowledgeTocOut as KnowledgeTocOut
from hanzoai.cloud.models.kv_bucket_record import KvBucketRecord as KvBucketRecord
from hanzoai.cloud.models.kv_bucket_write import KvBucketWrite as KvBucketWrite
from hanzoai.cloud.models.kv_kv_ack import KvKvAck as KvKvAck
@@ -5730,9 +5778,19 @@ from hanzoai.cloud.models.s3_bucket_item import S3BucketItem as S3BucketItem
from hanzoai.cloud.models.s3_bucket_list import S3BucketList as S3BucketList
from hanzoai.cloud.models.s3_object_item import S3ObjectItem as S3ObjectItem
from hanzoai.cloud.models.s3_object_list import S3ObjectList as S3ObjectList
from hanzoai.cloud.models.s3_part_url import S3PartURL as S3PartURL
from hanzoai.cloud.models.s3_part_urls import S3PartURLs as S3PartURLs
from hanzoai.cloud.models.s3_presign_response import S3PresignResponse as S3PresignResponse
from hanzoai.cloud.models.s3_s3_health import S3S3Health as S3S3Health
from hanzoai.cloud.models.s3_stored_part import S3StoredPart as S3StoredPart
from hanzoai.cloud.models.s3_stored_parts import S3StoredParts as S3StoredParts
from hanzoai.cloud.models.s3_upload_done import S3UploadDone as S3UploadDone
from hanzoai.cloud.models.s3_upload_gone import S3UploadGone as S3UploadGone
from hanzoai.cloud.models.s3_upload_in import S3UploadIn as S3UploadIn
from hanzoai.cloud.models.s3_upload_parts import S3UploadParts as S3UploadParts
from hanzoai.cloud.models.s3_upload_ref import S3UploadRef as S3UploadRef
from hanzoai.cloud.models.s3_upload_start import S3UploadStart as S3UploadStart
from hanzoai.cloud.models.s3_upload_started import S3UploadStarted as S3UploadStarted
from hanzoai.cloud.models.sandbox_blob import SandboxBlob as SandboxBlob
from hanzoai.cloud.models.sandbox_end_in import SandboxEndIn as SandboxEndIn
from hanzoai.cloud.models.sandbox_exec_request import SandboxExecRequest as SandboxExecRequest
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+29
View File
@@ -1139,8 +1139,19 @@ from hanzoai.cloud.models.kms_kms_token import KmsKmsToken
from hanzoai.cloud.models.kms_secret_meta import KmsSecretMeta
from hanzoai.cloud.models.knowledge_catalog_entry import KnowledgeCatalogEntry
from hanzoai.cloud.models.knowledge_catalog_out import KnowledgeCatalogOut
from hanzoai.cloud.models.knowledge_cited_passage import KnowledgeCitedPassage
from hanzoai.cloud.models.knowledge_connection_out import KnowledgeConnectionOut
from hanzoai.cloud.models.knowledge_connector_view import KnowledgeConnectorView
from hanzoai.cloud.models.knowledge_file import KnowledgeFile
from hanzoai.cloud.models.knowledge_file_brief import KnowledgeFileBrief
from hanzoai.cloud.models.knowledge_file_entity import KnowledgeFileEntity
from hanzoai.cloud.models.knowledge_file_graph import KnowledgeFileGraph
from hanzoai.cloud.models.knowledge_file_in import KnowledgeFileIn
from hanzoai.cloud.models.knowledge_file_link import KnowledgeFileLink
from hanzoai.cloud.models.knowledge_file_search_in import KnowledgeFileSearchIn
from hanzoai.cloud.models.knowledge_file_search_out import KnowledgeFileSearchOut
from hanzoai.cloud.models.knowledge_files_out import KnowledgeFilesOut
from hanzoai.cloud.models.knowledge_forgotten import KnowledgeForgotten
from hanzoai.cloud.models.knowledge_graph_edge import KnowledgeGraphEdge
from hanzoai.cloud.models.knowledge_graph_node import KnowledgeGraphNode
from hanzoai.cloud.models.knowledge_graph_out import KnowledgeGraphOut
@@ -1148,9 +1159,17 @@ from hanzoai.cloud.models.knowledge_hit import KnowledgeHit
from hanzoai.cloud.models.knowledge_kb_authorize_out import KnowledgeKbAuthorizeOut
from hanzoai.cloud.models.knowledge_kb_connectors_out import KnowledgeKbConnectorsOut
from hanzoai.cloud.models.knowledge_kb_sync_out import KnowledgeKbSyncOut
from hanzoai.cloud.models.knowledge_picked_section import KnowledgePickedSection
from hanzoai.cloud.models.knowledge_reindex_out import KnowledgeReindexOut
from hanzoai.cloud.models.knowledge_retrieve_in import KnowledgeRetrieveIn
from hanzoai.cloud.models.knowledge_retrieve_out import KnowledgeRetrieveOut
from hanzoai.cloud.models.knowledge_search_in import KnowledgeSearchIn
from hanzoai.cloud.models.knowledge_search_out import KnowledgeSearchOut
from hanzoai.cloud.models.knowledge_section_brief import KnowledgeSectionBrief
from hanzoai.cloud.models.knowledge_section_link import KnowledgeSectionLink
from hanzoai.cloud.models.knowledge_section_out import KnowledgeSectionOut
from hanzoai.cloud.models.knowledge_toc_entry import KnowledgeTocEntry
from hanzoai.cloud.models.knowledge_toc_out import KnowledgeTocOut
from hanzoai.cloud.models.kv_bucket_record import KvBucketRecord
from hanzoai.cloud.models.kv_bucket_write import KvBucketWrite
from hanzoai.cloud.models.kv_kv_ack import KvKvAck
@@ -2561,9 +2580,19 @@ from hanzoai.cloud.models.s3_bucket_item import S3BucketItem
from hanzoai.cloud.models.s3_bucket_list import S3BucketList
from hanzoai.cloud.models.s3_object_item import S3ObjectItem
from hanzoai.cloud.models.s3_object_list import S3ObjectList
from hanzoai.cloud.models.s3_part_url import S3PartURL
from hanzoai.cloud.models.s3_part_urls import S3PartURLs
from hanzoai.cloud.models.s3_presign_response import S3PresignResponse
from hanzoai.cloud.models.s3_s3_health import S3S3Health
from hanzoai.cloud.models.s3_stored_part import S3StoredPart
from hanzoai.cloud.models.s3_stored_parts import S3StoredParts
from hanzoai.cloud.models.s3_upload_done import S3UploadDone
from hanzoai.cloud.models.s3_upload_gone import S3UploadGone
from hanzoai.cloud.models.s3_upload_in import S3UploadIn
from hanzoai.cloud.models.s3_upload_parts import S3UploadParts
from hanzoai.cloud.models.s3_upload_ref import S3UploadRef
from hanzoai.cloud.models.s3_upload_start import S3UploadStart
from hanzoai.cloud.models.s3_upload_started import S3UploadStarted
from hanzoai.cloud.models.sandbox_blob import SandboxBlob
from hanzoai.cloud.models.sandbox_end_in import SandboxEndIn
from hanzoai.cloud.models.sandbox_exec_request import SandboxExecRequest
@@ -0,0 +1,109 @@
# coding: utf-8
"""
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional, Union
from hanzoai.cloud.models.knowledge_file_brief import KnowledgeFileBrief
from hanzoai.cloud.models.knowledge_section_brief import KnowledgeSectionBrief
from typing import Optional, Set
from typing_extensions import Self
class KnowledgeCitedPassage(BaseModel):
"""
KnowledgeCitedPassage
""" # noqa: E501
cite: Optional[StrictStr] = Field(default=None, description="Cite is how an answer cites it: file › section path › ¶part.")
file: Optional[KnowledgeFileBrief] = Field(default=None, description="File is the file the passage is from.")
part: Optional[StrictInt] = Field(default=None, description="Part is the passage's place in its section, from 1.")
score: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Score is the fused rank score, comparable within one response only.")
section: Optional[KnowledgeSectionBrief] = Field(default=None, description="Section is the section it is in.")
text: Optional[StrictStr] = Field(default=None, description="Text is the passage: a span of its section of about 2000 bytes, never crossing into another section.")
via: Optional[StrictStr] = Field(default=None, description="Via is how retrieval reached it: search (it matched), toc (it is in a section the table of contents pointed at) or graph (a linked section).")
why: Optional[StrictStr] = Field(default=None, description="Why says, for a passage reached through the graph, which edge led there.")
__properties: ClassVar[List[str]] = ["cite", "file", "part", "score", "section", "text", "via", "why"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of KnowledgeCitedPassage from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of file
if self.file:
_dict['file'] = self.file.to_dict()
# override the default output from pydantic by calling `to_dict()` of section
if self.section:
_dict['section'] = self.section.to_dict()
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of KnowledgeCitedPassage from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"cite": obj.get("cite"),
"file": KnowledgeFileBrief.from_dict(obj["file"]) if obj.get("file") is not None else None,
"part": obj.get("part"),
"score": obj.get("score"),
"section": KnowledgeSectionBrief.from_dict(obj["section"]) if obj.get("section") is not None else None,
"text": obj.get("text"),
"via": obj.get("via"),
"why": obj.get("why")
})
return _obj
+121
View File
@@ -0,0 +1,121 @@
# coding: utf-8
"""
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
class KnowledgeFile(BaseModel):
"""
KnowledgeFile
""" # noqa: E501
bucket: Optional[StrictStr] = Field(default=None, description="Bucket is the org bucket the object is in, by the friendly name /v1/s3/buckets lists.")
chars: Optional[StrictInt] = Field(default=None, description="Chars is the length of the text read out of the file, in bytes.")
clipped: Optional[StrictBool] = Field(default=None, description="Clipped is true when the file held more text than one file is indexed for, and only its beginning was indexed.")
created: Optional[StrictInt] = Field(default=None, description="Created is when the file was first registered, in unix seconds.")
embedded: Optional[StrictInt] = Field(default=None, description="Embedded is how many of those passages carry a vector — Passages once the embed stage is done.")
error: Optional[StrictStr] = Field(default=None, description="Error is why a stored or failed file was not indexed, in words a person can act on. Absent otherwise.")
id: Optional[StrictStr] = Field(default=None, description="ID names the file in its org. It is derived from the bucket and key, so registering the same object twice answers the same file.")
key: Optional[StrictStr] = Field(default=None, description="Key is the object's key in that bucket. GET /v1/s3/buckets/{bucket}/objects/{key} answers a signed download URL for it.")
name: Optional[StrictStr] = Field(default=None, description="Name is the object's file name, the last segment of its key.")
parent: Optional[StrictStr] = Field(default=None, description="Parent is the id of the archive this file was unpacked from. Absent for a file uploaded on its own.")
passages: Optional[StrictInt] = Field(default=None, description="Passages is how many passages its text was cut into.")
project: Optional[StrictStr] = Field(default=None, description="Project is the project scope it is indexed under. Absent for the org's own files.")
sections: Optional[StrictInt] = Field(default=None, description="Sections is how many nodes its table of contents has, the document's own root included.")
size: Optional[StrictInt] = Field(default=None, description="Size is the object's length in bytes, as the store reports it.")
stage: Optional[StrictStr] = Field(default=None, description="Stage is the ingest stage the file is in or last finished: extract, toc, passages, embed or graph.")
status: Optional[StrictStr] = Field(default=None, description="Status is queued, indexing, ready, stored (kept but not indexed — Error says why) or failed. A file's passages are searchable from the passages stage on, and its semantic leg grows while it embeds.")
type: Optional[StrictStr] = Field(default=None, description="Type is the object's media type as the store holds it, or the one its name implies when the store holds only the generic default.")
updated: Optional[StrictInt] = Field(default=None, description="Updated is when its record last changed, in unix seconds.")
__properties: ClassVar[List[str]] = ["bucket", "chars", "clipped", "created", "embedded", "error", "id", "key", "name", "parent", "passages", "project", "sections", "size", "stage", "status", "type", "updated"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of KnowledgeFile from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of KnowledgeFile from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"bucket": obj.get("bucket"),
"chars": obj.get("chars"),
"clipped": obj.get("clipped"),
"created": obj.get("created"),
"embedded": obj.get("embedded"),
"error": obj.get("error"),
"id": obj.get("id"),
"key": obj.get("key"),
"name": obj.get("name"),
"parent": obj.get("parent"),
"passages": obj.get("passages"),
"project": obj.get("project"),
"sections": obj.get("sections"),
"size": obj.get("size"),
"stage": obj.get("stage"),
"status": obj.get("status"),
"type": obj.get("type"),
"updated": obj.get("updated")
})
return _obj
@@ -0,0 +1,95 @@
# coding: utf-8
"""
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
class KnowledgeFileBrief(BaseModel):
"""
KnowledgeFileBrief
""" # noqa: E501
bucket: Optional[StrictStr] = Field(default=None, description="Bucket and Key are where its bytes are: GET /v1/s3/buckets/{bucket}/objects/{key} answers a signed download URL.")
id: Optional[StrictStr] = Field(default=None, description="ID is the file's id.")
key: Optional[StrictStr] = Field(default=None, description="Key is the object's key in Bucket.")
name: Optional[StrictStr] = Field(default=None, description="Name is the file's name.")
type: Optional[StrictStr] = Field(default=None, description="Type is the file's media type.")
__properties: ClassVar[List[str]] = ["bucket", "id", "key", "name", "type"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of KnowledgeFileBrief from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of KnowledgeFileBrief from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"bucket": obj.get("bucket"),
"id": obj.get("id"),
"key": obj.get("key"),
"name": obj.get("name"),
"type": obj.get("type")
})
return _obj
@@ -0,0 +1,93 @@
# coding: utf-8
"""
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
class KnowledgeFileEntity(BaseModel):
"""
KnowledgeFileEntity
""" # noqa: E501
files: Optional[StrictInt] = Field(default=None, description="Files is how many other files of the org name it too.")
kind: Optional[StrictStr] = Field(default=None, description="Kind is person, org, product, place or term.")
name: Optional[StrictStr] = Field(default=None, description="Name is the entity as the text names it.")
sections: Optional[StrictInt] = Field(default=None, description="Sections is how many of the file's sections name it.")
__properties: ClassVar[List[str]] = ["files", "kind", "name", "sections"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of KnowledgeFileEntity from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of KnowledgeFileEntity from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"files": obj.get("files"),
"kind": obj.get("kind"),
"name": obj.get("name"),
"sections": obj.get("sections")
})
return _obj
@@ -0,0 +1,111 @@
# coding: utf-8
"""
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from typing import Any, ClassVar, Dict, List, Optional
from hanzoai.cloud.models.knowledge_file import KnowledgeFile
from hanzoai.cloud.models.knowledge_file_entity import KnowledgeFileEntity
from hanzoai.cloud.models.knowledge_file_link import KnowledgeFileLink
from typing import Optional, Set
from typing_extensions import Self
class KnowledgeFileGraph(BaseModel):
"""
KnowledgeFileGraph
""" # noqa: E501
entities: Optional[List[KnowledgeFileEntity]] = Field(default=None, description="Entities are the entities it names, most mentioned first.")
file: Optional[KnowledgeFile] = Field(default=None, description="File is the file the graph is of.")
links: Optional[List[KnowledgeFileLink]] = Field(default=None, description="Links are the other files it is joined to, strongest first.")
__properties: ClassVar[List[str]] = ["entities", "file", "links"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of KnowledgeFileGraph from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in entities (list)
_items = []
if self.entities:
for _item_entities in self.entities:
if _item_entities:
_items.append(_item_entities.to_dict())
_dict['entities'] = _items
# override the default output from pydantic by calling `to_dict()` of file
if self.file:
_dict['file'] = self.file.to_dict()
# override the default output from pydantic by calling `to_dict()` of each item in links (list)
_items = []
if self.links:
for _item_links in self.links:
if _item_links:
_items.append(_item_links.to_dict())
_dict['links'] = _items
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of KnowledgeFileGraph from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"entities": [KnowledgeFileEntity.from_dict(_item) for _item in obj["entities"]] if obj.get("entities") is not None else None,
"file": KnowledgeFile.from_dict(obj["file"]) if obj.get("file") is not None else None,
"links": [KnowledgeFileLink.from_dict(_item) for _item in obj["links"]] if obj.get("links") is not None else None
})
return _obj
@@ -0,0 +1,91 @@
# coding: utf-8
"""
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
class KnowledgeFileIn(BaseModel):
"""
KnowledgeFileIn
""" # noqa: E501
bucket: Optional[StrictStr] = Field(default=None, description="Bucket is one of the org's buckets, by the friendly name /v1/s3/buckets lists. Required.")
key: Optional[StrictStr] = Field(default=None, description="Key is the object's key in that bucket, as the upload wrote it. Required.")
project: Optional[StrictStr] = Field(default=None, description="Project indexes the file under one project scope. Empty is the org's own.")
__properties: ClassVar[List[str]] = ["bucket", "key", "project"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of KnowledgeFileIn from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of KnowledgeFileIn from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"bucket": obj.get("bucket"),
"key": obj.get("key"),
"project": obj.get("project")
})
return _obj
@@ -0,0 +1,97 @@
# coding: utf-8
"""
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
class KnowledgeFileLink(BaseModel):
"""
KnowledgeFileLink
""" # noqa: E501
direction: Optional[StrictStr] = Field(default=None, description="Direction is out when this file links to the other, in when the other links to this one, and shared when the two name the same entities.")
file: Optional[StrictStr] = Field(default=None, description="File is the other file, by id.")
kind: Optional[StrictStr] = Field(default=None, description="Kind is href (a hyperlink), cites (the text names the file), xref (a cross-reference inside one document) or entity (shared mentions).")
label: Optional[StrictStr] = Field(default=None, description="Label is the link's own text, or the entities the two files share.")
name: Optional[StrictStr] = Field(default=None, description="Name is the other file's name.")
weight: Optional[StrictInt] = Field(default=None, description="Weight is how many edges of this kind join the two; for shared entities, how many entities they share.")
__properties: ClassVar[List[str]] = ["direction", "file", "kind", "label", "name", "weight"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of KnowledgeFileLink from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of KnowledgeFileLink from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"direction": obj.get("direction"),
"file": obj.get("file"),
"kind": obj.get("kind"),
"label": obj.get("label"),
"name": obj.get("name"),
"weight": obj.get("weight")
})
return _obj
@@ -0,0 +1,93 @@
# coding: utf-8
"""
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
class KnowledgeFileSearchIn(BaseModel):
"""
KnowledgeFileSearchIn
""" # noqa: E501
files: Optional[List[StrictStr]] = Field(default=None, description="Files restricts the search to these file ids. Empty searches every file the org holds.")
limit: Optional[StrictInt] = Field(default=None, description="Limit bounds the passages returned. Default 8, maximum 50.")
project: Optional[StrictStr] = Field(default=None, description="Project restricts the search to files indexed under one project scope.")
query: Optional[StrictStr] = Field(default=None, description="Query is the question or phrase. Required.")
__properties: ClassVar[List[str]] = ["files", "limit", "project", "query"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of KnowledgeFileSearchIn from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of KnowledgeFileSearchIn from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"files": obj.get("files"),
"limit": obj.get("limit"),
"project": obj.get("project"),
"query": obj.get("query")
})
return _obj
@@ -0,0 +1,97 @@
# coding: utf-8
"""
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictBool
from typing import Any, ClassVar, Dict, List, Optional
from hanzoai.cloud.models.knowledge_cited_passage import KnowledgeCitedPassage
from typing import Optional, Set
from typing_extensions import Self
class KnowledgeFileSearchOut(BaseModel):
"""
KnowledgeFileSearchOut
""" # noqa: E501
degraded: Optional[StrictBool] = Field(default=None, description="Degraded is true when a leg failed — the query could not be embedded, or the full-text index could not be read — and Passages are what the other leg found.")
passages: Optional[List[KnowledgeCitedPassage]] = Field(default=None, description="Passages are the matching passages, best first, at most Limit.")
__properties: ClassVar[List[str]] = ["degraded", "passages"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of KnowledgeFileSearchOut from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in passages (list)
_items = []
if self.passages:
for _item_passages in self.passages:
if _item_passages:
_items.append(_item_passages.to_dict())
_dict['passages'] = _items
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of KnowledgeFileSearchOut from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"degraded": obj.get("degraded"),
"passages": [KnowledgeCitedPassage.from_dict(_item) for _item in obj["passages"]] if obj.get("passages") is not None else None
})
return _obj
@@ -0,0 +1,95 @@
# coding: utf-8
"""
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from typing import Any, ClassVar, Dict, List, Optional
from hanzoai.cloud.models.knowledge_file import KnowledgeFile
from typing import Optional, Set
from typing_extensions import Self
class KnowledgeFilesOut(BaseModel):
"""
KnowledgeFilesOut
""" # noqa: E501
files: Optional[List[KnowledgeFile]] = Field(default=None, description="Files are the org's files, most recently changed first.")
__properties: ClassVar[List[str]] = ["files"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of KnowledgeFilesOut from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in files (list)
_items = []
if self.files:
for _item_files in self.files:
if _item_files:
_items.append(_item_files.to_dict())
_dict['files'] = _items
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of KnowledgeFilesOut from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"files": [KnowledgeFile.from_dict(_item) for _item in obj["files"]] if obj.get("files") is not None else None
})
return _obj
@@ -0,0 +1,87 @@
# coding: utf-8
"""
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
class KnowledgeForgotten(BaseModel):
"""
KnowledgeForgotten
""" # noqa: E501
id: Optional[StrictStr] = Field(default=None, description="ID is the file whose index was removed.")
__properties: ClassVar[List[str]] = ["id"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of KnowledgeForgotten from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of KnowledgeForgotten from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"id": obj.get("id")
})
return _obj
@@ -0,0 +1,99 @@
# coding: utf-8
"""
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from hanzoai.cloud.models.knowledge_file_brief import KnowledgeFileBrief
from hanzoai.cloud.models.knowledge_section_brief import KnowledgeSectionBrief
from typing import Optional, Set
from typing_extensions import Self
class KnowledgePickedSection(BaseModel):
"""
KnowledgePickedSection
""" # noqa: E501
file: Optional[KnowledgeFileBrief] = Field(default=None, description="File is the file it is in.")
section: Optional[KnowledgeSectionBrief] = Field(default=None, description="Section is where it is.")
summary: Optional[StrictStr] = Field(default=None, description="Summary is its one-line account.")
__properties: ClassVar[List[str]] = ["file", "section", "summary"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of KnowledgePickedSection from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of file
if self.file:
_dict['file'] = self.file.to_dict()
# override the default output from pydantic by calling `to_dict()` of section
if self.section:
_dict['section'] = self.section.to_dict()
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of KnowledgePickedSection from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"file": KnowledgeFileBrief.from_dict(obj["file"]) if obj.get("file") is not None else None,
"section": KnowledgeSectionBrief.from_dict(obj["section"]) if obj.get("section") is not None else None,
"summary": obj.get("summary")
})
return _obj
@@ -0,0 +1,93 @@
# coding: utf-8
"""
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
class KnowledgeRetrieveIn(BaseModel):
"""
KnowledgeRetrieveIn
""" # noqa: E501
files: Optional[List[StrictStr]] = Field(default=None, description="Files are the files the question is about — the files a chat message references. Empty asks the whole workspace. The graph may still reach files beyond them.")
limit: Optional[StrictInt] = Field(default=None, description="Limit bounds the passages drilled out of the chosen sections. Default 8, maximum 24. The graph adds up to four more.")
project: Optional[StrictStr] = Field(default=None, description="Project restricts retrieval to files indexed under one project scope.")
query: Optional[StrictStr] = Field(default=None, description="Query is the question to answer. Required.")
__properties: ClassVar[List[str]] = ["files", "limit", "project", "query"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of KnowledgeRetrieveIn from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of KnowledgeRetrieveIn from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"files": obj.get("files"),
"limit": obj.get("limit"),
"project": obj.get("project"),
"query": obj.get("query")
})
return _obj
@@ -0,0 +1,109 @@
# coding: utf-8
"""
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from hanzoai.cloud.models.knowledge_cited_passage import KnowledgeCitedPassage
from hanzoai.cloud.models.knowledge_picked_section import KnowledgePickedSection
from typing import Optional, Set
from typing_extensions import Self
class KnowledgeRetrieveOut(BaseModel):
"""
KnowledgeRetrieveOut
""" # noqa: E501
degraded: Optional[StrictBool] = Field(default=None, description="Degraded is true when a search leg failed along the way.")
passages: Optional[List[KnowledgeCitedPassage]] = Field(default=None, description="Passages are the passages drilled out of those sections, then those the graph reached, each citing file › section › paragraph.")
picked: Optional[StrictStr] = Field(default=None, description="Picked says how the sections were chosen: model when a model read the tables of contents, search when the sections of the best passages stood in because no model answered.")
sections: Optional[List[KnowledgePickedSection]] = Field(default=None, description="Sections are the sections chosen from the candidate documents' tables of contents.")
__properties: ClassVar[List[str]] = ["degraded", "passages", "picked", "sections"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of KnowledgeRetrieveOut from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in passages (list)
_items = []
if self.passages:
for _item_passages in self.passages:
if _item_passages:
_items.append(_item_passages.to_dict())
_dict['passages'] = _items
# override the default output from pydantic by calling `to_dict()` of each item in sections (list)
_items = []
if self.sections:
for _item_sections in self.sections:
if _item_sections:
_items.append(_item_sections.to_dict())
_dict['sections'] = _items
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of KnowledgeRetrieveOut from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"degraded": obj.get("degraded"),
"passages": [KnowledgeCitedPassage.from_dict(_item) for _item in obj["passages"]] if obj.get("passages") is not None else None,
"picked": obj.get("picked"),
"sections": [KnowledgePickedSection.from_dict(_item) for _item in obj["sections"]] if obj.get("sections") is not None else None
})
return _obj
@@ -0,0 +1,91 @@
# coding: utf-8
"""
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
class KnowledgeSectionBrief(BaseModel):
"""
KnowledgeSectionBrief
""" # noqa: E501
id: Optional[StrictInt] = Field(default=None, description="ID is the section's number in its file's table of contents; 0 is the document itself.")
path: Optional[StrictStr] = Field(default=None, description="Path is the section's place in its document: the titles from the document's own down to it, joined by \" › \".")
title: Optional[StrictStr] = Field(default=None, description="Title is the section's heading.")
__properties: ClassVar[List[str]] = ["id", "path", "title"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of KnowledgeSectionBrief from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of KnowledgeSectionBrief from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"id": obj.get("id"),
"path": obj.get("path"),
"title": obj.get("title")
})
return _obj
@@ -0,0 +1,101 @@
# coding: utf-8
"""
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from hanzoai.cloud.models.knowledge_file_brief import KnowledgeFileBrief
from hanzoai.cloud.models.knowledge_section_brief import KnowledgeSectionBrief
from typing import Optional, Set
from typing_extensions import Self
class KnowledgeSectionLink(BaseModel):
"""
KnowledgeSectionLink
""" # noqa: E501
file: Optional[KnowledgeFileBrief] = Field(default=None, description="File is the file the linked section is in.")
kind: Optional[StrictStr] = Field(default=None, description="Kind is href, xref, cites, or entity (the two sections name the same entities).")
label: Optional[StrictStr] = Field(default=None, description="Label is the link's text, or the entities the two share.")
section: Optional[KnowledgeSectionBrief] = Field(default=None, description="Section is the linked section.")
__properties: ClassVar[List[str]] = ["file", "kind", "label", "section"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of KnowledgeSectionLink from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of file
if self.file:
_dict['file'] = self.file.to_dict()
# override the default output from pydantic by calling `to_dict()` of section
if self.section:
_dict['section'] = self.section.to_dict()
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of KnowledgeSectionLink from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"file": KnowledgeFileBrief.from_dict(obj["file"]) if obj.get("file") is not None else None,
"kind": obj.get("kind"),
"label": obj.get("label"),
"section": KnowledgeSectionBrief.from_dict(obj["section"]) if obj.get("section") is not None else None
})
return _obj
@@ -0,0 +1,131 @@
# coding: utf-8
"""
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from hanzoai.cloud.models.knowledge_file_brief import KnowledgeFileBrief
from hanzoai.cloud.models.knowledge_file_entity import KnowledgeFileEntity
from hanzoai.cloud.models.knowledge_section_brief import KnowledgeSectionBrief
from hanzoai.cloud.models.knowledge_section_link import KnowledgeSectionLink
from hanzoai.cloud.models.knowledge_toc_entry import KnowledgeTocEntry
from typing import Optional, Set
from typing_extensions import Self
class KnowledgeSectionOut(BaseModel):
"""
KnowledgeSectionOut
""" # noqa: E501
children: Optional[List[KnowledgeTocEntry]] = Field(default=None, description="Children are its subsections, to open next.")
entities: Optional[List[KnowledgeFileEntity]] = Field(default=None, description="Entities are the entities it names.")
file: Optional[KnowledgeFileBrief] = Field(default=None, description="File is the file it is in.")
links: Optional[List[KnowledgeSectionLink]] = Field(default=None, description="Links are the sections the graph reaches from it, strongest first.")
section: Optional[KnowledgeSectionBrief] = Field(default=None, description="Section is where it is.")
summary: Optional[StrictStr] = Field(default=None, description="Summary is its one-line account.")
text: Optional[StrictStr] = Field(default=None, description="Text is its own text — up to its first subsection — at most 64 KB.")
__properties: ClassVar[List[str]] = ["children", "entities", "file", "links", "section", "summary", "text"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of KnowledgeSectionOut from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in children (list)
_items = []
if self.children:
for _item_children in self.children:
if _item_children:
_items.append(_item_children.to_dict())
_dict['children'] = _items
# override the default output from pydantic by calling `to_dict()` of each item in entities (list)
_items = []
if self.entities:
for _item_entities in self.entities:
if _item_entities:
_items.append(_item_entities.to_dict())
_dict['entities'] = _items
# override the default output from pydantic by calling `to_dict()` of file
if self.file:
_dict['file'] = self.file.to_dict()
# override the default output from pydantic by calling `to_dict()` of each item in links (list)
_items = []
if self.links:
for _item_links in self.links:
if _item_links:
_items.append(_item_links.to_dict())
_dict['links'] = _items
# override the default output from pydantic by calling `to_dict()` of section
if self.section:
_dict['section'] = self.section.to_dict()
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of KnowledgeSectionOut from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"children": [KnowledgeTocEntry.from_dict(_item) for _item in obj["children"]] if obj.get("children") is not None else None,
"entities": [KnowledgeFileEntity.from_dict(_item) for _item in obj["entities"]] if obj.get("entities") is not None else None,
"file": KnowledgeFileBrief.from_dict(obj["file"]) if obj.get("file") is not None else None,
"links": [KnowledgeSectionLink.from_dict(_item) for _item in obj["links"]] if obj.get("links") is not None else None,
"section": KnowledgeSectionBrief.from_dict(obj["section"]) if obj.get("section") is not None else None,
"summary": obj.get("summary"),
"text": obj.get("text")
})
return _obj
@@ -0,0 +1,99 @@
# coding: utf-8
"""
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
class KnowledgeTocEntry(BaseModel):
"""
KnowledgeTocEntry
""" # noqa: E501
id: Optional[StrictInt] = Field(default=None, description="ID is the section's number; 0 is the document itself.")
level: Optional[StrictInt] = Field(default=None, description="Level is its depth: 0 for the document, 1 for a top-level heading.")
parent: Optional[StrictInt] = Field(default=None, description="Parent is the id of the section it sits in; -1 for the document.")
size: Optional[StrictInt] = Field(default=None, description="Size is how many bytes of the document it spans, subsections included.")
summary: Optional[StrictStr] = Field(default=None, description="Summary is a one-line account of what it covers.")
synthetic: Optional[StrictBool] = Field(default=None, description="Synthetic is true for a section the index cut out of a long run of text the document gave no structure to.")
title: Optional[StrictStr] = Field(default=None, description="Title is its heading.")
__properties: ClassVar[List[str]] = ["id", "level", "parent", "size", "summary", "synthetic", "title"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of KnowledgeTocEntry from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of KnowledgeTocEntry from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"id": obj.get("id"),
"level": obj.get("level"),
"parent": obj.get("parent"),
"size": obj.get("size"),
"summary": obj.get("summary"),
"synthetic": obj.get("synthetic"),
"title": obj.get("title")
})
return _obj
@@ -0,0 +1,101 @@
# coding: utf-8
"""
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from typing import Any, ClassVar, Dict, List, Optional
from hanzoai.cloud.models.knowledge_file import KnowledgeFile
from hanzoai.cloud.models.knowledge_toc_entry import KnowledgeTocEntry
from typing import Optional, Set
from typing_extensions import Self
class KnowledgeTocOut(BaseModel):
"""
KnowledgeTocOut
""" # noqa: E501
file: Optional[KnowledgeFile] = Field(default=None, description="File is the file it is of.")
sections: Optional[List[KnowledgeTocEntry]] = Field(default=None, description="Sections are its nodes in document order, the document first; Parent makes them a tree.")
__properties: ClassVar[List[str]] = ["file", "sections"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of KnowledgeTocOut from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of file
if self.file:
_dict['file'] = self.file.to_dict()
# override the default output from pydantic by calling `to_dict()` of each item in sections (list)
_items = []
if self.sections:
for _item_sections in self.sections:
if _item_sections:
_items.append(_item_sections.to_dict())
_dict['sections'] = _items
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of KnowledgeTocOut from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"file": KnowledgeFile.from_dict(obj["file"]) if obj.get("file") is not None else None,
"sections": [KnowledgeTocEntry.from_dict(_item) for _item in obj["sections"]] if obj.get("sections") is not None else None
})
return _obj
+89
View File
@@ -0,0 +1,89 @@
# coding: utf-8
"""
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
class S3PartURL(BaseModel):
"""
S3PartURL
""" # noqa: E501
part: Optional[StrictInt] = Field(default=None, description="Part is the part number.")
url: Optional[StrictStr] = Field(default=None, description="URL is the presigned address to PUT the part's bytes to, directly.")
__properties: ClassVar[List[str]] = ["part", "url"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of S3PartURL from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of S3PartURL from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"part": obj.get("part"),
"url": obj.get("url")
})
return _obj
+97
View File
@@ -0,0 +1,97 @@
# coding: utf-8
"""
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictInt
from typing import Any, ClassVar, Dict, List, Optional
from hanzoai.cloud.models.s3_part_url import S3PartURL
from typing import Optional, Set
from typing_extensions import Self
class S3PartURLs(BaseModel):
"""
S3PartURLs
""" # noqa: E501
expires_in: Optional[StrictInt] = Field(default=None, description="Expiry is how many seconds the URLs stay valid.", alias="expiresIn")
urls: Optional[List[S3PartURL]] = Field(default=None, description="URLs are one presigned PUT per part asked for.")
__properties: ClassVar[List[str]] = ["expiresIn", "urls"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of S3PartURLs from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in urls (list)
_items = []
if self.urls:
for _item_urls in self.urls:
if _item_urls:
_items.append(_item_urls.to_dict())
_dict['urls'] = _items
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of S3PartURLs from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"expiresIn": obj.get("expiresIn"),
"urls": [S3PartURL.from_dict(_item) for _item in obj["urls"]] if obj.get("urls") is not None else None
})
return _obj
@@ -0,0 +1,91 @@
# coding: utf-8
"""
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
class S3StoredPart(BaseModel):
"""
S3StoredPart
""" # noqa: E501
etag: Optional[StrictStr] = Field(default=None, description="ETag is the store's tag for its bytes, quotes stripped.")
part: Optional[StrictInt] = Field(default=None, description="Part is the part number.")
size: Optional[StrictInt] = Field(default=None, description="Size is its length in bytes.")
__properties: ClassVar[List[str]] = ["etag", "part", "size"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of S3StoredPart from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of S3StoredPart from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"etag": obj.get("etag"),
"part": obj.get("part"),
"size": obj.get("size")
})
return _obj
@@ -0,0 +1,99 @@
# coding: utf-8
"""
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from hanzoai.cloud.models.s3_stored_part import S3StoredPart
from typing import Optional, Set
from typing_extensions import Self
class S3StoredParts(BaseModel):
"""
S3StoredParts
""" # noqa: E501
key: Optional[StrictStr] = Field(default=None, description="Key is the object key it is bound to.")
parts: Optional[List[S3StoredPart]] = Field(default=None, description="Parts are the parts stored, in order. A client resuming sends the others.")
upload: Optional[StrictStr] = Field(default=None, description="Upload is the upload's id.")
__properties: ClassVar[List[str]] = ["key", "parts", "upload"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of S3StoredParts from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in parts (list)
_items = []
if self.parts:
for _item_parts in self.parts:
if _item_parts:
_items.append(_item_parts.to_dict())
_dict['parts'] = _items
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of S3StoredParts from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"key": obj.get("key"),
"parts": [S3StoredPart.from_dict(_item) for _item in obj["parts"]] if obj.get("parts") is not None else None,
"upload": obj.get("upload")
})
return _obj
@@ -0,0 +1,93 @@
# coding: utf-8
"""
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
class S3UploadDone(BaseModel):
"""
S3UploadDone
""" # noqa: E501
etag: Optional[StrictStr] = Field(default=None, description="ETag is the assembled object's tag, quotes stripped.")
key: Optional[StrictStr] = Field(default=None, description="Key is the object's key.")
parts: Optional[StrictInt] = Field(default=None, description="Parts is how many parts it was assembled from.")
size: Optional[StrictInt] = Field(default=None, description="Size is the object's length in bytes: the sum of its parts.")
__properties: ClassVar[List[str]] = ["etag", "key", "parts", "size"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of S3UploadDone from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of S3UploadDone from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"etag": obj.get("etag"),
"key": obj.get("key"),
"parts": obj.get("parts"),
"size": obj.get("size")
})
return _obj
@@ -0,0 +1,87 @@
# coding: utf-8
"""
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
class S3UploadGone(BaseModel):
"""
S3UploadGone
""" # noqa: E501
upload: Optional[StrictStr] = Field(default=None, description="Upload is the id of the upload abandoned; its stored parts are deleted.")
__properties: ClassVar[List[str]] = ["upload"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of S3UploadGone from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of S3UploadGone from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"upload": obj.get("upload")
})
return _obj
@@ -0,0 +1,93 @@
# coding: utf-8
"""
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
class S3UploadParts(BaseModel):
"""
S3UploadParts
""" # noqa: E501
bucket: Optional[StrictStr] = Field(default=None, description="Bucket is the bucket, from the path.")
key: Optional[StrictStr] = Field(default=None, description="Key is the object key the upload was started on.")
parts: Optional[List[StrictInt]] = Field(default=None, description="Parts are the part numbers to mint URLs for, from 1. At most 64 a call.")
upload: Optional[StrictStr] = Field(default=None, description="Upload is the upload's id, from the path.")
__properties: ClassVar[List[str]] = ["bucket", "key", "parts", "upload"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of S3UploadParts from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of S3UploadParts from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"bucket": obj.get("bucket"),
"key": obj.get("key"),
"parts": obj.get("parts"),
"upload": obj.get("upload")
})
return _obj
+91
View File
@@ -0,0 +1,91 @@
# coding: utf-8
"""
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
class S3UploadRef(BaseModel):
"""
S3UploadRef
""" # noqa: E501
bucket: Optional[StrictStr] = Field(default=None, description="Bucket is the bucket, from the path.")
key: Optional[StrictStr] = Field(default=None, description="Key is the object key the upload was started on. In the query for a read or an abandon, in the body to complete.")
upload: Optional[StrictStr] = Field(default=None, description="Upload is the upload's id, from the path.")
__properties: ClassVar[List[str]] = ["bucket", "key", "upload"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of S3UploadRef from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of S3UploadRef from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"bucket": obj.get("bucket"),
"key": obj.get("key"),
"upload": obj.get("upload")
})
return _obj
@@ -0,0 +1,91 @@
# coding: utf-8
"""
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
class S3UploadStart(BaseModel):
"""
S3UploadStart
""" # noqa: E501
bucket: Optional[StrictStr] = Field(default=None, description="Bucket is the bucket to upload into, from the path.")
key: Optional[StrictStr] = Field(default=None, description="Key is the object key the upload will become, relative to the bucket root. It is path-cleaned, so a \"../\" cannot escape the bucket.")
type: Optional[StrictStr] = Field(default=None, description="Type is the object's media type, kept with it once it is assembled.")
__properties: ClassVar[List[str]] = ["bucket", "key", "type"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of S3UploadStart from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of S3UploadStart from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"bucket": obj.get("bucket"),
"key": obj.get("key"),
"type": obj.get("type")
})
return _obj
@@ -0,0 +1,91 @@
# coding: utf-8
"""
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
class S3UploadStarted(BaseModel):
"""
S3UploadStarted
""" # noqa: E501
key: Optional[StrictStr] = Field(default=None, description="Key is the object key the upload is bound to.")
part_size: Optional[StrictInt] = Field(default=None, description="PartSize is the size every part but the last must be, in bytes. The number of parts is the file's size divided by it, rounded up.", alias="partSize")
upload: Optional[StrictStr] = Field(default=None, description="Upload is the upload's id, which every later call names.")
__properties: ClassVar[List[str]] = ["key", "partSize", "upload"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of S3UploadStarted from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of S3UploadStarted from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"key": obj.get("key"),
"partSize": obj.get("partSize"),
"upload": obj.get("upload")
})
return _obj
+4 -2
View File
@@ -27,15 +27,16 @@ class SearchHit(BaseModel):
"""
SearchHit
""" # noqa: E501
corpus: Optional[StrictStr] = Field(default=None, description="Corpus is which store the document lives in: \"kb\" for a document either knowledge leg returned, \"code\" for a span out of one of the org's own repositories. It is PROVENANCE — read it to say where a hit came from, not to branch on: the fused ranking is what decides order, and a caller that filters by corpus wants the backend's own endpoint instead.")
corpus: Optional[StrictStr] = Field(default=None, description="Corpus is which store the document lives in: \"kb\" for a document either knowledge leg returned, \"code\" for a span out of one of the org's own repositories, \"files\" for a passage of one of the org's workspace files (ID is then the file's id and Title its citation). It is PROVENANCE — read it to say where a hit came from, not to branch on: the fused ranking is what decides order, and a caller that filters by corpus wants the backend's own endpoint instead.")
doctype: Optional[StrictStr] = Field(default=None, description="DocType is the knowledge doctype: kb.page, kb.memory or kb.source from the semantic leg, and a lexical row's own doctype/type field otherwise. Absent when the row carried neither.")
id: Optional[StrictStr] = Field(default=None, description="ID is the document's identity inside its corpus — the KB document name from the semantic leg, or a lexical row's own name/id/_id (falling back to \"row-<n>\" when the row carries none). It is unique with DocType, not alone: the pair is the key the two legs are fused on.")
matched: Optional[List[SearchProvenance]] = Field(default=None, description="Matched is one entry per leg that returned this document, with that leg's rank and native score. More than one entry means the legs AGREED, which is exactly why the hit outranks one a single leg found. Never empty on a returned hit.")
passage: Optional[StrictStr] = Field(default=None, description="Passage is the matching passage, for a hit from the files corpus: the span of the file's section that matched, about 2000 bytes. Absent for every other corpus, whose hits name a document rather than a span of one.")
project: Optional[StrictStr] = Field(default=None, description="Project is the project scope the document was indexed under. Absent for a document saved with none; Request.Project filters the semantic leg on it.")
score: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Score is the FUSED score, not a relevance or a similarity: Reciprocal Rank Fusion sums 1/(60+rank) over each leg that returned the document, so it is bounded by roughly 1/61 per leg (about 0.033 for a document two legs put first) and hits are ordered by it, descending. Being built from ranks, it is comparable only WITHIN one response — never across queries, and never against a backend's own score, which stays in Matched.")
title: Optional[StrictStr] = Field(default=None, description="Title is the document's display title — the indexed title from the semantic leg, the row's title (falling back to its name) from the lexical one. Absent when the document has none.")
url: Optional[StrictStr] = Field(default=None, description="URL is where the document can be opened, carried from the indexed payload — the link back to the app a connector ingested it from. Absent for anything written in the product, which has no external address.")
__properties: ClassVar[List[str]] = ["corpus", "doctype", "id", "matched", "project", "score", "title", "url"]
__properties: ClassVar[List[str]] = ["corpus", "doctype", "id", "matched", "passage", "project", "score", "title", "url"]
model_config = ConfigDict(
populate_by_name=True,
@@ -99,6 +100,7 @@ class SearchHit(BaseModel):
"doctype": obj.get("doctype"),
"id": obj.get("id"),
"matched": [SearchProvenance.from_dict(_item) for _item in obj["matched"]] if obj.get("matched") is not None else None,
"passage": obj.get("passage"),
"project": obj.get("project"),
"score": obj.get("score"),
"title": obj.get("title"),
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "hanzoai"
version = "8.5.544"
version = "8.5.547"
description = "The official Python library for the Hanzo API"
dynamic = ["readme"]
license = "Apache-2.0"
Generated
+1 -1
View File
@@ -2252,7 +2252,7 @@ wheels = [
[[package]]
name = "hanzoai"
version = "8.5.542"
version = "8.5.544"
source = { editable = "." }
dependencies = [
{ name = "pydantic" },