agenta 0.16.0__py3-none-any.whl → 0.17.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.cloud.template +1 -1
- agenta/sdk/decorators/llm_entrypoint.py +113 -28
- agenta/sdk/types.py +65 -83
- {agenta-0.16.0.dist-info → agenta-0.17.1.dist-info}/METADATA +3 -3
- {agenta-0.16.0.dist-info → agenta-0.17.1.dist-info}/RECORD +7 -7
- {agenta-0.16.0.dist-info → agenta-0.17.1.dist-info}/WHEEL +0 -0
- {agenta-0.16.0.dist-info → agenta-0.17.1.dist-info}/entry_points.txt +0 -0
|
@@ -2,7 +2,7 @@ FROM public.ecr.aws/s2t9a1r1/agentaai/lambda_templates_public:main
|
|
|
2
2
|
|
|
3
3
|
COPY requirements.txt ${LAMBDA_TASK_ROOT}
|
|
4
4
|
RUN pip install --no-cache-dir --disable-pip-version-check -U agenta
|
|
5
|
-
RUN pip install --no-cache-dir --disable-pip-version-check -
|
|
5
|
+
RUN pip install --no-cache-dir --disable-pip-version-check -r requirements.txt
|
|
6
6
|
RUN pip install --no-cache-dir --disable-pip-version-check mangum
|
|
7
7
|
COPY . ${LAMBDA_TASK_ROOT}
|
|
8
8
|
|
|
@@ -201,17 +201,26 @@ class entrypoint(BaseDecorator):
|
|
|
201
201
|
if isinstance(result, Dict):
|
|
202
202
|
return FuncResponse(**result, latency=round(latency, 4))
|
|
203
203
|
if isinstance(result, str):
|
|
204
|
-
return FuncResponse(
|
|
204
|
+
return FuncResponse(
|
|
205
|
+
message=result, usage=None, cost=None, latency=round(latency, 4)
|
|
206
|
+
)
|
|
205
207
|
if isinstance(result, int) or isinstance(result, float):
|
|
206
|
-
return FuncResponse(
|
|
208
|
+
return FuncResponse(
|
|
209
|
+
message=str(result),
|
|
210
|
+
usage=None,
|
|
211
|
+
cost=None,
|
|
212
|
+
latency=round(latency, 4),
|
|
213
|
+
)
|
|
207
214
|
if result is None:
|
|
208
215
|
return FuncResponse(
|
|
209
216
|
message="Function executed successfully, but did return None. \n Are you sure you did not forget to return a value?",
|
|
217
|
+
usage=None,
|
|
218
|
+
cost=None,
|
|
210
219
|
latency=round(latency, 4),
|
|
211
220
|
)
|
|
212
221
|
except Exception as e:
|
|
213
222
|
self.handle_exception(e)
|
|
214
|
-
return FuncResponse(message="Unexpected error occurred when calling the @
|
|
223
|
+
return FuncResponse(message="Unexpected error occurred when calling the @entrypoint decorated function", latency=0) # type: ignore
|
|
215
224
|
|
|
216
225
|
def handle_exception(self, e: Exception):
|
|
217
226
|
"""Handle exceptions."""
|
|
@@ -237,7 +246,7 @@ class entrypoint(BaseDecorator):
|
|
|
237
246
|
|
|
238
247
|
wrapper_signature = inspect.signature(wrapper)
|
|
239
248
|
wrapper_signature = wrapper_signature.replace(parameters=updated_params)
|
|
240
|
-
wrapper.__signature__ = wrapper_signature
|
|
249
|
+
wrapper.__signature__ = wrapper_signature # type: ignore
|
|
241
250
|
|
|
242
251
|
def update_function_signature(
|
|
243
252
|
self,
|
|
@@ -248,7 +257,7 @@ class entrypoint(BaseDecorator):
|
|
|
248
257
|
) -> None:
|
|
249
258
|
"""Update the function signature to include new parameters."""
|
|
250
259
|
|
|
251
|
-
updated_params = []
|
|
260
|
+
updated_params: List[inspect.Parameter] = []
|
|
252
261
|
self.add_config_params_to_parser(updated_params, config_params)
|
|
253
262
|
self.add_func_params_to_parser(updated_params, func_signature, ingestible_files)
|
|
254
263
|
self.update_wrapper_signature(wrapper, updated_params)
|
|
@@ -260,7 +269,8 @@ class entrypoint(BaseDecorator):
|
|
|
260
269
|
ingestible_files: Dict[str, inspect.Parameter],
|
|
261
270
|
) -> None:
|
|
262
271
|
"""Update the function signature to include new parameters."""
|
|
263
|
-
|
|
272
|
+
|
|
273
|
+
updated_params: List[inspect.Parameter] = []
|
|
264
274
|
self.add_func_params_to_parser(updated_params, func_signature, ingestible_files)
|
|
265
275
|
for param in [
|
|
266
276
|
"config",
|
|
@@ -281,12 +291,19 @@ class entrypoint(BaseDecorator):
|
|
|
281
291
|
) -> None:
|
|
282
292
|
"""Add configuration parameters to function signature."""
|
|
283
293
|
for name, param in config_params.items():
|
|
294
|
+
assert (
|
|
295
|
+
len(param.__class__.__bases__) == 1
|
|
296
|
+
), f"Inherited standard type of {param.__class__} needs to be one."
|
|
284
297
|
updated_params.append(
|
|
285
298
|
inspect.Parameter(
|
|
286
299
|
name,
|
|
287
300
|
inspect.Parameter.KEYWORD_ONLY,
|
|
288
301
|
default=Body(param),
|
|
289
|
-
annotation=
|
|
302
|
+
annotation=param.__class__.__bases__[
|
|
303
|
+
0
|
|
304
|
+
], # determines and get the base (parent/inheritance) type of the sdk-type at run-time. \
|
|
305
|
+
# E.g __class__ is ag.MessagesInput() and accessing it parent type will return (<class 'list'>,), \
|
|
306
|
+
# thus, why we are accessing the first item.
|
|
290
307
|
)
|
|
291
308
|
)
|
|
292
309
|
|
|
@@ -303,12 +320,19 @@ class entrypoint(BaseDecorator):
|
|
|
303
320
|
inspect.Parameter(name, param.kind, annotation=UploadFile)
|
|
304
321
|
)
|
|
305
322
|
else:
|
|
323
|
+
assert (
|
|
324
|
+
len(param.default.__class__.__bases__) == 1
|
|
325
|
+
), f"Inherited standard type of {param.default.__class__} needs to be one."
|
|
306
326
|
updated_params.append(
|
|
307
327
|
inspect.Parameter(
|
|
308
328
|
name,
|
|
309
329
|
inspect.Parameter.KEYWORD_ONLY,
|
|
310
330
|
default=Body(..., embed=True),
|
|
311
|
-
annotation=param.
|
|
331
|
+
annotation=param.default.__class__.__bases__[
|
|
332
|
+
0
|
|
333
|
+
], # determines and get the base (parent/inheritance) type of the sdk-type at run-time. \
|
|
334
|
+
# E.g __class__ is ag.MessagesInput() and accessing it parent type will return (<class 'list'>,), \
|
|
335
|
+
# thus, why we are accessing the first item.
|
|
312
336
|
)
|
|
313
337
|
)
|
|
314
338
|
|
|
@@ -358,7 +382,7 @@ class entrypoint(BaseDecorator):
|
|
|
358
382
|
f"--{name}",
|
|
359
383
|
type=str,
|
|
360
384
|
default=param.default,
|
|
361
|
-
choices=param.choices,
|
|
385
|
+
choices=param.choices, # type: ignore
|
|
362
386
|
)
|
|
363
387
|
else:
|
|
364
388
|
parser.add_argument(
|
|
@@ -420,7 +444,9 @@ class entrypoint(BaseDecorator):
|
|
|
420
444
|
params (dict(param_name, param_val)): The dictionary of the parameters for the function
|
|
421
445
|
"""
|
|
422
446
|
|
|
423
|
-
def find_in_schema(
|
|
447
|
+
def find_in_schema(
|
|
448
|
+
schema_type_properties: dict, schema: dict, param_name: str, xparam: str
|
|
449
|
+
):
|
|
424
450
|
"""Finds a parameter in the schema based on its name and x-parameter value"""
|
|
425
451
|
for _, value in schema.items():
|
|
426
452
|
value_title_lower = str(value.get("title")).lower()
|
|
@@ -432,9 +458,17 @@ class entrypoint(BaseDecorator):
|
|
|
432
458
|
|
|
433
459
|
if (
|
|
434
460
|
isinstance(value, dict)
|
|
435
|
-
and
|
|
461
|
+
and schema_type_properties.get("x-parameter") == xparam
|
|
436
462
|
and value_title == param_name
|
|
437
463
|
):
|
|
464
|
+
# this will update the default type schema with the properties gotten
|
|
465
|
+
# from the schema type (param_val) __schema_properties__ classmethod
|
|
466
|
+
for type_key, type_value in schema_type_properties.items():
|
|
467
|
+
# BEFORE:
|
|
468
|
+
# value = {'temperature': {'title': 'Temperature'}}
|
|
469
|
+
value[type_key] = type_value
|
|
470
|
+
# AFTER:
|
|
471
|
+
# value = {'temperature': { "type": "number", "title": "Temperature", "x-parameter": "float" }}
|
|
438
472
|
return value
|
|
439
473
|
|
|
440
474
|
schema_to_override = openapi_schema["components"]["schemas"][
|
|
@@ -443,17 +477,26 @@ class entrypoint(BaseDecorator):
|
|
|
443
477
|
for param_name, param_val in params.items():
|
|
444
478
|
if isinstance(param_val, GroupedMultipleChoiceParam):
|
|
445
479
|
subschema = find_in_schema(
|
|
446
|
-
|
|
480
|
+
param_val.__schema_type_properties__(),
|
|
481
|
+
schema_to_override,
|
|
482
|
+
param_name,
|
|
483
|
+
"grouped_choice",
|
|
447
484
|
)
|
|
448
485
|
assert (
|
|
449
486
|
subschema
|
|
450
487
|
), f"GroupedMultipleChoiceParam '{param_name}' is in the parameters but could not be found in the openapi.json"
|
|
451
|
-
subschema["choices"] = param_val.choices
|
|
452
|
-
subschema["default"] = param_val.default
|
|
488
|
+
subschema["choices"] = param_val.choices # type: ignore
|
|
489
|
+
subschema["default"] = param_val.default # type: ignore
|
|
490
|
+
|
|
453
491
|
if isinstance(param_val, MultipleChoiceParam):
|
|
454
|
-
subschema = find_in_schema(
|
|
492
|
+
subschema = find_in_schema(
|
|
493
|
+
param_val.__schema_type_properties__(),
|
|
494
|
+
schema_to_override,
|
|
495
|
+
param_name,
|
|
496
|
+
"choice",
|
|
497
|
+
)
|
|
455
498
|
default = str(param_val)
|
|
456
|
-
param_choices = param_val.choices
|
|
499
|
+
param_choices = param_val.choices # type: ignore
|
|
457
500
|
choices = (
|
|
458
501
|
[default] + param_choices
|
|
459
502
|
if param_val not in param_choices
|
|
@@ -463,37 +506,79 @@ class entrypoint(BaseDecorator):
|
|
|
463
506
|
subschema["default"] = (
|
|
464
507
|
default if default in param_choices else choices[0]
|
|
465
508
|
)
|
|
509
|
+
|
|
466
510
|
if isinstance(param_val, FloatParam):
|
|
467
|
-
subschema = find_in_schema(
|
|
468
|
-
|
|
469
|
-
|
|
511
|
+
subschema = find_in_schema(
|
|
512
|
+
param_val.__schema_type_properties__(),
|
|
513
|
+
schema_to_override,
|
|
514
|
+
param_name,
|
|
515
|
+
"float",
|
|
516
|
+
)
|
|
517
|
+
subschema["minimum"] = param_val.minval # type: ignore
|
|
518
|
+
subschema["maximum"] = param_val.maxval # type: ignore
|
|
470
519
|
subschema["default"] = param_val
|
|
520
|
+
|
|
471
521
|
if isinstance(param_val, IntParam):
|
|
472
|
-
subschema = find_in_schema(
|
|
473
|
-
|
|
474
|
-
|
|
522
|
+
subschema = find_in_schema(
|
|
523
|
+
param_val.__schema_type_properties__(),
|
|
524
|
+
schema_to_override,
|
|
525
|
+
param_name,
|
|
526
|
+
"int",
|
|
527
|
+
)
|
|
528
|
+
subschema["minimum"] = param_val.minval # type: ignore
|
|
529
|
+
subschema["maximum"] = param_val.maxval # type: ignore
|
|
475
530
|
subschema["default"] = param_val
|
|
531
|
+
|
|
476
532
|
if (
|
|
477
533
|
isinstance(param_val, inspect.Parameter)
|
|
478
534
|
and param_val.annotation is DictInput
|
|
479
535
|
):
|
|
480
|
-
subschema = find_in_schema(
|
|
536
|
+
subschema = find_in_schema(
|
|
537
|
+
param_val.annotation.__schema_type_properties__(),
|
|
538
|
+
schema_to_override,
|
|
539
|
+
param_name,
|
|
540
|
+
"dict",
|
|
541
|
+
)
|
|
481
542
|
subschema["default"] = param_val.default["default_keys"]
|
|
543
|
+
|
|
482
544
|
if isinstance(param_val, TextParam):
|
|
483
|
-
subschema = find_in_schema(
|
|
545
|
+
subschema = find_in_schema(
|
|
546
|
+
param_val.__schema_type_properties__(),
|
|
547
|
+
schema_to_override,
|
|
548
|
+
param_name,
|
|
549
|
+
"text",
|
|
550
|
+
)
|
|
484
551
|
subschema["default"] = param_val
|
|
552
|
+
|
|
485
553
|
if (
|
|
486
554
|
isinstance(param_val, inspect.Parameter)
|
|
487
555
|
and param_val.annotation is MessagesInput
|
|
488
556
|
):
|
|
489
|
-
subschema = find_in_schema(
|
|
557
|
+
subschema = find_in_schema(
|
|
558
|
+
param_val.annotation.__schema_type_properties__(),
|
|
559
|
+
schema_to_override,
|
|
560
|
+
param_name,
|
|
561
|
+
"messages",
|
|
562
|
+
)
|
|
490
563
|
subschema["default"] = param_val.default
|
|
564
|
+
|
|
491
565
|
if (
|
|
492
566
|
isinstance(param_val, inspect.Parameter)
|
|
493
567
|
and param_val.annotation is FileInputURL
|
|
494
568
|
):
|
|
495
|
-
subschema = find_in_schema(
|
|
569
|
+
subschema = find_in_schema(
|
|
570
|
+
param_val.annotation.__schema_type_properties__(),
|
|
571
|
+
schema_to_override,
|
|
572
|
+
param_name,
|
|
573
|
+
"file_url",
|
|
574
|
+
)
|
|
496
575
|
subschema["default"] = "https://example.com"
|
|
576
|
+
|
|
497
577
|
if isinstance(param_val, BinaryParam):
|
|
498
|
-
subschema = find_in_schema(
|
|
499
|
-
|
|
578
|
+
subschema = find_in_schema(
|
|
579
|
+
param_val.__schema_type_properties__(),
|
|
580
|
+
schema_to_override,
|
|
581
|
+
param_name,
|
|
582
|
+
"bool",
|
|
583
|
+
)
|
|
584
|
+
subschema["default"] = param_val.default # type: ignore
|
agenta/sdk/types.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import json
|
|
2
|
-
from typing import
|
|
2
|
+
from typing import Dict, List, Optional
|
|
3
3
|
|
|
4
|
-
from pydantic import
|
|
4
|
+
from pydantic import ConfigDict, BaseModel, HttpUrl
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
class InFile:
|
|
@@ -24,87 +24,75 @@ class FuncResponse(BaseModel):
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
class DictInput(dict):
|
|
27
|
-
def __new__(cls, default_keys=None):
|
|
27
|
+
def __new__(cls, default_keys: Optional[List[str]] = None):
|
|
28
28
|
instance = super().__new__(cls, default_keys)
|
|
29
29
|
if default_keys is None:
|
|
30
30
|
default_keys = []
|
|
31
|
-
instance.data = [key for key in default_keys]
|
|
31
|
+
instance.data = [key for key in default_keys] # type: ignore
|
|
32
32
|
return instance
|
|
33
33
|
|
|
34
34
|
@classmethod
|
|
35
|
-
def
|
|
36
|
-
|
|
35
|
+
def __schema_type_properties__(cls) -> dict:
|
|
36
|
+
return {"x-parameter": "dict"}
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
class TextParam(str):
|
|
40
40
|
@classmethod
|
|
41
|
-
def
|
|
42
|
-
|
|
41
|
+
def __schema_type_properties__(cls) -> dict:
|
|
42
|
+
return {"x-parameter": "text", "type": "string"}
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
class BinaryParam(int):
|
|
46
46
|
def __new__(cls, value: bool = False):
|
|
47
47
|
instance = super().__new__(cls, int(value))
|
|
48
|
-
instance.default = value
|
|
48
|
+
instance.default = value # type: ignore
|
|
49
49
|
return instance
|
|
50
50
|
|
|
51
51
|
@classmethod
|
|
52
|
-
def
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
)
|
|
52
|
+
def __schema_type_properties__(cls) -> dict:
|
|
53
|
+
return {
|
|
54
|
+
"x-parameter": "bool",
|
|
55
|
+
"type": "boolean",
|
|
56
|
+
}
|
|
59
57
|
|
|
60
58
|
|
|
61
59
|
class IntParam(int):
|
|
62
60
|
def __new__(cls, default: int = 6, minval: float = 1, maxval: float = 10):
|
|
63
61
|
instance = super().__new__(cls, default)
|
|
64
|
-
instance.minval = minval
|
|
65
|
-
instance.maxval = maxval
|
|
62
|
+
instance.minval = minval # type: ignore
|
|
63
|
+
instance.maxval = maxval # type: ignore
|
|
66
64
|
return instance
|
|
67
65
|
|
|
68
66
|
@classmethod
|
|
69
|
-
def
|
|
70
|
-
|
|
71
|
-
{
|
|
72
|
-
"x-parameter": "int",
|
|
73
|
-
"type": "integer",
|
|
74
|
-
"minimum": 1,
|
|
75
|
-
"maximum": 10,
|
|
76
|
-
}
|
|
77
|
-
)
|
|
67
|
+
def __schema_type_properties__(cls) -> dict:
|
|
68
|
+
return {"x-parameter": "int", "type": "integer"}
|
|
78
69
|
|
|
79
70
|
|
|
80
71
|
class FloatParam(float):
|
|
81
72
|
def __new__(cls, default: float = 0.5, minval: float = 0.0, maxval: float = 1.0):
|
|
82
73
|
instance = super().__new__(cls, default)
|
|
83
|
-
instance.
|
|
84
|
-
instance.
|
|
74
|
+
instance.default = default # type: ignore
|
|
75
|
+
instance.minval = minval # type: ignore
|
|
76
|
+
instance.maxval = maxval # type: ignore
|
|
85
77
|
return instance
|
|
86
78
|
|
|
87
79
|
@classmethod
|
|
88
|
-
def
|
|
89
|
-
|
|
90
|
-
{
|
|
91
|
-
"x-parameter": "float",
|
|
92
|
-
"type": "number",
|
|
93
|
-
"minimum": 0.0,
|
|
94
|
-
"maximum": 1.0,
|
|
95
|
-
}
|
|
96
|
-
)
|
|
80
|
+
def __schema_type_properties__(cls) -> dict:
|
|
81
|
+
return {"x-parameter": "float", "type": "number"}
|
|
97
82
|
|
|
98
83
|
|
|
99
84
|
class MultipleChoiceParam(str):
|
|
100
|
-
def __new__(
|
|
101
|
-
|
|
85
|
+
def __new__(
|
|
86
|
+
cls, default: Optional[str] = None, choices: Optional[List[str]] = None
|
|
87
|
+
):
|
|
88
|
+
if default is not None and type(default) is list:
|
|
102
89
|
raise ValueError(
|
|
103
90
|
"The order of the parameters for MultipleChoiceParam is wrong! It's MultipleChoiceParam(default, choices) and not the opposite"
|
|
104
91
|
)
|
|
105
|
-
|
|
92
|
+
|
|
93
|
+
if not default and choices is not None:
|
|
106
94
|
# if a default value is not provided,
|
|
107
|
-
#
|
|
95
|
+
# set the first value in the choices list
|
|
108
96
|
default = choices[0]
|
|
109
97
|
|
|
110
98
|
if default is None and not choices:
|
|
@@ -112,23 +100,21 @@ class MultipleChoiceParam(str):
|
|
|
112
100
|
raise ValueError("You must provide either a default value or choices")
|
|
113
101
|
|
|
114
102
|
instance = super().__new__(cls, default)
|
|
115
|
-
instance.choices = choices
|
|
116
|
-
instance.default = default
|
|
103
|
+
instance.choices = choices # type: ignore
|
|
104
|
+
instance.default = default # type: ignore
|
|
117
105
|
return instance
|
|
118
106
|
|
|
119
107
|
@classmethod
|
|
120
|
-
def
|
|
121
|
-
|
|
122
|
-
{
|
|
123
|
-
"x-parameter": "choice",
|
|
124
|
-
"type": "string",
|
|
125
|
-
"enum": [],
|
|
126
|
-
}
|
|
127
|
-
)
|
|
108
|
+
def __schema_type_properties__(cls) -> dict:
|
|
109
|
+
return {"x-parameter": "choice", "type": "string", "enum": []}
|
|
128
110
|
|
|
129
111
|
|
|
130
112
|
class GroupedMultipleChoiceParam(str):
|
|
131
|
-
def __new__(
|
|
113
|
+
def __new__(
|
|
114
|
+
cls,
|
|
115
|
+
default: Optional[str] = None,
|
|
116
|
+
choices: Optional[Dict[str, List[str]]] = None,
|
|
117
|
+
):
|
|
132
118
|
if choices is None:
|
|
133
119
|
choices = {}
|
|
134
120
|
if default and not any(
|
|
@@ -144,31 +130,23 @@ class GroupedMultipleChoiceParam(str):
|
|
|
144
130
|
)
|
|
145
131
|
|
|
146
132
|
if not default:
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
133
|
+
default_selected_choice = next(
|
|
134
|
+
(choices for choices in choices.values()), None
|
|
135
|
+
)
|
|
136
|
+
if default_selected_choice:
|
|
137
|
+
default = default_selected_choice[0]
|
|
151
138
|
|
|
152
139
|
instance = super().__new__(cls, default)
|
|
153
|
-
instance.choices = choices
|
|
154
|
-
instance.default = default
|
|
140
|
+
instance.choices = choices # type: ignore
|
|
141
|
+
instance.default = default # type: ignore
|
|
155
142
|
return instance
|
|
156
143
|
|
|
157
144
|
@classmethod
|
|
158
|
-
def
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
"type": "string",
|
|
164
|
-
"choices": choices,
|
|
165
|
-
}
|
|
166
|
-
)
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
class Message(BaseModel):
|
|
170
|
-
role: str
|
|
171
|
-
content: str
|
|
145
|
+
def __schema_type_properties__(cls) -> dict:
|
|
146
|
+
return {
|
|
147
|
+
"x-parameter": "grouped_choice",
|
|
148
|
+
"type": "string",
|
|
149
|
+
}
|
|
172
150
|
|
|
173
151
|
|
|
174
152
|
class MessagesInput(list):
|
|
@@ -183,28 +161,32 @@ class MessagesInput(list):
|
|
|
183
161
|
|
|
184
162
|
"""
|
|
185
163
|
|
|
186
|
-
def __new__(cls, messages: List[Dict[str, str]] =
|
|
187
|
-
instance = super().__new__(cls
|
|
188
|
-
instance.default = messages
|
|
164
|
+
def __new__(cls, messages: List[Dict[str, str]] = []):
|
|
165
|
+
instance = super().__new__(cls)
|
|
166
|
+
instance.default = messages # type: ignore
|
|
189
167
|
return instance
|
|
190
168
|
|
|
191
169
|
@classmethod
|
|
192
|
-
def
|
|
193
|
-
|
|
170
|
+
def __schema_type_properties__(cls) -> dict:
|
|
171
|
+
return {"x-parameter": "messages", "type": "array"}
|
|
194
172
|
|
|
195
173
|
|
|
196
174
|
class FileInputURL(HttpUrl):
|
|
175
|
+
def __new__(cls, url: str):
|
|
176
|
+
instance = super().__new__(cls, url)
|
|
177
|
+
instance.default = url # type: ignore
|
|
178
|
+
return instance
|
|
179
|
+
|
|
197
180
|
@classmethod
|
|
198
|
-
def
|
|
199
|
-
|
|
181
|
+
def __schema_type_properties__(cls) -> dict:
|
|
182
|
+
return {"x-parameter": "file_url", "type": "string"}
|
|
200
183
|
|
|
201
184
|
|
|
202
185
|
class Context(BaseModel):
|
|
203
|
-
|
|
204
|
-
extra = Extra.allow
|
|
186
|
+
model_config = ConfigDict(extra="allow")
|
|
205
187
|
|
|
206
188
|
def to_json(self):
|
|
207
|
-
return self.
|
|
189
|
+
return self.model_dump()
|
|
208
190
|
|
|
209
191
|
@classmethod
|
|
210
192
|
def from_json(cls, json_str: str):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: agenta
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.17.1
|
|
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
|
|
@@ -18,12 +18,12 @@ Classifier: Topic :: Software Development :: Libraries
|
|
|
18
18
|
Requires-Dist: cachetools (>=5.3.3,<6.0.0)
|
|
19
19
|
Requires-Dist: click (>=8.1.3,<9.0.0)
|
|
20
20
|
Requires-Dist: docker (>=6.1.1,<8.0.0)
|
|
21
|
-
Requires-Dist: fastapi (>=0.
|
|
21
|
+
Requires-Dist: fastapi (>=0.100.0)
|
|
22
22
|
Requires-Dist: httpx (>=0.24,<0.28)
|
|
23
23
|
Requires-Dist: importlib-metadata (>=6.7,<8.0)
|
|
24
24
|
Requires-Dist: ipdb (>=0.13)
|
|
25
25
|
Requires-Dist: posthog (>=3.1.0,<4.0.0)
|
|
26
|
-
Requires-Dist: pydantic (
|
|
26
|
+
Requires-Dist: pydantic (>=2)
|
|
27
27
|
Requires-Dist: pymongo (>=4.6.3,<5.0.0)
|
|
28
28
|
Requires-Dist: python-dotenv (>=1.0.0,<2.0.0)
|
|
29
29
|
Requires-Dist: python-multipart (>=0.0.6,<0.0.10)
|
|
@@ -119,7 +119,7 @@ agenta/client/client.py,sha256=DWOGS9A8u4wu28s9jGOR4eRhf7vo4zT7GyDvrIGu59Y,19648
|
|
|
119
119
|
agenta/client/exceptions.py,sha256=cxLjjKvZKlUgBxt4Vn9J_SsezJPPNHvrZxnoq-D6zmw,94
|
|
120
120
|
agenta/config.py,sha256=Id-Ie1yf9QRP1YPhRYaYSOruRe6RBrsCXkG9rAa-ZtA,732
|
|
121
121
|
agenta/config.toml,sha256=ptE0P49bwsu3Luyn7OLFmk2buPhj5D-MA-O_ErOGoLg,223
|
|
122
|
-
agenta/docker/docker-assets/Dockerfile.cloud.template,sha256=
|
|
122
|
+
agenta/docker/docker-assets/Dockerfile.cloud.template,sha256=uJuXKvtkMY6f4KaOh3XE5pmuJR7mfZEXJk_8hj2uatc,386
|
|
123
123
|
agenta/docker/docker-assets/Dockerfile.template,sha256=aVA_okx0xXalcTvdQGhSfzSjNpQZVoLJCGYA39-2Nwk,280
|
|
124
124
|
agenta/docker/docker-assets/README.md,sha256=XHxwh2ks_ozrtAU7SLbL3J14SB2holG6buoTxwmMiZM,102
|
|
125
125
|
agenta/docker/docker-assets/entrypoint.sh,sha256=29XK8VQjQsx4hN2j-4JDy-6kQb5y4LCqZEa7PD4eqCQ,74
|
|
@@ -131,14 +131,14 @@ agenta/sdk/agenta_init.py,sha256=j7qwyDtXfLozWpnayJHPz2aQOzHSGvHo9V6s0FXeUe8,993
|
|
|
131
131
|
agenta/sdk/client.py,sha256=trKyBOYFZRk0v5Eptxvh87yPf50Y9CqY6Qgv4Fy-VH4,2142
|
|
132
132
|
agenta/sdk/context.py,sha256=q-PxL05-I84puunUAs9LGsffEXcYhDxhQxjuOz2vK90,901
|
|
133
133
|
agenta/sdk/decorators/base.py,sha256=9aNdX5h8a2mFweuhdO-BQPwXGKY9ONPIdLRhSGAGMfY,217
|
|
134
|
-
agenta/sdk/decorators/llm_entrypoint.py,sha256=
|
|
134
|
+
agenta/sdk/decorators/llm_entrypoint.py,sha256=o1kD14dfXLV3p1OyzgCUA6mIoyDV_YuW__kfXaAKW_I,22754
|
|
135
135
|
agenta/sdk/decorators/tracing.py,sha256=bC-YlPQUrHBEqvhLJxr63N0qlo1jvrbt7ro2AMGXXZw,3160
|
|
136
136
|
agenta/sdk/router.py,sha256=0sbajvn5C7t18anH6yNo7-oYxldHnYfwcbmQnIXBePw,269
|
|
137
137
|
agenta/sdk/tracing/context_manager.py,sha256=HskDaiORoOhjeN375gm05wYnieQzh5UnoIsnSAHkAyc,252
|
|
138
138
|
agenta/sdk/tracing/llm_tracing.py,sha256=PmMYQ5N8atYut85Rk2hZ1jmvSF80Duuy6Clf7URcTCA,8193
|
|
139
139
|
agenta/sdk/tracing/logger.py,sha256=GfH7V-jBHcn7h5dbdrnkDMe_ml3wkXFBeoQiqR4KVRc,474
|
|
140
140
|
agenta/sdk/tracing/tasks_manager.py,sha256=ROrWIaqS2J2HHiJtRWiHKlLY8CCsqToP5VeXu7mamck,3748
|
|
141
|
-
agenta/sdk/types.py,sha256=
|
|
141
|
+
agenta/sdk/types.py,sha256=KMnQUOdjaHSWctDLIiMHnk0o3c-C47Vm4Mn2kIZ88YI,5740
|
|
142
142
|
agenta/sdk/utils/globals.py,sha256=JmhJcCOSbwvjQ6GDyUc2_SYR27DZk7YcrRH80ktHHOM,435
|
|
143
143
|
agenta/sdk/utils/helper/openai_cost.py,sha256=1VkgvucDnNZm1pTfcVLz9icWunntp1d7zwMmnviy3Uw,5877
|
|
144
144
|
agenta/sdk/utils/preinit.py,sha256=YlJL7RLfel0R7DFp-jK7OV-z4ZIQJM0oupYlk7g8b5o,1278
|
|
@@ -157,7 +157,7 @@ agenta/templates/simple_prompt/app.py,sha256=kODgF6lhzsaJPdgL5b21bUki6jkvqjWZzWR
|
|
|
157
157
|
agenta/templates/simple_prompt/env.example,sha256=g9AE5bYcGPpxawXMJ96gh8oenEPCHTabsiOnfQo3c5k,70
|
|
158
158
|
agenta/templates/simple_prompt/requirements.txt,sha256=ywRglRy7pPkw8bljmMEJJ4aOOQKrt9FGKULZ-DGkoBU,23
|
|
159
159
|
agenta/templates/simple_prompt/template.toml,sha256=DQBtRrF4GU8LBEXOZ-GGuINXMQDKGTEG5y37tnvIUIE,60
|
|
160
|
-
agenta-0.
|
|
161
|
-
agenta-0.
|
|
162
|
-
agenta-0.
|
|
163
|
-
agenta-0.
|
|
160
|
+
agenta-0.17.1.dist-info/METADATA,sha256=iPlbIzVHb16h_3Pnuik3WLtwPYCOtNi61kqvM3vNhuY,26458
|
|
161
|
+
agenta-0.17.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
162
|
+
agenta-0.17.1.dist-info/entry_points.txt,sha256=PDiu8_8AsL7ibU9v4iNoOKR1S7F2rdxjlEprjM9QOgo,46
|
|
163
|
+
agenta-0.17.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|