Skip to content

Commit

Permalink
cli works loading tool repo from hub
Browse files Browse the repository at this point in the history
  • Loading branch information
C0deMunk33 authored and richardblythman committed Dec 20, 2024
1 parent 60d59d5 commit 26206c0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 1 addition & 2 deletions naptha_sdk/client/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class Hub:
"""The Hub class is the entry point into Naptha AI Hub."""

def __init__(self, hub_url, public_key=None, *args, **kwargs):
print("HUB URL: ", hub_url)
self.hub_url = hub_url
self.public_key = public_key
self.ns = "naptha"
Expand Down Expand Up @@ -269,7 +268,7 @@ async def list_toolsets(self, toolset_name=None) -> List:

async def get_toolset(self, toolset_id: str) -> Optional[Dict]:
print(f"Getting toolset: {toolset_id}")
toolsets = await self.surrealdb.query(f"SELECT * FROM agent;")
toolsets = await self.surrealdb.query(f"SELECT * FROM toolset;")
print(toolsets)
return toolsets[0]

Expand Down
9 changes: 7 additions & 2 deletions naptha_sdk/toolset.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,20 @@ async def load_or_add_tool_repo_to_toolset_from_hub(self, toolset_name, toolset_

# pull toolset from hub
hub_url = os.getenv("HUB_URL", None)
print(f"hub_url: {hub_url}")

hub = Hub(hub_url)
await hub.connect()

# TODO: fix this
await hub.surrealdb.signin({"user": "root", "pass": "root"})
toolset = await hub.get_toolset(toolset_hub_id)


print(f"toolset: {toolset}")
print(f"toolset: {toolset['result'][0]["source_url"]}")
print(type(toolset['result'][0]["source_url"]))

toolset_url = toolset["source_url"]
toolset_url = toolset['result'][0]["source_url"]

try:
request = ToolsetLoadRepoRequest(
Expand Down

0 comments on commit 26206c0

Please sign in to comment.