agenta 0.5.7__tar.gz → 0.6.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.

Potentially problematic release.


This version of agenta might be problematic. Click here for more details.

Files changed (45) hide show
  1. {agenta-0.5.7 → agenta-0.6.0}/PKG-INFO +1 -1
  2. {agenta-0.5.7 → agenta-0.6.0}/agenta/cli/helper.py +5 -2
  3. {agenta-0.5.7 → agenta-0.6.0}/agenta/cli/main.py +9 -3
  4. agenta-0.6.0/agenta/cli/variant_configs.py +49 -0
  5. {agenta-0.5.7 → agenta-0.6.0}/agenta/sdk/agenta_decorator.py +1 -3
  6. {agenta-0.5.7 → agenta-0.6.0}/agenta/sdk/types.py +2 -5
  7. {agenta-0.5.7 → agenta-0.6.0}/pyproject.toml +1 -1
  8. {agenta-0.5.7 → agenta-0.6.0}/README.md +0 -0
  9. {agenta-0.5.7 → agenta-0.6.0}/agenta/__init__.py +0 -0
  10. {agenta-0.5.7 → agenta-0.6.0}/agenta/cli/telemetry.py +0 -0
  11. {agenta-0.5.7 → agenta-0.6.0}/agenta/cli/variant_commands.py +0 -0
  12. {agenta-0.5.7 → agenta-0.6.0}/agenta/client/Readme.md +0 -0
  13. {agenta-0.5.7 → agenta-0.6.0}/agenta/client/__init__.py +0 -0
  14. {agenta-0.5.7 → agenta-0.6.0}/agenta/client/api_models.py +0 -0
  15. {agenta-0.5.7 → agenta-0.6.0}/agenta/client/client.py +0 -0
  16. {agenta-0.5.7 → agenta-0.6.0}/agenta/config.py +0 -0
  17. {agenta-0.5.7 → agenta-0.6.0}/agenta/config.toml +0 -0
  18. {agenta-0.5.7 → agenta-0.6.0}/agenta/docker/docker-assets/Dockerfile.cloud.template +0 -0
  19. {agenta-0.5.7 → agenta-0.6.0}/agenta/docker/docker-assets/Dockerfile.template +0 -0
  20. {agenta-0.5.7 → agenta-0.6.0}/agenta/docker/docker-assets/README.md +0 -0
  21. {agenta-0.5.7 → agenta-0.6.0}/agenta/docker/docker-assets/entrypoint.sh +0 -0
  22. {agenta-0.5.7 → agenta-0.6.0}/agenta/docker/docker-assets/lambda_function.py +0 -0
  23. {agenta-0.5.7 → agenta-0.6.0}/agenta/docker/docker-assets/main.py +0 -0
  24. {agenta-0.5.7 → agenta-0.6.0}/agenta/docker/docker_utils.py +0 -0
  25. {agenta-0.5.7 → agenta-0.6.0}/agenta/sdk/__init__.py +0 -0
  26. {agenta-0.5.7 → agenta-0.6.0}/agenta/sdk/agenta_init.py +0 -0
  27. {agenta-0.5.7 → agenta-0.6.0}/agenta/sdk/context.py +0 -0
  28. {agenta-0.5.7 → agenta-0.6.0}/agenta/sdk/router.py +0 -0
  29. {agenta-0.5.7 → agenta-0.6.0}/agenta/sdk/utils/globals.py +0 -0
  30. {agenta-0.5.7 → agenta-0.6.0}/agenta/sdk/utils/preinit.py +0 -0
  31. {agenta-0.5.7 → agenta-0.6.0}/agenta/templates/compose_email/README.md +0 -0
  32. {agenta-0.5.7 → agenta-0.6.0}/agenta/templates/compose_email/app.py +0 -0
  33. {agenta-0.5.7 → agenta-0.6.0}/agenta/templates/compose_email/env.example +0 -0
  34. {agenta-0.5.7 → agenta-0.6.0}/agenta/templates/compose_email/requirements.txt +0 -0
  35. {agenta-0.5.7 → agenta-0.6.0}/agenta/templates/compose_email/template.toml +0 -0
  36. {agenta-0.5.7 → agenta-0.6.0}/agenta/templates/extract_data_to_json/README.md +0 -0
  37. {agenta-0.5.7 → agenta-0.6.0}/agenta/templates/extract_data_to_json/app.py +0 -0
  38. {agenta-0.5.7 → agenta-0.6.0}/agenta/templates/extract_data_to_json/env.example +0 -0
  39. {agenta-0.5.7 → agenta-0.6.0}/agenta/templates/extract_data_to_json/requirements.txt +0 -0
  40. {agenta-0.5.7 → agenta-0.6.0}/agenta/templates/extract_data_to_json/template.toml +0 -0
  41. {agenta-0.5.7 → agenta-0.6.0}/agenta/templates/simple_prompt/README.md +0 -0
  42. {agenta-0.5.7 → agenta-0.6.0}/agenta/templates/simple_prompt/app.py +0 -0
  43. {agenta-0.5.7 → agenta-0.6.0}/agenta/templates/simple_prompt/env.example +0 -0
  44. {agenta-0.5.7 → agenta-0.6.0}/agenta/templates/simple_prompt/requirements.txt +0 -0
  45. {agenta-0.5.7 → agenta-0.6.0}/agenta/templates/simple_prompt/template.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: agenta
