ailtir-cli 2.0.1__tar.gz → 2.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ailtir_cli-2.0.1/src/ailtir_cli.egg-info → ailtir_cli-2.2.0}/PKG-INFO +1 -1
- {ailtir_cli-2.0.1 → ailtir_cli-2.2.0}/pyproject.toml +1 -1
- {ailtir_cli-2.0.1 → ailtir_cli-2.2.0}/src/ailtir_cli/app.py +3 -1
- {ailtir_cli-2.0.1 → ailtir_cli-2.2.0}/src/ailtir_cli/commands/__init__.py +1 -0
- ailtir_cli-2.2.0/src/ailtir_cli/commands/agents/__init__.py +6 -0
- ailtir_cli-2.2.0/src/ailtir_cli/commands/agents/profiler.py +42 -0
- ailtir_cli-2.0.1/src/ailtir_cli/commands/agents/research.py → ailtir_cli-2.2.0/src/ailtir_cli/commands/agents/researcher.py +4 -4
- ailtir_cli-2.2.0/src/ailtir_cli/commands/profiles/__init__.py +5 -0
- ailtir_cli-2.2.0/src/ailtir_cli/commands/profiles/get.py +34 -0
- {ailtir_cli-2.0.1 → ailtir_cli-2.2.0/src/ailtir_cli.egg-info}/PKG-INFO +1 -1
- {ailtir_cli-2.0.1 → ailtir_cli-2.2.0}/src/ailtir_cli.egg-info/SOURCES.txt +5 -2
- ailtir_cli-2.0.1/src/ailtir_cli/commands/agents/__init__.py +0 -5
- {ailtir_cli-2.0.1 → ailtir_cli-2.2.0}/LICENSE +0 -0
- {ailtir_cli-2.0.1 → ailtir_cli-2.2.0}/README.md +0 -0
- {ailtir_cli-2.0.1 → ailtir_cli-2.2.0}/setup.cfg +0 -0
- {ailtir_cli-2.0.1 → ailtir_cli-2.2.0}/src/ailtir_cli/__init__.py +0 -0
- {ailtir_cli-2.0.1 → ailtir_cli-2.2.0}/src/ailtir_cli/commands/kbs/__init__.py +0 -0
- {ailtir_cli-2.0.1 → ailtir_cli-2.2.0}/src/ailtir_cli/commands/kbs/analyse.py +0 -0
- {ailtir_cli-2.0.1 → ailtir_cli-2.2.0}/src/ailtir_cli/commands/kbs/chat.py +0 -0
- {ailtir_cli-2.0.1 → ailtir_cli-2.2.0}/src/ailtir_cli/commands/kbs/list_kbs.py +0 -0
- {ailtir_cli-2.0.1 → ailtir_cli-2.2.0}/src/ailtir_cli/commands/kbs/upload.py +0 -0
- {ailtir_cli-2.0.1 → ailtir_cli-2.2.0}/src/ailtir_cli/commands/version.py +0 -0
- {ailtir_cli-2.0.1 → ailtir_cli-2.2.0}/src/ailtir_cli/config.py +0 -0
- {ailtir_cli-2.0.1 → ailtir_cli-2.2.0}/src/ailtir_cli/main.py +0 -0
- {ailtir_cli-2.0.1 → ailtir_cli-2.2.0}/src/ailtir_cli.egg-info/dependency_links.txt +0 -0
- {ailtir_cli-2.0.1 → ailtir_cli-2.2.0}/src/ailtir_cli.egg-info/entry_points.txt +0 -0
- {ailtir_cli-2.0.1 → ailtir_cli-2.2.0}/src/ailtir_cli.egg-info/requires.txt +0 -0
- {ailtir_cli-2.0.1 → ailtir_cli-2.2.0}/src/ailtir_cli.egg-info/top_level.txt +0 -0
|
@@ -5,13 +5,15 @@ from rich.console import Console
|
|
|
5
5
|
|
|
6
6
|
from ailtir_cli.commands.agents import agents_app
|
|
7
7
|
from ailtir_cli.commands.kbs import kbs_app
|
|
8
|
+
from ailtir_cli.commands.profiles import profiles_app
|
|
8
9
|
|
|
9
10
|
_console = Console(stderr=True)
|
|
10
11
|
_DOCS_URL = "https://team-ailtir.github.io/ailtir-cli/"
|
|
11
12
|
|
|
12
13
|
app = typer.Typer(name="ailtir", help="The Ailtir CLI", no_args_is_help=True)
|
|
13
|
-
app.add_typer(kbs_app, name="kbs")
|
|
14
14
|
app.add_typer(agents_app, name="agents")
|
|
15
|
+
app.add_typer(kbs_app, name="kbs")
|
|
16
|
+
app.add_typer(profiles_app, name="profiles")
|
|
15
17
|
|
|
16
18
|
|
|
17
19
|
@app.callback()
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import httpx
|
|
2
|
+
import structlog
|
|
3
|
+
import typer
|
|
4
|
+
from rich.console import Console
|
|
5
|
+
|
|
6
|
+
from ailtir_cli.commands.agents import agents_app
|
|
7
|
+
from ailtir_cli.config import settings
|
|
8
|
+
|
|
9
|
+
_log = structlog.get_logger(__name__)
|
|
10
|
+
_console = Console()
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@agents_app.command()
|
|
14
|
+
def profiler(
|
|
15
|
+
prompt: str = typer.Argument(None, help="Optional prompt for the profiler agent."),
|
|
16
|
+
url: str = typer.Argument(None, help="Optional company URL to profile."),
|
|
17
|
+
) -> None:
|
|
18
|
+
"""Run the profiler agent with an optional prompt and company URL."""
|
|
19
|
+
_console.print("Profiling...")
|
|
20
|
+
|
|
21
|
+
token = settings.ailtir_cli_api_token
|
|
22
|
+
body: dict = {}
|
|
23
|
+
if prompt is not None:
|
|
24
|
+
body["prompt"] = prompt
|
|
25
|
+
if url is not None:
|
|
26
|
+
body["company_url"] = url
|
|
27
|
+
|
|
28
|
+
with httpx.Client(base_url=settings.cli_api_url, timeout=120.0) as http:
|
|
29
|
+
try:
|
|
30
|
+
resp = http.post(
|
|
31
|
+
"/agents/profiler",
|
|
32
|
+
json=body,
|
|
33
|
+
headers={"Authorization": f"Bearer {token}"},
|
|
34
|
+
)
|
|
35
|
+
resp.raise_for_status()
|
|
36
|
+
except httpx.HTTPStatusError as exc:
|
|
37
|
+
_console.print(f"[red]Error: {exc.response.status_code}[/red]")
|
|
38
|
+
raise typer.Exit(1) from exc
|
|
39
|
+
|
|
40
|
+
data = resp.json()
|
|
41
|
+
_log.info("agents.profiler.complete", prompt=prompt)
|
|
42
|
+
_console.print(data.get("result", "No result returned."))
|
|
@@ -11,10 +11,10 @@ _console = Console()
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
@agents_app.command()
|
|
14
|
-
def
|
|
14
|
+
def researcher(
|
|
15
15
|
topic: str = typer.Argument(..., help="The topic to research."),
|
|
16
16
|
) -> None:
|
|
17
|
-
"""Run the
|
|
17
|
+
"""Run the researcher agent on a given topic."""
|
|
18
18
|
_console.print(f"Researching: [bold]{topic}[/bold]...")
|
|
19
19
|
|
|
20
20
|
token = settings.ailtir_cli_api_token
|
|
@@ -22,7 +22,7 @@ def research(
|
|
|
22
22
|
with httpx.Client(base_url=settings.cli_api_url, timeout=120.0) as http:
|
|
23
23
|
try:
|
|
24
24
|
resp = http.post(
|
|
25
|
-
"/agents/
|
|
25
|
+
"/agents/researcher",
|
|
26
26
|
json={"topic": topic},
|
|
27
27
|
headers={"Authorization": f"Bearer {token}"},
|
|
28
28
|
)
|
|
@@ -32,5 +32,5 @@ def research(
|
|
|
32
32
|
raise typer.Exit(1) from exc
|
|
33
33
|
|
|
34
34
|
data = resp.json()
|
|
35
|
-
_log.info("agents.
|
|
35
|
+
_log.info("agents.researcher.complete", topic=topic)
|
|
36
36
|
_console.print(data.get("result", "No result returned."))
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import httpx
|
|
2
|
+
import structlog
|
|
3
|
+
import typer
|
|
4
|
+
from rich.console import Console
|
|
5
|
+
|
|
6
|
+
from ailtir_cli.commands.profiles import profiles_app
|
|
7
|
+
from ailtir_cli.config import settings
|
|
8
|
+
|
|
9
|
+
_log = structlog.get_logger(__name__)
|
|
10
|
+
_console = Console()
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@profiles_app.command()
|
|
14
|
+
def get(
|
|
15
|
+
user_id: str = typer.Argument(..., help="The user ID whose profile to fetch."),
|
|
16
|
+
) -> None:
|
|
17
|
+
"""Fetch the profile for a given user ID."""
|
|
18
|
+
token = settings.ailtir_cli_api_token
|
|
19
|
+
|
|
20
|
+
with httpx.Client(base_url=settings.cli_api_url, timeout=30.0) as http:
|
|
21
|
+
try:
|
|
22
|
+
resp = http.get(
|
|
23
|
+
f"/profiles/{user_id}",
|
|
24
|
+
headers={"Authorization": f"Bearer {token}"},
|
|
25
|
+
)
|
|
26
|
+
resp.raise_for_status()
|
|
27
|
+
except httpx.HTTPStatusError as exc:
|
|
28
|
+
_console.print(f"[red]Error: {exc.response.status_code}[/red]")
|
|
29
|
+
raise typer.Exit(1) from exc
|
|
30
|
+
|
|
31
|
+
data = resp.json()
|
|
32
|
+
_log.info("profiles.get.complete", user_id=user_id)
|
|
33
|
+
_console.print(f"[green]id[/green]: {data.get('id', '')}")
|
|
34
|
+
_console.print(f"[green]user_id[/green]: {data.get('user_id', '')}")
|
|
@@ -14,9 +14,12 @@ src/ailtir_cli.egg-info/top_level.txt
|
|
|
14
14
|
src/ailtir_cli/commands/__init__.py
|
|
15
15
|
src/ailtir_cli/commands/version.py
|
|
16
16
|
src/ailtir_cli/commands/agents/__init__.py
|
|
17
|
-
src/ailtir_cli/commands/agents/
|
|
17
|
+
src/ailtir_cli/commands/agents/profiler.py
|
|
18
|
+
src/ailtir_cli/commands/agents/researcher.py
|
|
18
19
|
src/ailtir_cli/commands/kbs/__init__.py
|
|
19
20
|
src/ailtir_cli/commands/kbs/analyse.py
|
|
20
21
|
src/ailtir_cli/commands/kbs/chat.py
|
|
21
22
|
src/ailtir_cli/commands/kbs/list_kbs.py
|
|
22
|
-
src/ailtir_cli/commands/kbs/upload.py
|
|
23
|
+
src/ailtir_cli/commands/kbs/upload.py
|
|
24
|
+
src/ailtir_cli/commands/profiles/__init__.py
|
|
25
|
+
src/ailtir_cli/commands/profiles/get.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|