Skip to content

Commit

Permalink
SDK compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
VVoruganti committed May 7, 2024
1 parent 503875f commit c2d40db
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions sdk/honcho/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ async def get_user(self, name: str):
Returns:
AsyncUser: The User object
"""
url = f"{self.base_url}/users/{name}"
url = f"{self.base_url}/users/name/{name}"
response = await self.client.get(url)
response.raise_for_status()
data = response.json()
Expand Down Expand Up @@ -793,7 +793,7 @@ async def get_collection(self, name: str):
AsyncCollection: The Session object of the requested Session
"""
url = f"{self.base_url}/collections/{name}"
url = f"{self.base_url}/collections/name/{name}"
response = await self.honcho.client.get(url)
response.raise_for_status()
data = response.json()
Expand Down
4 changes: 2 additions & 2 deletions sdk/honcho/sync_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ def get_user(self, name: str):
Returns:
User: The User object
"""
url = f"{self.base_url}/users/{name}"
url = f"{self.base_url}/users/name/{name}"
response = self.client.get(url)
response.raise_for_status()
data = response.json()
Expand Down Expand Up @@ -793,7 +793,7 @@ def get_collection(self, name: str):
Collection: The Session object of the requested Session
"""
url = f"{self.base_url}/collections/{name}"
url = f"{self.base_url}/collections/name/{name}"
response = self.honcho.client.get(url)
response.raise_for_status()
data = response.json()
Expand Down
8 changes: 6 additions & 2 deletions sdk/tests/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,9 @@ 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)
Expand Down Expand Up @@ -446,7 +448,9 @@ 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={})

Expand Down

0 comments on commit c2d40db

Please sign in to comment.