autonomous-app 0.3.18__py3-none-any.whl → 0.3.19__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.
- autonomous/__init__.py +1 -1
- autonomous/ai/audioagent.py +3 -0
- autonomous/ai/baseagent.py +12 -8
- autonomous/ai/jsonagent.py +0 -6
- autonomous/ai/models/aws.py +317 -0
- autonomous/ai/models/deepseek.py +99 -0
- autonomous/ai/models/gemini.py +244 -0
- autonomous/ai/models/local.py +99 -0
- autonomous/ai/models/openai.py +52 -29
- autonomous/ai/textagent.py +0 -6
- autonomous/db/fields.py +1 -2
- autonomous/db/queryset/base.py +1 -4
- autonomous/db/queryset/queryset.py +1 -0
- autonomous/db/queryset/transform.py +11 -10
- autonomous/model/autoattr.py +17 -3
- autonomous/model/automodel.py +29 -8
- {autonomous_app-0.3.18.dist-info → autonomous_app-0.3.19.dist-info}/METADATA +7 -2
- {autonomous_app-0.3.18.dist-info → autonomous_app-0.3.19.dist-info}/RECORD +21 -17
- {autonomous_app-0.3.18.dist-info → autonomous_app-0.3.19.dist-info}/WHEEL +1 -1
- {autonomous_app-0.3.18.dist-info → autonomous_app-0.3.19.dist-info/licenses}/LICENSE +0 -0
- {autonomous_app-0.3.18.dist-info → autonomous_app-0.3.19.dist-info}/top_level.txt +0 -0
autonomous/model/automodel.py
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import importlib
|
|
2
1
|
import os
|
|
3
2
|
import urllib.parse
|
|
4
3
|
from datetime import datetime
|
|
@@ -25,13 +24,13 @@ class AutoModel(Document):
|
|
|
25
24
|
last_updated = DateTimeField(default=datetime.now)
|
|
26
25
|
|
|
27
26
|
def __eq__(self, other):
|
|
28
|
-
return self.pk == other.pk if other else False
|
|
27
|
+
return str(self.pk) == str(other.pk) if other else False
|
|
29
28
|
|
|
30
29
|
def __lt__(self, other):
|
|
31
|
-
return self.pk < other.pk if other else False
|
|
30
|
+
return str(self.pk) < str(other.pk) if other else False
|
|
32
31
|
|
|
33
32
|
def __gt__(self, other):
|
|
34
|
-
return not (self.pk < other.pk) if other else False
|
|
33
|
+
return not (str(self.pk) < str(other.pk)) if other else False
|
|
35
34
|
|
|
36
35
|
def __le__(self, other):
|
|
37
36
|
return self < other or self == other
|
|
@@ -88,21 +87,39 @@ class AutoModel(Document):
|
|
|
88
87
|
f"{self.__module__}.{self._class_name}" if qualified else self._class_name
|
|
89
88
|
)
|
|
90
89
|
|
|
90
|
+
@classmethod
|
|
91
|
+
def get_model(cls, model, pk=None):
|
|
92
|
+
try:
|
|
93
|
+
Model = cls.load_model(model)
|
|
94
|
+
except ValueError:
|
|
95
|
+
Model = None
|
|
96
|
+
return Model.get(pk) if Model and pk else Model
|
|
97
|
+
|
|
91
98
|
@classmethod
|
|
92
99
|
def load_model(cls, model):
|
|
93
100
|
if not isinstance(model, str):
|
|
94
101
|
return model
|
|
95
102
|
|
|
96
103
|
subclasses = AutoModel.__subclasses__()
|
|
104
|
+
visited_subclasses = []
|
|
97
105
|
while subclasses:
|
|
106
|
+
# log(subclasses, _print=True)
|
|
98
107
|
subclass = subclasses.pop()
|
|
99
108
|
if "_meta" in subclass.__dict__ and not subclass._meta.get("abstract"):
|
|
109
|
+
# log(f"Checking {subclass.__name__}", _print=True)
|
|
100
110
|
if subclass.__name__.lower() == model.lower():
|
|
101
111
|
return subclass
|
|
102
|
-
|
|
103
|
-
|
|
112
|
+
if subclass not in visited_subclasses:
|
|
113
|
+
subclasses += subclass.__subclasses__()
|
|
114
|
+
visited_subclasses += [subclass]
|
|
104
115
|
raise ValueError(f"Model {model} not found")
|
|
105
116
|
|
|
117
|
+
@classmethod
|
|
118
|
+
def get_model(cls, model, pk=None):
|
|
119
|
+
# log(model, pk)
|
|
120
|
+
Model = cls.load_model(model)
|
|
121
|
+
return Model.get(pk) if Model and pk else Model
|
|
122
|
+
|
|
106
123
|
@classmethod
|
|
107
124
|
def get(cls, pk):
|
|
108
125
|
"""
|
|
@@ -123,16 +140,21 @@ class AutoModel(Document):
|
|
|
123
140
|
elif isinstance(pk, dict) and "$oid" in pk:
|
|
124
141
|
pk = bson.ObjectId(pk["$oid"])
|
|
125
142
|
try:
|
|
126
|
-
|
|
143
|
+
# log(pk, type(pk))
|
|
144
|
+
result = cls.objects.get(id=pk)
|
|
145
|
+
# log(result)
|
|
127
146
|
except cls.DoesNotExist as e:
|
|
128
147
|
log(f"Model {cls.__name__} with pk {pk} not found : {e}")
|
|
129
148
|
return None
|
|
130
149
|
except ValidationError as e:
|
|
150
|
+
# traceback.print_stack(limit=5)
|
|
131
151
|
log(f"Model Validation failure {cls.__name__} [{pk}]: {e}")
|
|
132
152
|
return None
|
|
133
153
|
except Exception as e:
|
|
134
154
|
log(f"Error getting model {cls.__name__} with pk {pk}: {e}", _print=True)
|
|
135
155
|
raise e
|
|
156
|
+
else:
|
|
157
|
+
return result
|
|
136
158
|
|
|
137
159
|
@classmethod
|
|
138
160
|
def random(cls):
|
|
@@ -223,7 +245,6 @@ class AutoModel(Document):
|
|
|
223
245
|
Returns:
|
|
224
246
|
int: The primary key (pk) of the saved model.
|
|
225
247
|
"""
|
|
226
|
-
# log(self.to_json())
|
|
227
248
|
obj = super().save()
|
|
228
249
|
self.pk = obj.pk
|
|
229
250
|
return self.pk
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: autonomous-app
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.19
|
|
4
4
|
Summary: Containerized application framework built on Flask with additional libraries and tools for rapid development of web applications.
|
|
5
5
|
Author-email: Steven A Moore <samoore@binghamton.edu>
|
|
6
6
|
License: MIT License
|
|
@@ -35,6 +35,7 @@ Requires-Dist: Flask
|
|
|
35
35
|
Requires-Dist: setuptools
|
|
36
36
|
Requires-Dist: python-dotenv
|
|
37
37
|
Requires-Dist: blinker
|
|
38
|
+
Requires-Dist: pymongo
|
|
38
39
|
Requires-Dist: PyGithub
|
|
39
40
|
Requires-Dist: pygit2
|
|
40
41
|
Requires-Dist: pillow
|
|
@@ -44,9 +45,13 @@ Requires-Dist: requests
|
|
|
44
45
|
Requires-Dist: gunicorn
|
|
45
46
|
Requires-Dist: Authlib
|
|
46
47
|
Requires-Dist: rq
|
|
48
|
+
Requires-Dist: ollama
|
|
47
49
|
Requires-Dist: openai>=1.42
|
|
50
|
+
Requires-Dist: google-genai
|
|
48
51
|
Requires-Dist: dateparser
|
|
49
52
|
Requires-Dist: python-slugify
|
|
53
|
+
Requires-Dist: pydub
|
|
54
|
+
Dynamic: license-file
|
|
50
55
|
|
|
51
56
|
# Autonomous
|
|
52
57
|
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
autonomous/__init__.py,sha256=
|
|
1
|
+
autonomous/__init__.py,sha256=hNX5Dchz3TzAIocmN3NtQ2u4NwhcJ-nOjEGkDdAY_yc,95
|
|
2
2
|
autonomous/cli.py,sha256=z4AaGeWNW_uBLFAHng0J_lfS9v3fXemK1PeT85u4Eo4,42
|
|
3
3
|
autonomous/logger.py,sha256=NQtgEaTWNAWfLSgqSP7ksXj1GpOuCgoUV711kSMm-WA,2022
|
|
4
4
|
autonomous/ai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
-
autonomous/ai/audioagent.py,sha256=
|
|
6
|
-
autonomous/ai/baseagent.py,sha256=
|
|
5
|
+
autonomous/ai/audioagent.py,sha256=Y5tz5IwHgFu3oZkOGrGiHCyMCFHrLi353ZROBTxfZjk,730
|
|
6
|
+
autonomous/ai/baseagent.py,sha256=HYCqC4HmK5afNMunmTkhRE8O0OaONl2GxXnISkdOM58,1094
|
|
7
7
|
autonomous/ai/imageagent.py,sha256=bIOrgg_CM-rgfyLme7V9vPqP8WKVMIAVoB2E9lLtIRk,521
|
|
8
|
-
autonomous/ai/jsonagent.py,sha256=
|
|
9
|
-
autonomous/ai/textagent.py,sha256=
|
|
8
|
+
autonomous/ai/jsonagent.py,sha256=a_l4HyyVRj3FB6py_P1xdc4Bj9uNI1YmJrWQXAksIvs,964
|
|
9
|
+
autonomous/ai/textagent.py,sha256=wI1-VC9zscKYyxYBg4pZ0ZyNJ5ZvKkLfWsIY1vJFChk,863
|
|
10
10
|
autonomous/ai/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
-
autonomous/ai/models/
|
|
11
|
+
autonomous/ai/models/aws.py,sha256=bGDjnGTm350zOqor9IsICzUkBUN2bubGI_ZssQuSXIw,12715
|
|
12
|
+
autonomous/ai/models/deepseek.py,sha256=fkoi-hJp60yFlZ9Cb9PdUrmNSErYltQ5ezkUI75llXc,2734
|
|
13
|
+
autonomous/ai/models/gemini.py,sha256=FCW7urSGtrc3Q_VgCcbfca2g4nUwA4T_MMfMxWjcUzQ,8473
|
|
14
|
+
autonomous/ai/models/local.py,sha256=fkoi-hJp60yFlZ9Cb9PdUrmNSErYltQ5ezkUI75llXc,2734
|
|
15
|
+
autonomous/ai/models/openai.py,sha256=2-LttCm6woGklaLbs1H5LjlbfM-7leDwGmC9vksSqW4,13135
|
|
12
16
|
autonomous/apis/version_control/GHCallbacks.py,sha256=AyiUlYfV5JePi11GVyqYyXoj5UTbPKzS-HRRI94rjJo,1069
|
|
13
17
|
autonomous/apis/version_control/GHOrganization.py,sha256=mi2livdsGurKiifbvuLwiFbdDzL77IlEfhwEa-tG77I,1155
|
|
14
18
|
autonomous/apis/version_control/GHRepo.py,sha256=hTFHMkxSbSlVELfh8S6mq6ijkIKPRQO-Q5775ZjRKD4,4622
|
|
@@ -26,7 +30,7 @@ autonomous/db/context_managers.py,sha256=_nH2ajCL8Xy90AuB2rKaryR4iF8Q8ksU3Nei_mZ
|
|
|
26
30
|
autonomous/db/dereference.py,sha256=EgbpPCXtDZqD_ZuY1Wd4o3ltRy8qEo3C5yRh5_c9fLE,12776
|
|
27
31
|
autonomous/db/document.py,sha256=oZKdTaoqwv9fCHiv450rIxgINASQF3J9FzIsUOUXHhw,44428
|
|
28
32
|
autonomous/db/errors.py,sha256=_QeCotid1kmr7_W0QyH6NUrwwYN9eced_yyyiop0Xlw,4108
|
|
29
|
-
autonomous/db/fields.py,sha256=
|
|
33
|
+
autonomous/db/fields.py,sha256=dp7mhnqhZNgM7pP50KS_yX9JK4DfbfSPmswWEV5Zh58,93549
|
|
30
34
|
autonomous/db/mongodb_support.py,sha256=u0X-zpqTIZZP8o2-IDyKRKHL8ALLhvW1VSGtK3fLyos,626
|
|
31
35
|
autonomous/db/pymongo_support.py,sha256=UEZ4RHAGb_t1nuMUAJXMNs0vdH3dutxAH5mwFCmG6jI,2951
|
|
32
36
|
autonomous/db/signals.py,sha256=BM-M4hh4SrTbV9bZVIEWTG8mxgKn9Lo2rC7owLJz4yQ,1791
|
|
@@ -38,23 +42,23 @@ autonomous/db/base/fields.py,sha256=NorRXWR_NAJ1D2XkuICfEB6tM977-AaboYl3R2uSy8E,
|
|
|
38
42
|
autonomous/db/base/metaclasses.py,sha256=GVvJYcCxaW1ltEqyH4oNvT_srckEXDSHOtHVU_TAN70,18138
|
|
39
43
|
autonomous/db/base/utils.py,sha256=MH4FuEwh-5IcIinwNTkyTs-PqQLyyiMctcYMsNP85qk,617
|
|
40
44
|
autonomous/db/queryset/__init__.py,sha256=XT3__0BJCvQIQj3S_Mp7mPxNBkfdvXkdw56cg2gc86o,756
|
|
41
|
-
autonomous/db/queryset/base.py,sha256=
|
|
45
|
+
autonomous/db/queryset/base.py,sha256=unJiIEwh7dtZblYeLHCvq6QkXm8CYsm09bMnPkNJUYc,76040
|
|
42
46
|
autonomous/db/queryset/field_list.py,sha256=qY50kgMYzloZXrOXnWT0PS_fBJCoThSioRvW9-HmhYA,2964
|
|
43
47
|
autonomous/db/queryset/manager.py,sha256=fXu95TlGChdJWTRA4OnY_Ik25JzezJ2_qPqmH78xJsY,2238
|
|
44
|
-
autonomous/db/queryset/queryset.py,sha256=
|
|
45
|
-
autonomous/db/queryset/transform.py,sha256=
|
|
48
|
+
autonomous/db/queryset/queryset.py,sha256=SRLYWAQUXgcfNzeMPiH5Mm4WZIemHTNQ24y2EIisNQU,5969
|
|
49
|
+
autonomous/db/queryset/transform.py,sha256=IIZKf_io60zPTIwJ5KcPcrJOOOOjD2yQU7coYClL1Iw,19461
|
|
46
50
|
autonomous/db/queryset/visitor.py,sha256=AN09lR6hWYUlKJC7G1sktvnWy5hrFnpoQhi58bOXbA4,5470
|
|
47
51
|
autonomous/model/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
48
|
-
autonomous/model/autoattr.py,sha256=
|
|
49
|
-
autonomous/model/automodel.py,sha256=
|
|
52
|
+
autonomous/model/autoattr.py,sha256=FUnQrw65CcZumYiTsQ7U6G6UDGqbeekka-cjz6Sfchc,2675
|
|
53
|
+
autonomous/model/automodel.py,sha256=ltCBs_1H6qL3Igx9nFqAeTcQq2DzLcADHxLOd_DF3hQ,8358
|
|
50
54
|
autonomous/storage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
51
55
|
autonomous/storage/imagestorage.py,sha256=SmBjBNBlP1ZEjxdOnGVzCHZhbEhMKTUQC2TbpWbejDE,6168
|
|
52
56
|
autonomous/storage/localstorage.py,sha256=FzrR6O9mMGAZt5dDgqzkeOQVfGRXCygR0kksz2MPpwE,2286
|
|
53
57
|
autonomous/tasks/__init__.py,sha256=pn7iZ14MhcHUdzcLkfkd4-45wgPP0tXahAz_cFgb_Tg,32
|
|
54
58
|
autonomous/tasks/autotask.py,sha256=aK5iapDhgcAic3F5ZYMAhNKJkOepj8yWwbMizKDzUwQ,4153
|
|
55
59
|
autonomous/utils/markdown.py,sha256=tf8vlHARiQO1X_aGbqlYozzP_TbdiDRT9EEP6aFRQo0,2153
|
|
56
|
-
autonomous_app-0.3.
|
|
57
|
-
autonomous_app-0.3.
|
|
58
|
-
autonomous_app-0.3.
|
|
59
|
-
autonomous_app-0.3.
|
|
60
|
-
autonomous_app-0.3.
|
|
60
|
+
autonomous_app-0.3.19.dist-info/licenses/LICENSE,sha256=-PHHSuDRkodHo3PEdMkDtoIdmLAOomMq6lsLaOetU8g,1076
|
|
61
|
+
autonomous_app-0.3.19.dist-info/METADATA,sha256=U3zEdOwuCe2me-SLKY5zh_6EhldjaYqm1atT2QkHo1Y,4305
|
|
62
|
+
autonomous_app-0.3.19.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
63
|
+
autonomous_app-0.3.19.dist-info/top_level.txt,sha256=ZyxWWDdbvZekF3UFunxl4BQsVDb_FOW3eTn0vun_jb4,11
|
|
64
|
+
autonomous_app-0.3.19.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|