Skip to content

Commit

Permalink
feat: include tools subcommand
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarolopez committed Sep 10, 2024
1 parent 6498fb0 commit e594146
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/ai4_cli/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import ai4_cli
from ai4_cli.cli import modules
from ai4_cli.cli import tools
from ai4_cli.client import client

app = typer.Typer(
Expand All @@ -28,6 +29,7 @@
"""
)
app.add_typer(modules.app, name="modules")
app.add_typer(tools.app, name="tools")


DOTENV_FILE = os.getenv("AI4_DOTENV_FILE", ".env.ai4")
Expand Down
7 changes: 7 additions & 0 deletions src/ai4_cli/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import ai4_cli
from ai4_cli.client import modules
from ai4_cli.client import tools
from ai4_cli import exceptions


Expand Down Expand Up @@ -42,6 +43,7 @@ def __init__(self, endpoint, version="v1", http_debug=False):
self.url = parse.urljoin(self.endpoint, self.version + "/")

self._modules = modules._Modules(self)
self._tools = tools._Tools(self)
self._logger = logging.getLogger(__name__)

self.session = requests.Session()
Expand All @@ -66,6 +68,11 @@ def modules(self):
"""Return the modules client."""
return self._modules

@property
def tools(self):
"""Return the tools client."""
return self._tools

# TODO(aloga): implement cache_request
# @cache_request
def request(self, url, method, json=None, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion src/ai4_cli/client/modules.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Module HTTP client."""
"""Modules (catalog) HTTP client."""


class _Modules(object):
Expand Down

0 comments on commit e594146

Please sign in to comment.