3
- Version: 0.5.7
3
+ Version: 0.6.0
4
4
  Summary: The SDK for agenta is an open-source LLMOps platform.
5
5
  Home-page: https://agenta.ai
6
6
  Keywords: LLMOps,LLM,evaluation,prompt engineering
@@ -57,7 +57,7 @@ def set_global_config(var_name: str, var_value: Any) -> None:
57
57
  toml.dump(global_config, config_file)
58
58
 
59
59
 
60
- def get_api_key() -> str:
60
+ def get_api_key(backend_host: str) -> str:
61
61
  """
62
62
  Retrieve or request the API key for accessing the Agenta platform.
63
63
 
@@ -65,6 +65,9 @@ def get_api_key() -> str:
65
65
  If found, it prompts the user to confirm whether they'd like to use that key.
66
66
  If not found, it asks the user to input a new key.
67
67
 
68
+ Args:
69
+ backend_host (str): The URL of the backend host.
70
+
68
71
  Returns:
69
72
  str: The API key to be used for accessing the Agenta platform.
70
73
 
@@ -85,7 +88,7 @@ def get_api_key() -> str:
85
88
  sys.exit(0)
86
89
 
87
90
  api_key = questionary.text(
88
- "(You can get your API Key here: https://cloud.agenta.ai/settings?tab=apiKeys) "
91
+ f"(You can get your API Key here: {backend_host}/settings?tab=apiKeys) "
89
92
  "Please provide your API key:"
90
93
  ).ask()
91
94
 
@@ -8,9 +8,10 @@ import click
8
8
  import questionary
9
9
  import toml
10
10
 
11
+ from agenta.cli import helper
11
12
  from agenta.client import client
13
+ from agenta.cli import variant_configs
12
14
  from agenta.cli import variant_commands
13
- from agenta.cli import helper
14
15
 
15
16
 
16
17
  def print_version(ctx, param, value):
@@ -101,9 +102,13 @@ def init(app_name: str):
101
102
  "Please provide the IP or URL of your remote host"
102
103
  ).ask()
103
104
  elif where_question == "On agenta cloud":
104
- backend_host = "https://cloud.agenta.ai"
105
+ global_backend_host = helper.get_global_config("host")
106
+ if global_backend_host:
107
+ backend_host = global_backend_host
108
+ else:
109
+ backend_host = "https://cloud.agenta.ai"
105
110
 
106
- api_key = helper.get_api_key()
111
+ api_key = helper.get_api_key(backend_host)
107
112
  client.validate_api_key(api_key, backend_host)
108
113
 
109
114
  elif where_question is None: # User pressed Ctrl+C
@@ -187,6 +192,7 @@ def init(app_name: str):
187
192
 
188
193
  # Add the commands to the CLI group
189
194
  cli.add_command(init)
195
+ cli.add_command(variant_configs.config)
190
196
  cli.add_command(variant_commands.variant)
191
197
 
192
198
  if __name__ == "__main__":
@@ -0,0 +1,49 @@
1
+ import click
2
+ from agenta.cli import helper
3
+
4
+
5
+ @click.group()
6
+ def config():
7
+ """Commands for variants configurations"""
8
+ pass
9
+
10
+
11
+ def update_backend_host(backend_host: str):
12
+ """Check the config file and update the backend URL
13
+
14
+ Arguments:
15
+ app_folder -- the app folder
16
+ backend_host -- the backend host
17
+ """
18
+
19
+ click.echo(
20
+ click.style("\nChecking and updating global backend host...", fg="bright_black")
21
+ )
22
+ helper.set_global_config("host", backend_host)
23
+
24
+
25
+ @config.command(
26
+ name="set-host",
27
+ context_settings=dict(
28
+ ignore_unknown_options=True,
29
+ allow_extra_args=True,
30
+ ),
31
+ )
32
+ @click.option(
33
+ "--backend_host", default=None, help="The URL of the backend host to use."
34
+ )
35
+ @click.pass_context
36
+ def set_config_url(ctx, backend_host: str):
37
+ """Set the backend URL in the app configuration"""
38
+
39
+ try:
40
+ if not backend_host:
41
+ if ctx.args:
42
+ backend_host = ctx.args[0]
43
+ else:
44
+ click.echo(click.style("Backend host URL not specified", fg="red"))
45
+
46
+ update_backend_host(backend_host)
47
+ click.echo(click.style("Backend host updated successfully! 🎉\n"))
48
+ except Exception as ex:
49
+ click.echo(click.style(f"Error updating backend host: {ex}", fg="red"))
@@ -12,10 +12,9 @@ from typing import Any, Callable, Dict, Optional, Tuple
12
12
  import agenta
13
13
  from fastapi import Body, FastAPI, UploadFile
14
14
  from fastapi.middleware.cors import CORSMiddleware
15
- from fastapi.openapi.models import Server
16
15
  from fastapi.responses import JSONResponse
17
16
 
18
- from .context import get_contexts, save_context
17
+ from .context import save_context
19
18
  from .router import router as router
20
19
  from .types import (
21
20
  Context,
@@ -345,7 +344,6 @@ def override_schema(openapi_schema: dict, func_name: str, endpoint: str, params:
345
344
  f"Body_{func_name}_{endpoint}_post"
346
345
  ]["properties"]
347
346
  for param_name, param_val in params.items():
348
- # print(param_name, param_val)
349
347
  if isinstance(param_val, MultipleChoiceParam):
350
348
  subschema = find_in_schema(schema_to_override, param_name, "choice")
351
349
  default = str(param_val)
@@ -106,7 +106,7 @@ class Message(BaseModel):
106
106
  class MessagesInput(list):
107
107
  """Messages Input for Chat-completion.
108
108
 
109
- Parameters:
109
+ Args:
110
110
  messages (List[Dict[str, str]]): The list of messages inputs.
111
111
  Required. Each message should be a dictionary with "role" and "content" keys.
112
112
 
@@ -116,11 +116,8 @@ class MessagesInput(list):
116
116
  """
117
117
 
118
118
  def __new__(cls, messages: List[Dict[str, str]] = None):
119
- if not messages:
120
- raise ValueError("Missing required parameter in MessagesInput")
121
-
122
119
  instance = super().__new__(cls, messages)
123
- instance.messages = messages
120
+ instance.default = messages
124
121
  return instance
125
122
 
126
123
  @classmethod
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "agenta"
3
- version = "0.5.7"
3
+ version = "0.6.0"
4
4
  description = "The SDK for agenta is an open-source LLMOps platform."
5
5
  readme = "README.md"
6
6
  authors = ["Mahmoud Mabrouk <mahmoud@agenta.ai>"]
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