ailtir-cli 2.0.0__tar.gz → 2.1.2__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.0/src/ailtir_cli.egg-info → ailtir_cli-2.1.2}/PKG-INFO +1 -1
- {ailtir_cli-2.0.0 → ailtir_cli-2.1.2}/pyproject.toml +1 -1
- {ailtir_cli-2.0.0 → ailtir_cli-2.1.2}/src/ailtir_cli/app.py +5 -3
- {ailtir_cli-2.0.0 → ailtir_cli-2.1.2}/src/ailtir_cli/commands/__init__.py +1 -0
- {ailtir_cli-2.0.0 → ailtir_cli-2.1.2}/src/ailtir_cli/commands/agents/research.py +1 -1
- {ailtir_cli-2.0.0 → ailtir_cli-2.1.2}/src/ailtir_cli/commands/kbs/analyse.py +1 -1
- {ailtir_cli-2.0.0 → ailtir_cli-2.1.2}/src/ailtir_cli/commands/kbs/chat.py +1 -1
- {ailtir_cli-2.0.0 → ailtir_cli-2.1.2}/src/ailtir_cli/commands/kbs/list_kbs.py +1 -1
- {ailtir_cli-2.0.0 → ailtir_cli-2.1.2}/src/ailtir_cli/commands/kbs/upload.py +1 -1
- ailtir_cli-2.1.2/src/ailtir_cli/commands/profiles/__init__.py +5 -0
- ailtir_cli-2.1.2/src/ailtir_cli/commands/profiles/get.py +34 -0
- {ailtir_cli-2.0.0 → ailtir_cli-2.1.2}/src/ailtir_cli/config.py +1 -1
- {ailtir_cli-2.0.0 → ailtir_cli-2.1.2/src/ailtir_cli.egg-info}/PKG-INFO +1 -1
- {ailtir_cli-2.0.0 → ailtir_cli-2.1.2}/src/ailtir_cli.egg-info/SOURCES.txt +3 -1
- {ailtir_cli-2.0.0 → ailtir_cli-2.1.2}/LICENSE +0 -0
- {ailtir_cli-2.0.0 → ailtir_cli-2.1.2}/README.md +0 -0
- {ailtir_cli-2.0.0 → ailtir_cli-2.1.2}/setup.cfg +0 -0
- {ailtir_cli-2.0.0 → ailtir_cli-2.1.2}/src/ailtir_cli/__init__.py +0 -0
- {ailtir_cli-2.0.0 → ailtir_cli-2.1.2}/src/ailtir_cli/commands/agents/__init__.py +0 -0
- {ailtir_cli-2.0.0 → ailtir_cli-2.1.2}/src/ailtir_cli/commands/kbs/__init__.py +0 -0
- {ailtir_cli-2.0.0 → ailtir_cli-2.1.2}/src/ailtir_cli/commands/version.py +0 -0
- {ailtir_cli-2.0.0 → ailtir_cli-2.1.2}/src/ailtir_cli/main.py +0 -0
- {ailtir_cli-2.0.0 → ailtir_cli-2.1.2}/src/ailtir_cli.egg-info/dependency_links.txt +0 -0
- {ailtir_cli-2.0.0 → ailtir_cli-2.1.2}/src/ailtir_cli.egg-info/entry_points.txt +0 -0
- {ailtir_cli-2.0.0 → ailtir_cli-2.1.2}/src/ailtir_cli.egg-info/requires.txt +0 -0
- {ailtir_cli-2.0.0 → ailtir_cli-2.1.2}/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()
|
|
@@ -26,7 +28,7 @@ def _check_config(ctx: typer.Context) -> None:
|
|
|
26
28
|
|
|
27
29
|
from ailtir_cli.config import settings
|
|
28
30
|
|
|
29
|
-
if not settings.
|
|
30
|
-
_console.print("[red]Error:[/red]
|
|
31
|
+
if not settings.ailtir_cli_api_token:
|
|
32
|
+
_console.print("[red]Error:[/red] AILTIR_CLI_API_TOKEN is not set.")
|
|
31
33
|
_console.print(f"Get your CLI key and set it up: [link]{_DOCS_URL}[/link]")
|
|
32
34
|
raise typer.Exit(1)
|
|
@@ -17,7 +17,7 @@ def research(
|
|
|
17
17
|
"""Run the research agent on a given topic."""
|
|
18
18
|
_console.print(f"Researching: [bold]{topic}[/bold]...")
|
|
19
19
|
|
|
20
|
-
token = settings.
|
|
20
|
+
token = settings.ailtir_cli_api_token
|
|
21
21
|
|
|
22
22
|
with httpx.Client(base_url=settings.cli_api_url, timeout=120.0) as http:
|
|
23
23
|
try:
|
|
@@ -15,7 +15,7 @@ def analyse(kb_id: str = typer.Argument(..., help="The knowledge base ID to anal
|
|
|
15
15
|
"""Trigger analysis and Knowledge Base creation for an uploaded ZIP."""
|
|
16
16
|
_console.print(f"Starting analysis for kb_id: [bold]{kb_id}[/bold]...")
|
|
17
17
|
|
|
18
|
-
token = settings.
|
|
18
|
+
token = settings.ailtir_cli_api_token
|
|
19
19
|
|
|
20
20
|
with httpx.Client(base_url=settings.cli_api_url, timeout=30.0) as http:
|
|
21
21
|
try:
|
|
@@ -18,7 +18,7 @@ def chat(
|
|
|
18
18
|
"""Ask a question answered using documents in a knowledge base (RAG)."""
|
|
19
19
|
_console.print(f"Querying kb_id: [bold]{kb_id}[/bold]...")
|
|
20
20
|
|
|
21
|
-
token = settings.
|
|
21
|
+
token = settings.ailtir_cli_api_token
|
|
22
22
|
|
|
23
23
|
with httpx.Client(base_url=settings.cli_api_url, timeout=60.0) as http:
|
|
24
24
|
try:
|
|
@@ -26,7 +26,7 @@ def list_kbs(
|
|
|
26
26
|
output: OutputFormat = _OUTPUT_OPTION,
|
|
27
27
|
) -> None:
|
|
28
28
|
"""List all knowledge bases in your Ailtir account."""
|
|
29
|
-
token = settings.
|
|
29
|
+
token = settings.ailtir_cli_api_token
|
|
30
30
|
|
|
31
31
|
with httpx.Client(base_url=settings.cli_api_url, timeout=30.0) as http:
|
|
32
32
|
try:
|
|
@@ -31,7 +31,7 @@ def upload(
|
|
|
31
31
|
_console.print(f"Uploading [bold]{path.name}[/bold]...")
|
|
32
32
|
|
|
33
33
|
content = path.read_bytes()
|
|
34
|
-
token = settings.
|
|
34
|
+
token = settings.ailtir_cli_api_token
|
|
35
35
|
|
|
36
36
|
with httpx.Client(base_url=settings.cli_api_url, timeout=30.0) as http:
|
|
37
37
|
try:
|
|
@@ -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', '')}")
|
|
@@ -3,7 +3,7 @@ from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
class Settings(BaseSettings):
|
|
6
|
-
|
|
6
|
+
ailtir_cli_api_token: str = Field(default="")
|
|
7
7
|
cli_api_url: str = Field(default="https://app.ailtir.ai/api-cli")
|
|
8
8
|
log_format: str = Field(default="console")
|
|
9
9
|
log_level: str = Field(default="INFO")
|
|
@@ -19,4 +19,6 @@ src/ailtir_cli/commands/kbs/__init__.py
|
|
|
19
19
|
src/ailtir_cli/commands/kbs/analyse.py
|
|
20
20
|
src/ailtir_cli/commands/kbs/chat.py
|
|
21
21
|
src/ailtir_cli/commands/kbs/list_kbs.py
|
|
22
|
-
src/ailtir_cli/commands/kbs/upload.py
|
|
22
|
+
src/ailtir_cli/commands/kbs/upload.py
|
|
23
|
+
src/ailtir_cli/commands/profiles/__init__.py
|
|
24
|
+
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
|