agenta 0.33.8__py3-none-any.whl → 0.34.3__py3-none-any.whl

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.

@@ -0,0 +1,13 @@
1
+ FROM agentaai/templates_v2:main
2
+
3
+ WORKDIR /app
4
+
5
+ COPY . .
6
+
7
+ RUN pip install --no-cache-dir --disable-pip-version-check -U agenta
8
+ RUN pip install --no-cache-dir --disable-pip-version-check -r requirements.txt
9
+
10
+ EXPOSE 80
11
+
12
+ RUN ["chmod", "+x", "./entrypoint.sh"]
13
+ CMD ["./entrypoint.sh"]
@@ -20,14 +20,14 @@ def create_dockerfile(out_folder: Path) -> Path:
20
20
  """
21
21
  assert Path(out_folder).exists(), f"Folder {out_folder} does not exist."
22
22
  dockerfile_template = (
23
- Path(__file__).parent / "docker-assets" / "Dockerfile.template"
23
+ Path(__file__).parent / "docker-assets" / "Dockerfile.oss.template"
24
24
  )
25
- dockerfile_path = out_folder / "Dockerfile"
25
+ dockerfile_path = out_folder / "Dockerfile.oss.agenta"
26
26
  shutil.copy(dockerfile_template, dockerfile_path)
27
27
  dockerfile_template = (
28
28
  Path(__file__).parent / "docker-assets" / "Dockerfile.cloud.template"
29
29
  )
30
- dockerfile_path = out_folder / "Dockerfile.cloud"
30
+ dockerfile_path = out_folder / "Dockerfile.cloud.agenta"
31
31
  shutil.copy(dockerfile_template, dockerfile_path)
32
32
 
33
33
  return dockerfile_path
agenta/sdk/assets.py CHANGED
@@ -1,5 +1,6 @@
1
1
  supported_llm_models = {
2
2
  "Anthropic": [
3
+ "anthropic/claude-3-7-sonnet-20250219",
3
4
  "anthropic/claude-3-5-sonnet-20241022",
4
5
  "anthropic/claude-3-5-sonnet-20240620",
5
6
  "anthropic/claude-3-5-haiku-20241022",
@@ -50,6 +51,7 @@ supported_llm_models = {
50
51
  "mistral/mistral-large-latest",
51
52
  ],
52
53
  "OpenAI": [
54
+ "gpt-4.5-preview",
53
55
  "gpt-3.5-turbo-1106",
54
56
  "gpt-3.5-turbo",
55
57
  "gpt-4",
@@ -65,6 +67,7 @@ supported_llm_models = {
65
67
  "openrouter/anthropic/claude-3.5-haiku-20241022:beta",
66
68
  "openrouter/anthropic/claude-3.5-haiku:beta",
67
69
  "openrouter/anthropic/claude-3.5-sonnet",
70
+ "openrouter/anthropic/claude-3.7-sonnet",
68
71
  "openrouter/anthropic/claude-3.5-sonnet-20240620",
69
72
  "openrouter/anthropic/claude-3.5-sonnet-20240620:beta",
70
73
  "openrouter/anthropic/claude-3.5-sonnet:beta",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: agenta
3
- Version: 0.33.8
3
+ Version: 0.34.3
4
4
  Summary: The SDK for agenta is an open-source LLMOps platform.
5
5
  Keywords: LLMOps,LLM,evaluation,prompt engineering
6
6
  Author: Mahmoud Mabrouk
@@ -154,24 +154,25 @@ The easiest way to get started is through Agenta Cloud. It is free to signup, an
154
154
 
155
155
  ### Self-hosting Agenta
156
156
 
157
- #### Quick Setup (Port 80)
157
+ 1. Clone Agenta:
158
158
  ```bash
159
- mkdir agenta && cd agenta
160
- curl -L https://raw.githubusercontent.com/agenta-ai/agenta/main/docker-compose.gh.yml -o docker-compose.gh.yml
161
- echo "OPENAI_API_KEY=sk-xxx" > .env
162
- docker compose -f docker-compose.gh.yml --env-file .env up -d --pull always
159
+ git clone https://github.com/Agenta-AI/agenta && cd agenta
163
160
  ```
164
161
 
165
- #### Deployment Options
166
- - To use a different port or customize your deployment, see our [deployment documentation](https://docs.agenta.ai/self-host/host-locally?utm_source=github&utm_medium=referral&utm_campaign=readme)
167
- - For deploying on cloud platforms, refer to our guides for [AWS](https://docs.agenta.ai/self-host/deploy_remotly/host-on-aws?utm_source=github&utm_medium=referral&utm_campaign=readme), [GCP](https://docs.agenta.ai/self-host/deploy_remotly/host-on-gcp?utm_source=github&utm_medium=referral&utm_campaign=readme), or [other remote hosting options](https://docs.agenta.ai/self-host/deploy_remotly/host-remotely?utm_source=github&utm_medium=referral&utm_campaign=readme)
162
+ 2. Edit `hosting/docker-compose/oss/.env.oss.gh` and add your LLM provider API keys.
168
163
 
169
- ## Disabling Anonymized Tracking
164
+ 3. Start Agenta services:
165
+ ```bash
166
+ docker compose -f hosting/docker-compose/oss/docker-compose.gh.yml --env-file hosting/docker-compose/oss/.env.oss.gh --profile with-web up -d
167
+ ```
170
168
 
171
- By default, Agenta automatically reports anonymized basic usage statistics. This helps us understand how Agenta is used and track its overall usage and growth. This data does not include any sensitive information. To disable anonymized telemetry, follow these steps:
169
+ 4. Access Agenta at `http://localhost`.
170
+
171
+ For deploying on a remote host, or using different ports refers to our [self-hosting](https://docs.agenta.ai/self-host/host-locally?utm_source=github&utm_medium=referral&utm_campaign=readme) and [remote deployment documentation](https://docs.agenta.ai/self-host/host-remotely?utm_source=github&utm_medium=referral&utm_campaign=readme).
172
+
173
+ ## Disabling Anonymized Tracking
172
174
 
173
- - For web: Set `TELEMETRY_TRACKING_ENABLED` to `false` in your `agenta-web/.env` file.
174
- - For CLI: Set `telemetry_tracking_enabled` to `false` in your `~/.agenta/config.toml` file.
175
+ By default, Agenta automatically reports anonymized basic usage statistics. This helps us understand how Agenta is used and track its overall usage and growth. This data does not include any sensitive information. To disable anonymized telemetry set `TELEMETRY_ENABLED` to `false` in your `.env` file.
175
176
 
176
177
 
177
178
  ## Contributing
@@ -1,5 +1,4 @@
1
1
  agenta/__init__.py,sha256=7ow43fnH-LwNmk__W2FcQWBdtHRBNU8TXEiwovqM3Yg,2305
2
- agenta/cli/evaluation_commands.py,sha256=fs6492tprPId9p8eGO02Xy-NCBm2RZNJLZWcUxugwd8,474
3
2
  agenta/cli/helper.py,sha256=P97HbNb_qzOyl5CM_MjAqWEBCdgebU6M81G_4UCmF1A,6288
4
3
  agenta/cli/main.py,sha256=WJSp-kJ6j0bea64l5QJlnOPpLwTgNcN7Am4X2YZBP1A,7939
5
4
  agenta/cli/telemetry.py,sha256=GaFFRsE_NtrcSSJ10r2jhgFs5Sk8gf2C09Ox3gOr3eU,1317
@@ -190,15 +189,16 @@ agenta/client/exceptions.py,sha256=cxLjjKvZKlUgBxt4Vn9J_SsezJPPNHvrZxnoq-D6zmw,9
190
189
  agenta/config.py,sha256=0VrTqduB4g8Mt_Ll7ffFcEjKF5qjTUIxmUtTPW2ygWw,653
191
190
  agenta/config.toml,sha256=sIORbhnyct2R9lJrquxhNL4pHul3O0R7iaipCoja5MY,193
192
191
  agenta/docker/docker-assets/Dockerfile.cloud.template,sha256=_b3mLMgGXSFABn5VSlio29cl4guYAJc4UkSdy5nAUmg,386
192
+ agenta/docker/docker-assets/Dockerfile.oss.template,sha256=aVA_okx0xXalcTvdQGhSfzSjNpQZVoLJCGYA39-2Nwk,280
193
193
  agenta/docker/docker-assets/Dockerfile.template,sha256=aVA_okx0xXalcTvdQGhSfzSjNpQZVoLJCGYA39-2Nwk,280
194
194
  agenta/docker/docker-assets/README.md,sha256=XHxwh2ks_ozrtAU7SLbL3J14SB2holG6buoTxwmMiZM,102
195
195
  agenta/docker/docker-assets/entrypoint.sh,sha256=29XK8VQjQsx4hN2j-4JDy-6kQb5y4LCqZEa7PD4eqCQ,74
196
196
  agenta/docker/docker-assets/lambda_function.py,sha256=h4UZSSfqwpfsCgERv6frqwm_4JrYu9rLz3I-LxCfeEg,83
197
197
  agenta/docker/docker-assets/main.py,sha256=7MI-21n81U7N7A0GxebNi0cmGWtJKcR2sPB6FcH2QfA,251
198
- agenta/docker/docker_utils.py,sha256=kO1q2_IR0fEAo4M-2Pt_v-zC7GxxnkLogjKFhU869Ps,3555
198
+ agenta/docker/docker_utils.py,sha256=rKCSb3fDPizX8zwRBaLR0oQ0TnAmyJlzBhflICcwynE,3577
199
199
  agenta/sdk/__init__.py,sha256=WFYRfWh6IoYPSzMG2WF2Xz5amLQtzfWVscT0Q9OLpFY,2109
200
200
  agenta/sdk/agenta_init.py,sha256=4BkwWvLOGd82BElGfv60iDqr32OKvJqivRWSpAXjRGs,8019
201
- agenta/sdk/assets.py,sha256=nUxhrnRP5xicSRVuzhFib7ODWanQg2nNaupnimJ0Ao4,7627
201
+ agenta/sdk/assets.py,sha256=4FN1IfZfBx9g6jW8KzT9ei4BQei9-7MasxHHD9UdeMg,7752
202
202
  agenta/sdk/client.py,sha256=trKyBOYFZRk0v5Eptxvh87yPf50Y9CqY6Qgv4Fy-VH4,2142
203
203
  agenta/sdk/context/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
204
204
  agenta/sdk/context/exporting.py,sha256=16X8fgMhl58gehSlqANX97FiKxx4TkGiG4d2B0-7ZX0,516
@@ -248,22 +248,7 @@ agenta/sdk/utils/logging.py,sha256=eFzEFuYpggfIhEKv09JZRqcDzkmZ482a_E2G-X0FK7Y,4
248
248
  agenta/sdk/utils/preinit.py,sha256=YlJL7RLfel0R7DFp-jK7OV-z4ZIQJM0oupYlk7g8b5o,1278
249
249
  agenta/sdk/utils/singleton.py,sha256=17Ph7LGnnV8HkPjImruKita2ni03Ari5jr0jqm__4sc,312
250
250
  agenta/sdk/utils/timing.py,sha256=rmBPSBuUnIu-epocUCVk0KcM2r36HuDoxkFqOZgfPhc,1507
251
- agenta/templates/compose_email/README.md,sha256=ss7vZPpI1Hg0VmYtFliwq_r5LnqbCy_S5OQDXg8UoIA,308
252
- agenta/templates/compose_email/app.py,sha256=SG8QnBkC49MtvWa2z5_YQ2d8wxZxhO_hWs15j3CsWvc,2384
253
- agenta/templates/compose_email/env.example,sha256=g9AE5bYcGPpxawXMJ96gh8oenEPCHTabsiOnfQo3c5k,70
254
- agenta/templates/compose_email/requirements.txt,sha256=ywRglRy7pPkw8bljmMEJJ4aOOQKrt9FGKULZ-DGkoBU,23
255
- agenta/templates/compose_email/template.toml,sha256=H0y1i4t-gHgc-dbiTWcf3QiMAOU92MgkY_V9x3Tob-E,47
256
- agenta/templates/extract_data_to_json/README.md,sha256=ss7vZPpI1Hg0VmYtFliwq_r5LnqbCy_S5OQDXg8UoIA,308
257
- agenta/templates/extract_data_to_json/app.py,sha256=xNm9Gs2LzLujm1ox-T1Cn0JkU2tmYPqhwuAR9HnHa9Y,1320
258
- agenta/templates/extract_data_to_json/env.example,sha256=g9AE5bYcGPpxawXMJ96gh8oenEPCHTabsiOnfQo3c5k,70
259
- agenta/templates/extract_data_to_json/requirements.txt,sha256=ywRglRy7pPkw8bljmMEJJ4aOOQKrt9FGKULZ-DGkoBU,23
260
- agenta/templates/extract_data_to_json/template.toml,sha256=5TpnTRmvHbIzANevDCCHc8AOJXL431TN2sBor6tosUY,60
261
- agenta/templates/simple_prompt/README.md,sha256=ss7vZPpI1Hg0VmYtFliwq_r5LnqbCy_S5OQDXg8UoIA,308
262
- agenta/templates/simple_prompt/app.py,sha256=kODgF6lhzsaJPdgL5b21bUki6jkvqjWZzWR9KdBQ1Yc,646
263
- agenta/templates/simple_prompt/env.example,sha256=g9AE5bYcGPpxawXMJ96gh8oenEPCHTabsiOnfQo3c5k,70
264
- agenta/templates/simple_prompt/requirements.txt,sha256=ywRglRy7pPkw8bljmMEJJ4aOOQKrt9FGKULZ-DGkoBU,23
265
- agenta/templates/simple_prompt/template.toml,sha256=DQBtRrF4GU8LBEXOZ-GGuINXMQDKGTEG5y37tnvIUIE,60
266
- agenta-0.33.8.dist-info/METADATA,sha256=5CJtRCfwsNCSyZn4CS01ZnyqJHU3HuVlyrQbOKIbvtw,30237
267
- agenta-0.33.8.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
268
- agenta-0.33.8.dist-info/entry_points.txt,sha256=PDiu8_8AsL7ibU9v4iNoOKR1S7F2rdxjlEprjM9QOgo,46
269
- agenta-0.33.8.dist-info/RECORD,,
251
+ agenta-0.34.3.dist-info/METADATA,sha256=8hoIDu99EptIzPxwvY6tID3DmhurLghGKW9LUbPQVAY,29848
252
+ agenta-0.34.3.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
253
+ agenta-0.34.3.dist-info/entry_points.txt,sha256=PDiu8_8AsL7ibU9v4iNoOKR1S7F2rdxjlEprjM9QOgo,46
254
+ agenta-0.34.3.dist-info/RECORD,,
@@ -1,22 +0,0 @@
1
- import click
2
- from agenta.client import client
3
-
4
-
5
- @click.group()
6
- def evaluation():
7
- """Commands for evaluations."""
8
- pass
9
-
10
-
11
- # TODO: Remove hardcoded values
12
- @evaluation.command(name="run")
13
- def run_evaluation_cli():
14
- """Run an evaluation."""
15
-
16
- try:
17
- client.run_evaluation(
18
- app_name="sss",
19
- host="http://localhost",
20
- )
21
- except Exception as ex:
22
- click.echo(click.style(f"Error while running evaluation: {ex}", fg="red"))
@@ -1,9 +0,0 @@
1
- # Using this template
2
-
3
- Please make sure to create a `.env` file with your OpenAI API key before running the app.
4
- OPENAI_API_KEY=sk-xxxxxxx
5
-
6
- You can find your keys here:
7
- https://platform.openai.com/account/api-keys
8
-
9
- Go back to the [Getting started tutorial](https://docs.agenta.ai/getting-started) to continue
@@ -1,63 +0,0 @@
1
- import agenta as ag
2
- from langchain.chains import LLMChain
3
- from langchain.llms import OpenAI
4
- from langchain.prompts import PromptTemplate
5
-
6
- default_prompt = """
7
- **Write an email** from {from_sender} to {to_receiver} with the designated tone and style: {email_style}. The primary content of the email is: {email_content}.
8
-
9
- Use the following format:
10
- Subject: <subject>
11
-
12
- <body>
13
-
14
- **Procedure**:
15
-
16
- **(1) Determine the primary talking points of the email:**
17
- 1. Identify the central theme of the provided content.
18
- 2. Extract secondary messages or supporting points.
19
-
20
- **(2) Frame sentences for each talking point, keeping in mind the given tone and style {{ style }}:**
21
- 3. Create a compelling opening sentence that sets the tone and introduces the main theme.
22
- 4. Formulate sentences that add depth or context to each of the previously identified talking points.
23
-
24
- **(3) Draft the initial version of the email:**
25
- Use the sentences crafted in the previous step to compose a coherent and engaging email. Ensure that the flow feels natural and that each sentence transitions smoothly to the next.
26
-
27
- **(4) Analyze the email and list ways to refine it:**
28
- 5. Identify areas where the message might be unclear or could benefit from additional information.
29
- 6. Consider places where the language or tone might be enhanced to be more persuasive or emotive.
30
- 7. Evaluate if the email adheres to the style directive and, if not, identify deviations.
31
-
32
- **(5) Re-write the email by applying the insights gained:**
33
- Rework the initial draft, incorporating the improvements identified in the previous step. Aim to present the message as effectively as possible while strictly adhering to the prescribed tone and style.
34
-
35
- """
36
-
37
- ag.init()
38
- ag.config.default(
39
- temperature=ag.FloatParam(0.9), prompt_template=ag.TextParam(default_prompt)
40
- )
41
-
42
-
43
- @ag.entrypoint
44
- def generate(
45
- from_sender: str,
46
- to_receiver: str,
47
- email_style: str,
48
- email_content: str,
49
- ) -> str:
50
- llm = OpenAI(temperature=ag.config.temperature)
51
- prompt = PromptTemplate(
52
- input_variables=["from_sender", "to_receiver", "email_style", "email_content"],
53
- template=ag.config.prompt_template,
54
- )
55
- chain = LLMChain(llm=llm, prompt=prompt)
56
- output = chain.run(
57
- from_sender=from_sender,
58
- to_receiver=to_receiver,
59
- email_style=email_style,
60
- email_content=email_content,
61
- )
62
-
63
- return output
@@ -1,2 +0,0 @@
1
- # Rename this file to .env
2
- OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxx
@@ -1,3 +0,0 @@
1
- langchain
2
- openai
3
- agenta
@@ -1 +0,0 @@
1
- short_desc="Simple app that composes an email."
@@ -1,9 +0,0 @@
1
- # Using this template
2
-
3
- Please make sure to create a `.env` file with your OpenAI API key before running the app.
4
- OPENAI_API_KEY=sk-xxxxxxx
5
-
6
- You can find your keys here:
7
- https://platform.openai.com/account/api-keys
8
-
9
- Go back to the [Getting started tutorial](https://docs.agenta.ai/getting-started) to continue
@@ -1,53 +0,0 @@
1
- import agenta as ag
2
- from openai import OpenAI
3
-
4
- client = OpenAI()
5
- import json
6
-
7
- default_prompt = """You are a world class algorithm for extracting information in structured formats. Extract information and create a valid JSON from the following input: {text}"""
8
- function_json_string = """
9
- {
10
- "name": "extract_information",
11
- "description": "Extract information from user-provided text",
12
- "parameters": {
13
- "type": "object",
14
- "properties": {
15
- "text": {
16
- "type": "string",
17
- "description": "The text to extract information from"
18
- }
19
- }
20
- }
21
- }
22
- """
23
-
24
- ag.init()
25
- ag.config.default(
26
- temperature=ag.FloatParam(0.9),
27
- prompt_template=ag.TextParam(default_prompt),
28
- function_json=ag.TextParam(function_json_string),
29
- )
30
-
31
-
32
- @ag.entrypoint
33
- def generate(
34
- text: str,
35
- ) -> str:
36
- messages = [
37
- {
38
- "role": "user",
39
- "content": ag.config.prompt_template.format(text=text),
40
- },
41
- ]
42
-
43
- function = json.loads(ag.config.function_json)
44
-
45
- response = client.chat.completions.create(
46
- model="gpt-3.5-turbo-0613",
47
- messages=messages,
48
- temperature=ag.config.temperature,
49
- functions=[function],
50
- )
51
-
52
- output = str(response["choices"][0]["message"]["function_call"])
53
- return output
@@ -1,2 +0,0 @@
1
- # Rename this file to .env
2
- OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxx
@@ -1,3 +0,0 @@
1
- langchain
2
- openai
3
- agenta
@@ -1 +0,0 @@
1
- short_desc="Simple app that extracts data to JSON from text"
@@ -1,9 +0,0 @@
1
- # Using this template
2
-
3
- Please make sure to create a `.env` file with your OpenAI API key before running the app.
4
- OPENAI_API_KEY=sk-xxxxxxx
5
-
6
- You can find your keys here:
7
- https://platform.openai.com/account/api-keys
8
-
9
- Go back to the [Getting started tutorial](https://docs.agenta.ai/getting-started) to continue
@@ -1,24 +0,0 @@
1
- import agenta as ag
2
- from langchain.chains import LLMChain
3
- from langchain.llms import OpenAI
4
- from langchain.prompts import PromptTemplate
5
-
6
- default_prompt = "What is a good name for a company that makes {product}?"
7
-
8
- ag.init()
9
- ag.config.default(
10
- temperature=ag.FloatParam(0.9),
11
- prompt_template=ag.TextParam(default_prompt),
12
- )
13
-
14
-
15
- @ag.entrypoint
16
- def generate(product: str) -> str:
17
- llm = OpenAI(temperature=ag.config.temperature)
18
- prompt = PromptTemplate(
19
- input_variables=["product"], template=ag.config.prompt_template
20
- )
21
- chain = LLMChain(llm=llm, prompt=prompt)
22
- output = chain.run(product=product)
23
-
24
- return output
@@ -1,2 +0,0 @@
1
- # Rename this file to .env
2
- OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxx
@@ -1,3 +0,0 @@
1
- langchain
2
- openai
3
- agenta
@@ -1 +0,0 @@
1
- short_desc="Simple app that uses one prompt using langchain"