agenta 0.1.16__tar.gz → 0.1.18__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.
Potentially problematic release.
This version of agenta might be problematic. Click here for more details.
- {agenta-0.1.16 → agenta-0.1.18}/PKG-INFO +1 -1
- {agenta-0.1.16 → agenta-0.1.18}/agenta/cli/main.py +11 -3
- {agenta-0.1.16 → agenta-0.1.18}/agenta/sdk/agenta.py +1 -1
- {agenta-0.1.16 → agenta-0.1.18}/pyproject.toml +1 -1
- {agenta-0.1.16 → agenta-0.1.18}/README.md +0 -0
- {agenta-0.1.16 → agenta-0.1.18}/agenta/__init__.py +0 -0
- {agenta-0.1.16 → agenta-0.1.18}/agenta/cli/helper.py +0 -0
- {agenta-0.1.16 → agenta-0.1.18}/agenta/cli/variant_commands.py +0 -0
- {agenta-0.1.16 → agenta-0.1.18}/agenta/client/Readme.md +0 -0
- {agenta-0.1.16 → agenta-0.1.18}/agenta/client/__init__.py +0 -0
- {agenta-0.1.16 → agenta-0.1.18}/agenta/client/api_models.py +0 -0
- {agenta-0.1.16 → agenta-0.1.18}/agenta/client/client.py +0 -0
- {agenta-0.1.16 → agenta-0.1.18}/agenta/config.py +0 -0
- {agenta-0.1.16 → agenta-0.1.18}/agenta/config.toml +0 -0
- {agenta-0.1.16 → agenta-0.1.18}/agenta/docker/docker-assets/Dockerfile.template +0 -0
- {agenta-0.1.16 → agenta-0.1.18}/agenta/docker/docker-assets/README.md +0 -0
- {agenta-0.1.16 → agenta-0.1.18}/agenta/docker/docker-assets/entrypoint.sh +0 -0
- {agenta-0.1.16 → agenta-0.1.18}/agenta/docker/docker-assets/main.py +0 -0
- {agenta-0.1.16 → agenta-0.1.18}/agenta/docker/docker_utils.py +0 -0
- {agenta-0.1.16 → agenta-0.1.18}/agenta/sdk/__init__.py +0 -0
- {agenta-0.1.16 → agenta-0.1.18}/agenta/sdk/context.py +0 -0
- {agenta-0.1.16 → agenta-0.1.18}/agenta/sdk/init.py +0 -0
- {agenta-0.1.16 → agenta-0.1.18}/agenta/sdk/router.py +0 -0
- {agenta-0.1.16 → agenta-0.1.18}/agenta/sdk/types.py +0 -0
- {agenta-0.1.16 → agenta-0.1.18}/agenta/templates/simple_prompt/README.md +0 -0
- {agenta-0.1.16 → agenta-0.1.18}/agenta/templates/simple_prompt/app.py +0 -0
- {agenta-0.1.16 → agenta-0.1.18}/agenta/templates/simple_prompt/env.example +0 -0
- {agenta-0.1.16 → agenta-0.1.18}/agenta/templates/simple_prompt/requirements.txt +0 -0
- {agenta-0.1.16 → agenta-0.1.18}/agenta/templates/simple_prompt/template.toml +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import re
|
|
2
2
|
import shutil
|
|
3
|
+
import sys
|
|
3
4
|
from pathlib import Path
|
|
4
5
|
|
|
5
6
|
import click
|
|
@@ -36,10 +37,13 @@ def init(app_name: str):
|
|
|
36
37
|
if not app_name:
|
|
37
38
|
while True:
|
|
38
39
|
app_name = questionary.text('Please enter the app name').ask()
|
|
39
|
-
if app_name and re.match('^[a-zA-Z0-
|
|
40
|
+
if app_name and re.match('^[a-zA-Z0-9_]+$', app_name):
|
|
40
41
|
break
|
|
41
42
|
else:
|
|
42
|
-
|
|
43
|
+
if app_name is None: # User pressed Ctrl+C
|
|
44
|
+
sys.exit(0)
|
|
45
|
+
else:
|
|
46
|
+
print("Invalid input. Please use only alphanumeric characters without spaces.")
|
|
43
47
|
|
|
44
48
|
where_question = questionary.select(
|
|
45
49
|
"Are you running agenta locally?",
|
|
@@ -48,9 +52,11 @@ def init(app_name: str):
|
|
|
48
52
|
|
|
49
53
|
if where_question == 'Yes':
|
|
50
54
|
backend_host = "http://localhost"
|
|
51
|
-
|
|
55
|
+
elif where_question == 'No':
|
|
52
56
|
backend_host = questionary.text(
|
|
53
57
|
'Please provide the IP or URL of your remote host').ask()
|
|
58
|
+
elif where_question is None: # User pressed Ctrl+C
|
|
59
|
+
sys.exit(0)
|
|
54
60
|
backend_host = backend_host if backend_host.startswith(
|
|
55
61
|
'http://') or backend_host.startswith('https://') else 'http://'+backend_host
|
|
56
62
|
|
|
@@ -85,6 +91,8 @@ def init(app_name: str):
|
|
|
85
91
|
for file in chosen_template_dir.glob("*"):
|
|
86
92
|
if file.name != 'template.toml' and not file.is_dir():
|
|
87
93
|
shutil.copy(file, current_dir / file.name)
|
|
94
|
+
elif init_option is None: # User pressed Ctrl+C
|
|
95
|
+
sys.exit(0)
|
|
88
96
|
click.echo("App initialized successfully")
|
|
89
97
|
if init_option == 'Start from template':
|
|
90
98
|
click.echo("Please check the README.md for further instructions to setup the template.")
|
|
@@ -66,7 +66,7 @@ def ingest(func: Callable[..., Any]):
|
|
|
66
66
|
try:
|
|
67
67
|
return func(*args, **kwargs)
|
|
68
68
|
except Exception as e:
|
|
69
|
-
traceback_str = ''.join(traceback.format_exception(
|
|
69
|
+
traceback_str = ''.join(traceback.format_exception(None, e, e.__traceback__))
|
|
70
70
|
return JSONResponse(status_code=500, content={"error": str(e), "traceback": traceback_str})
|
|
71
71
|
|
|
72
72
|
new_params = []
|
|
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
|
|
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
|