agenta 0.10.0__tar.gz → 0.10.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.
Potentially problematic release.
This version of agenta might be problematic. Click here for more details.
- {agenta-0.10.0 → agenta-0.10.2}/PKG-INFO +1 -1
- {agenta-0.10.0 → agenta-0.10.2}/agenta/cli/main.py +66 -53
- {agenta-0.10.0 → agenta-0.10.2}/agenta/sdk/agenta_init.py +10 -5
- {agenta-0.10.0 → agenta-0.10.2}/pyproject.toml +1 -1
- {agenta-0.10.0 → agenta-0.10.2}/README.md +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/__init__.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/cli/evaluation_commands.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/cli/helper.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/cli/telemetry.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/cli/variant_commands.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/cli/variant_configs.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/Readme.md +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/__init__.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/api.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/api_models.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/__init__.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/client.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/core/__init__.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/core/api_error.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/core/client_wrapper.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/core/datetime_utils.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/core/jsonable_encoder.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/core/remove_none_from_dict.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/errors/__init__.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/errors/unprocessable_entity_error.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/__init__.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/add_variant_from_base_and_config_response.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/aggregated_result.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/app.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/app_variant_output.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/app_variant_output_extended.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/app_variant_revision.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/base_output.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/body_import_testset.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/config_db.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/container_templates_response.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/create_app_output.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/delete_evaluation.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/docker_env_vars.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/environment_output.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/evaluation.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/evaluation_scenario.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/evaluation_scenario_input.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/evaluation_scenario_output.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/evaluation_scenario_result.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/evaluation_status_enum.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/evaluation_type.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/evaluation_webhook.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/evaluator.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/evaluator_config.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/feedback.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/get_config_reponse.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/http_validation_error.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/human_evaluation.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/human_evaluation_scenario.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/human_evaluation_scenario_input.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/human_evaluation_scenario_output.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/human_evaluation_scenario_score.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/human_evaluation_scenario_update_score.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/image.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/invite_request.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/list_api_keys_output.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/llm_run_rate_limit.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/new_testset.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/organization.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/organization_output.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/result.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/simple_evaluation_output.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/span.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/template.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/template_image_info.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/test_set_output_response.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/test_set_simple_response.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/trace.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/uri.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/validation_error.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/validation_error_loc_item.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/variant_action.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/variant_action_enum.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/client.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/client/exceptions.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/config.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/config.toml +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/docker/docker-assets/Dockerfile.cloud.template +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/docker/docker-assets/Dockerfile.template +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/docker/docker-assets/README.md +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/docker/docker-assets/entrypoint.sh +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/docker/docker-assets/lambda_function.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/docker/docker-assets/main.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/docker/docker_utils.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/sdk/__init__.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/sdk/agenta_decorator.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/sdk/context.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/sdk/router.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/sdk/types.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/sdk/utils/globals.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/sdk/utils/helper/openai_cost.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/sdk/utils/preinit.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/templates/compose_email/README.md +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/templates/compose_email/app.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/templates/compose_email/env.example +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/templates/compose_email/requirements.txt +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/templates/compose_email/template.toml +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/templates/extract_data_to_json/README.md +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/templates/extract_data_to_json/app.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/templates/extract_data_to_json/env.example +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/templates/extract_data_to_json/requirements.txt +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/templates/extract_data_to_json/template.toml +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/templates/simple_prompt/README.md +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/templates/simple_prompt/app.py +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/templates/simple_prompt/env.example +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/templates/simple_prompt/requirements.txt +0 -0
- {agenta-0.10.0 → agenta-0.10.2}/agenta/templates/simple_prompt/template.toml +0 -0
|
@@ -79,7 +79,9 @@ def cli():
|
|
|
79
79
|
|
|
80
80
|
@click.command()
|
|
81
81
|
@click.option("--app_name", default="")
|
|
82
|
-
|
|
82
|
+
@click.option("--backend_host", default="")
|
|
83
|
+
def init(app_name: str, backend_host: str):
|
|
84
|
+
init_option = "Blank App" if backend_host != "" and app_name != "" else ""
|
|
83
85
|
"""Initialize a new Agenta app with the template files."""
|
|
84
86
|
if not app_name:
|
|
85
87
|
while True:
|
|
@@ -95,28 +97,38 @@ def init(app_name: str):
|
|
|
95
97
|
)
|
|
96
98
|
|
|
97
99
|
try:
|
|
98
|
-
|
|
99
|
-
"
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
if
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
100
|
+
backend_hosts = {
|
|
101
|
+
"https://cloud.agenta.ai": "On agenta cloud",
|
|
102
|
+
"http://localhost": "On my local machine",
|
|
103
|
+
}
|
|
104
|
+
where_question = backend_hosts.get(backend_host, "On a remote machine")
|
|
105
|
+
if not backend_host:
|
|
106
|
+
where_question = questionary.select(
|
|
107
|
+
"Where are you running agenta?",
|
|
108
|
+
choices=[
|
|
109
|
+
"On agenta cloud",
|
|
110
|
+
"On my local machine",
|
|
111
|
+
"On a remote machine",
|
|
112
|
+
],
|
|
108
113
|
).ask()
|
|
109
|
-
elif where_question == "On agenta cloud":
|
|
110
|
-
global_backend_host = helper.get_global_config("host")
|
|
111
|
-
if global_backend_host:
|
|
112
|
-
backend_host = global_backend_host
|
|
113
|
-
else:
|
|
114
|
-
backend_host = "https://cloud.agenta.ai"
|
|
115
114
|
|
|
116
|
-
|
|
115
|
+
if where_question == "On my local machine":
|
|
116
|
+
backend_host = "http://localhost"
|
|
117
|
+
elif where_question == "On a remote machine":
|
|
118
|
+
backend_host = questionary.text(
|
|
119
|
+
"Please provide the IP or URL of your remote host"
|
|
120
|
+
).ask()
|
|
121
|
+
elif where_question == "On agenta cloud":
|
|
122
|
+
global_backend_host = helper.get_global_config("host")
|
|
123
|
+
if global_backend_host:
|
|
124
|
+
backend_host = global_backend_host
|
|
125
|
+
else:
|
|
126
|
+
backend_host = "https://cloud.agenta.ai"
|
|
127
|
+
|
|
128
|
+
api_key = helper.get_api_key(backend_host)
|
|
117
129
|
|
|
118
|
-
|
|
119
|
-
|
|
130
|
+
elif where_question is None: # User pressed Ctrl+C
|
|
131
|
+
sys.exit(0)
|
|
120
132
|
backend_host = (
|
|
121
133
|
backend_host
|
|
122
134
|
if backend_host.startswith("http://") or backend_host.startswith("https://")
|
|
@@ -160,41 +172,42 @@ def init(app_name: str):
|
|
|
160
172
|
toml.dump(config, config_file)
|
|
161
173
|
|
|
162
174
|
# Ask for init option
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
# If the user selected the second option, show a list of available templates
|
|
169
|
-
if init_option == "Start from template":
|
|
170
|
-
current_dir = Path.cwd()
|
|
171
|
-
template_dir = Path(__file__).parent.parent / "templates"
|
|
172
|
-
templates = [
|
|
173
|
-
folder.name for folder in template_dir.iterdir() if folder.is_dir()
|
|
174
|
-
]
|
|
175
|
-
template_desc = [
|
|
176
|
-
toml.load((template_dir / name / "template.toml"))["short_desc"]
|
|
177
|
-
for name in templates
|
|
178
|
-
]
|
|
179
|
-
|
|
180
|
-
# Show the templates to the user
|
|
181
|
-
template = questionary.select(
|
|
182
|
-
"Which template do you want to use?",
|
|
183
|
-
choices=[
|
|
184
|
-
questionary.Choice(
|
|
185
|
-
title=f"{template} - {template_desc}", value=template
|
|
186
|
-
)
|
|
187
|
-
for template, template_desc in zip(templates, template_desc)
|
|
188
|
-
],
|
|
175
|
+
if not init_option:
|
|
176
|
+
init_option = questionary.select(
|
|
177
|
+
"How do you want to initialize your app?",
|
|
178
|
+
choices=["Blank App", "Start from template"],
|
|
189
179
|
).ask()
|
|
190
180
|
|
|
191
|
-
#
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
181
|
+
# If the user selected the second option, show a list of available templates
|
|
182
|
+
if init_option == "Start from template":
|
|
183
|
+
current_dir = Path.cwd()
|
|
184
|
+
template_dir = Path(__file__).parent.parent / "templates"
|
|
185
|
+
templates = [
|
|
186
|
+
folder.name for folder in template_dir.iterdir() if folder.is_dir()
|
|
187
|
+
]
|
|
188
|
+
template_desc = [
|
|
189
|
+
toml.load((template_dir / name / "template.toml"))["short_desc"]
|
|
190
|
+
for name in templates
|
|
191
|
+
]
|
|
192
|
+
|
|
193
|
+
# Show the templates to the user
|
|
194
|
+
template = questionary.select(
|
|
195
|
+
"Which template do you want to use?",
|
|
196
|
+
choices=[
|
|
197
|
+
questionary.Choice(
|
|
198
|
+
title=f"{template} - {template_desc}", value=template
|
|
199
|
+
)
|
|
200
|
+
for template, template_desc in zip(templates, template_desc)
|
|
201
|
+
],
|
|
202
|
+
).ask()
|
|
203
|
+
|
|
204
|
+
# Copy the template files to the current directory
|
|
205
|
+
chosen_template_dir = template_dir / template
|
|
206
|
+
for file in chosen_template_dir.glob("*"):
|
|
207
|
+
if file.name != "template.toml" and not file.is_dir():
|
|
208
|
+
shutil.copy(file, current_dir / file.name)
|
|
209
|
+
elif init_option is None: # User pressed Ctrl+C
|
|
210
|
+
sys.exit(0)
|
|
198
211
|
|
|
199
212
|
# Create a .gitignore file and add some default environment folder names to it
|
|
200
213
|
gitignore_content = (
|
|
@@ -75,16 +75,21 @@ class AgentaSingleton:
|
|
|
75
75
|
)
|
|
76
76
|
else:
|
|
77
77
|
try:
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
apps = client.list_apps(app_name=app_name)
|
|
79
|
+
if len(apps) == 0:
|
|
80
|
+
raise APIRequestError(f"App with name {app_name} not found")
|
|
80
81
|
|
|
82
|
+
app_id = apps[0].app_id
|
|
81
83
|
if not app_id:
|
|
82
84
|
raise APIRequestError(
|
|
83
85
|
f"App with name {app_name} does not exist on the server."
|
|
84
86
|
)
|
|
85
87
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
+
bases = client.list_bases(app_id=app_id, base_name=base_name)
|
|
89
|
+
if len(bases) == 0:
|
|
90
|
+
raise APIRequestError(f"No base was found for the app {app_id}")
|
|
91
|
+
|
|
92
|
+
base_id = bases[0].base_id
|
|
88
93
|
except Exception as ex:
|
|
89
94
|
raise APIRequestError(
|
|
90
95
|
f"Failed to get base id and/or app_id from the server with error: {ex}"
|
|
@@ -171,7 +176,7 @@ class Config:
|
|
|
171
176
|
+ str(ex)
|
|
172
177
|
)
|
|
173
178
|
try:
|
|
174
|
-
self.set(**config
|
|
179
|
+
self.set(**config.parameters)
|
|
175
180
|
except Exception as ex:
|
|
176
181
|
logger.warning("Failed to set the configuration with error: " + str(ex))
|
|
177
182
|
|
|
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
|
|
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
|
|
File without changes
|
{agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/human_evaluation_scenario_input.py
RENAMED
|
File without changes
|
{agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/human_evaluation_scenario_output.py
RENAMED
|
File without changes
|
{agenta-0.10.0 → agenta-0.10.2}/agenta/client/backend/types/human_evaluation_scenario_score.py
RENAMED
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|