agenta 0.33.7__py3-none-any.whl → 0.34.1__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.
- agenta/docker/docker-assets/Dockerfile.oss.template +13 -0
- agenta/docker/docker_utils.py +3 -3
- {agenta-0.33.7.dist-info → agenta-0.34.1.dist-info}/METADATA +1 -1
- {agenta-0.33.7.dist-info → agenta-0.34.1.dist-info}/RECORD +6 -21
- agenta/cli/evaluation_commands.py +0 -22
- agenta/templates/compose_email/README.md +0 -9
- agenta/templates/compose_email/app.py +0 -63
- agenta/templates/compose_email/env.example +0 -2
- agenta/templates/compose_email/requirements.txt +0 -3
- agenta/templates/compose_email/template.toml +0 -1
- agenta/templates/extract_data_to_json/README.md +0 -9
- agenta/templates/extract_data_to_json/app.py +0 -53
- agenta/templates/extract_data_to_json/env.example +0 -2
- agenta/templates/extract_data_to_json/requirements.txt +0 -3
- agenta/templates/extract_data_to_json/template.toml +0 -1
- agenta/templates/simple_prompt/README.md +0 -9
- agenta/templates/simple_prompt/app.py +0 -24
- agenta/templates/simple_prompt/env.example +0 -2
- agenta/templates/simple_prompt/requirements.txt +0 -3
- agenta/templates/simple_prompt/template.toml +0 -1
- {agenta-0.33.7.dist-info → agenta-0.34.1.dist-info}/WHEEL +0 -0
- {agenta-0.33.7.dist-info → agenta-0.34.1.dist-info}/entry_points.txt +0 -0
|
@@ -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"]
|
agenta/docker/docker_utils.py
CHANGED
|
@@ -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
|
|
@@ -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,12 +189,13 @@ 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=
|
|
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
201
|
agenta/sdk/assets.py,sha256=nUxhrnRP5xicSRVuzhFib7ODWanQg2nNaupnimJ0Ao4,7627
|
|
@@ -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/
|
|
252
|
-
agenta/
|
|
253
|
-
agenta/
|
|
254
|
-
agenta
|
|
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.7.dist-info/METADATA,sha256=zHzjoL3hu2Y64TPwvjjkFgh0ivHh2WUqjm1XIEOAgdo,30237
|
|
267
|
-
agenta-0.33.7.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
|
268
|
-
agenta-0.33.7.dist-info/entry_points.txt,sha256=PDiu8_8AsL7ibU9v4iNoOKR1S7F2rdxjlEprjM9QOgo,46
|
|
269
|
-
agenta-0.33.7.dist-info/RECORD,,
|
|
251
|
+
agenta-0.34.1.dist-info/METADATA,sha256=JO-QTtxo2JiRTF4UM-hxciZ79o7Zg8Kqkd5DxKGG2yU,30237
|
|
252
|
+
agenta-0.34.1.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
|
253
|
+
agenta-0.34.1.dist-info/entry_points.txt,sha256=PDiu8_8AsL7ibU9v4iNoOKR1S7F2rdxjlEprjM9QOgo,46
|
|
254
|
+
agenta-0.34.1.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 +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 +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 +0,0 @@
|
|
|
1
|
-
short_desc="Simple app that uses one prompt using langchain"
|
|
File without changes
|
|
File without changes
|