diff --git a/api/src/schemas.py b/api/src/schemas.py index e99e181..1f222d9 100644 --- a/api/src/schemas.py +++ b/api/src/schemas.py @@ -1,7 +1,7 @@ import datetime import uuid -from pydantic import BaseModel, validator +from pydantic import BaseModel, Field, validator class AppBase(BaseModel): @@ -21,7 +21,7 @@ class AppUpdate(AppBase): class App(AppBase): id: uuid.UUID name: str - h_metadata: dict + h_metadata: dict = Field(exclude=True) metadata: dict created_at: datetime.datetime @@ -33,7 +33,7 @@ def fetch_h_metadata(cls, value, values): class Config: from_attributes = True - schema_extra = {"exclude": ["h_metadata"]} + json_schema_extra = {"exclude": ["h_metadata"]} class UserBase(BaseModel): @@ -54,7 +54,7 @@ class User(UserBase): id: uuid.UUID app_id: uuid.UUID created_at: datetime.datetime - h_metadata: dict + h_metadata: dict = Field(exclude=True) metadata: dict @validator("metadata", pre=True, allow_reuse=True) @@ -65,7 +65,7 @@ def fetch_h_metadata(cls, value, values): class Config: from_attributes = True - schema_extra = {"exclude": ["h_metadata"]} + json_schema_extra = {"exclude": ["h_metadata"]} class MessageBase(BaseModel): @@ -87,7 +87,7 @@ class Message(MessageBase): is_user: bool session_id: uuid.UUID id: uuid.UUID - h_metadata: dict + h_metadata: dict = Field(exclude=True) metadata: dict created_at: datetime.datetime @@ -99,7 +99,7 @@ def fetch_h_metadata(cls, value, values): class Config: from_attributes = True - schema_extra = {"exclude": ["h_metadata"]} + json_schema_extra = {"exclude": ["h_metadata"]} class SessionBase(BaseModel): @@ -121,7 +121,7 @@ class Session(SessionBase): is_active: bool user_id: uuid.UUID location_id: str - h_metadata: dict + h_metadata: dict = Field(exclude=True) metadata: dict created_at: datetime.datetime @@ -133,7 +133,7 @@ def fetch_h_metadata(cls, value, values): class Config: from_attributes = True - schema_extra = {"exclude": ["h_metadata"]} + json_schema_extra = {"exclude": ["h_metadata"]} class MetamessageBase(BaseModel): @@ -158,7 +158,7 @@ class Metamessage(MetamessageBase): content: str id: uuid.UUID message_id: uuid.UUID - h_metadata: dict + h_metadata: dict = Field(exclude=True) metadata: dict created_at: datetime.datetime @@ -170,7 +170,7 @@ def fetch_h_metadata(cls, value, values): class Config: from_attributes = True - schema_extra = {"exclude": ["h_metadata"]} + json_schema_extra = {"exclude": ["h_metadata"]} class CollectionBase(BaseModel): @@ -191,7 +191,7 @@ class Collection(CollectionBase): id: uuid.UUID name: str user_id: uuid.UUID - h_metadata: dict + h_metadata: dict = Field(exclude=True) metadata: dict created_at: datetime.datetime @@ -203,7 +203,7 @@ def fetch_h_metadata(cls, value, values): class Config: from_attributes = True - schema_extra = {"exclude": ["h_metadata"]} + json_schema_extra = {"exclude": ["h_metadata"]} class DocumentBase(BaseModel): @@ -222,7 +222,7 @@ class DocumentUpdate(DocumentBase): class Document(DocumentBase): id: uuid.UUID content: str - h_metadata: dict + h_metadata: dict = Field(exclude=True) metadata: dict created_at: datetime.datetime collection_id: uuid.UUID @@ -235,7 +235,7 @@ def fetch_h_metadata(cls, value, values): class Config: from_attributes = True - schema_extra = {"exclude": ["h_metadata"]} + json_schema_extra = {"exclude": ["h_metadata"]} class AgentChat(BaseModel): diff --git a/sdk/docs/_static/favicon.svg b/sdk/docs/_static/favicon.svg new file mode 100644 index 0000000..6bcb833 --- /dev/null +++ b/sdk/docs/_static/favicon.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sdk/docs/conf.py b/sdk/docs/conf.py index 3798508..ecdee16 100644 --- a/sdk/docs/conf.py +++ b/sdk/docs/conf.py @@ -39,3 +39,5 @@ html_theme = "furo" html_static_path = ["_static"] + +html_favicon = "_static/favicon.svg" diff --git a/sdk/tests/test_sync.py b/sdk/tests/test_sync.py index 0077ff0..d6fa208 100644 --- a/sdk/tests/test_sync.py +++ b/sdk/tests/test_sync.py @@ -3,14 +3,14 @@ import pytest from honcho import ( + Document, GetDocumentPage, GetMessagePage, GetMetamessagePage, GetSessionPage, - Session, - Document, Message, Metamessage, + Session, ) from honcho import Honcho as Honcho @@ -251,9 +251,7 @@ def test_paginated_messages(): created_session.create_message(is_user=False, content="Hi") page_size = 7 - get_message_response = created_session.get_messages( - page=1, page_size=page_size - ) + get_message_response = created_session.get_messages(page=1, page_size=page_size) assert get_message_response is not None assert isinstance(get_message_response, GetMessagePage) @@ -448,9 +446,7 @@ def test_collection_query(): collection = user.create_collection(col_name) # Add documents - doc1 = collection.create_document( - content="The user loves puppies", metadata={} - ) + doc1 = collection.create_document(content="The user loves puppies", metadata={}) doc2 = collection.create_document(content="The user owns a dog", metadata={}) doc3 = collection.create_document(content="The user is a doctor", metadata={})