autonomous-app 0.3.5__py3-none-any.whl → 0.3.7__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 CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "0.3.5"
1
+ __version__ = "0.3.7"
2
2
 
3
3
  from dotenv import load_dotenv
4
4
 
@@ -0,0 +1,23 @@
1
+ from autonomous import log
2
+ from autonomous.model.autoattr import ReferenceAttr
3
+ from autonomous.model.automodel import AutoModel
4
+
5
+ from .models.openai import OpenAIModel
6
+
7
+
8
+ # class BaseAgent(AutoModel):
9
+ # client_model = ReferenceAttr(choices=[OpenAIModel])
10
+ # _ai_model = OpenAIModel
11
+
12
+ # @property
13
+ # def client(self):
14
+ # if self.client_model is None:
15
+ # self.client_model = self._ai_model()
16
+ # self.save()
17
+ # return self.client_model
18
+
19
+ # def clear_files(self, file_id=None):
20
+ # return self.client.clear_files(file_id)
21
+
22
+ # def attach_file(self, file_contents, filename="dbdata.json"):
23
+ # return self.client.attach_file(file_contents, filename)
@@ -18,6 +18,12 @@ class JSONAgent(AutoModel):
18
18
 
19
19
  _ai_model = OpenAIModel
20
20
 
21
+ def clear_files(self, file_id=None):
22
+ return self.client.clear_files(file_id)
23
+
24
+ def attach_file(self, file_contents, filename="dbdata.json"):
25
+ return self.client.attach_file(file_contents, filename)
26
+
21
27
  def get_client(self):
22
28
  if self.client is None:
23
29
  self.client = self._ai_model(
@@ -17,6 +17,12 @@ class TextAgent(AutoModel):
17
17
 
18
18
  _ai_model = OpenAIModel
19
19
 
20
+ def clear_files(self, file_id=None):
21
+ return self.client.clear_files(file_id)
22
+
23
+ def attach_file(self, file_contents, filename="dbdata.json"):
24
+ return self.client.attach_file(file_contents, filename)
25
+
20
26
  def get_client(self):
21
27
  if self.client is None:
22
28
  self.client = self._ai_model(
@@ -173,11 +173,8 @@ class BaseField:
173
173
 
174
174
  # Get value from document instance if available
175
175
  result = instance._data.get(self.name)
176
- if not result:
177
- if self.default is not None:
178
- result = self.default
179
- if callable(result):
180
- result = result()
176
+ if result is None and self.default is not None:
177
+ result = self.default() if callable(self.default) else self.default
181
178
  return result
182
179
 
183
180
  def __set__(self, instance, value):
@@ -22,6 +22,9 @@ class StringAttr(StringField):
22
22
 
23
23
  class IntAttr(IntField):
24
24
  pass
25
+ # def __set__(self, instance, owner):
26
+ # results = super().__get__(instance, owner)
27
+ # return results
25
28
 
26
29
 
27
30
  class FloatAttr(FloatField):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: autonomous-app
3
- Version: 0.3.5
3
+ Version: 0.3.7
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
@@ -1,12 +1,12 @@
1
- autonomous/__init__.py,sha256=Ie-rGZ4SZXAODsPeZELvNjjOd3RVllgErbeckM7K81E,94
1
+ autonomous/__init__.py,sha256=pleIcLkUDNA-NOZk7I3dSRYprDCQkeFqjZX0QCG3fbM,94
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
5
  autonomous/ai/audioagent.py,sha256=uZEhJ8_ctEvzshxJewaGdw-gh2Ts8lIcEysh0rlL62w,1040
6
+ autonomous/ai/baseagent.py,sha256=Wfo0n0M9_eCSb9s0QbFelDlANH-o1lgZiRXZf7VeOP0,710
6
7
  autonomous/ai/imageagent.py,sha256=Y3n4OFD-UC9lSg1j-U9wRnyLLaRl0LjibHbriJwYF2c,981
7
- autonomous/ai/jsonagent.py,sha256=P5HGuN7r7whgryZ2oCvSRY7jQlq0FdDK3-DtdnUG_N0,1321
8
- autonomous/ai/oaiagent.py,sha256=Zrd4iijGfkFsF1Dbhhj0SeHoezec3kae8CrFrZQeqXQ,1346
9
- autonomous/ai/textagent.py,sha256=pYzuoE7ENsxXjTSoVRMGvy7KQK0cS50SlWpY-1r7PiY,1220
8
+ autonomous/ai/jsonagent.py,sha256=gJVFFKuH6yBiSG0U1WBCyjDeT7kCvW3bxeU6TpkhPLM,1542
9
+ autonomous/ai/textagent.py,sha256=bi9v5pawylY6p43wYoaAEs-qyMOskFBnR21-_lJo7Aw,1441
10
10
  autonomous/ai/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  autonomous/ai/models/openai.py,sha256=npavtBRWaxZuO3EtdFK1pm64wporJcTb_JDdxhMyhPI,11732
12
12
  autonomous/apis/version_control/GHCallbacks.py,sha256=AyiUlYfV5JePi11GVyqYyXoj5UTbPKzS-HRRI94rjJo,1069
@@ -34,7 +34,7 @@ autonomous/db/base/__init__.py,sha256=qbVw-SlbJxlWu8UoPLQcwyRQ7Oso0r3aUit6Jqpoz4
34
34
  autonomous/db/base/common.py,sha256=YjvDGwmn-QoRplL9Xx2q3eUXEetgo3YureIGxbR36Y8,1540
35
35
  autonomous/db/base/datastructures.py,sha256=fcgWe2JsfzTK3jbku3Teh0Iwvn5U5EhCpyeh9xr8bZ0,15850
36
36
  autonomous/db/base/document.py,sha256=OM7CeJFZbxha6yKMiMCrHOlTELfOXusqJ8i6FjdFd0c,46652
37
- autonomous/db/base/fields.py,sha256=o5XSMYm3NnpU5uw1hvqFFAZHcmJJwWxgwB_hq4sHkPI,29096
37
+ autonomous/db/base/fields.py,sha256=6hz8w5rrP-piE4Ox_g99Z8rIluqyTgetLngvdhjIgL0,29055
38
38
  autonomous/db/base/metaclasses.py,sha256=GVvJYcCxaW1ltEqyH4oNvT_srckEXDSHOtHVU_TAN70,18138
39
39
  autonomous/db/base/utils.py,sha256=MH4FuEwh-5IcIinwNTkyTs-PqQLyyiMctcYMsNP85qk,617
40
40
  autonomous/db/queryset/__init__.py,sha256=XT3__0BJCvQIQj3S_Mp7mPxNBkfdvXkdw56cg2gc86o,756
@@ -45,7 +45,7 @@ autonomous/db/queryset/queryset.py,sha256=Xvt1q7Olij9STbJkHm6dKrUIrgyJeY_uwJOYE9
45
45
  autonomous/db/queryset/transform.py,sha256=UhBdDxYR_bWH0ECnaSw9g9YMwgWRZtsRl_q6PkqO9eY,19615
46
46
  autonomous/db/queryset/visitor.py,sha256=AN09lR6hWYUlKJC7G1sktvnWy5hrFnpoQhi58bOXbA4,5470
47
47
  autonomous/model/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
48
- autonomous/model/autoattr.py,sha256=o9KmWnqC33tvG-K2wGY3fwgd9FFIm5ivlRkMGqWqTIs,2132
48
+ autonomous/model/autoattr.py,sha256=ncDSV5gFWqgLKzstYxndQWlM911_gxwzPuf74M-UfFk,2252
49
49
  autonomous/model/automodel.py,sha256=Q5S84TsIXZT4r0AFQS6OQm4oRIMPWWfuUhD0i5gsm7s,6809
50
50
  autonomous/storage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
51
51
  autonomous/storage/imagestorage.py,sha256=SmBjBNBlP1ZEjxdOnGVzCHZhbEhMKTUQC2TbpWbejDE,6168
@@ -53,8 +53,8 @@ autonomous/storage/localstorage.py,sha256=FzrR6O9mMGAZt5dDgqzkeOQVfGRXCygR0kksz2
53
53
  autonomous/tasks/__init__.py,sha256=pn7iZ14MhcHUdzcLkfkd4-45wgPP0tXahAz_cFgb_Tg,32
54
54
  autonomous/tasks/autotask.py,sha256=aK5iapDhgcAic3F5ZYMAhNKJkOepj8yWwbMizKDzUwQ,4153
55
55
  autonomous/utils/markdown.py,sha256=tf8vlHARiQO1X_aGbqlYozzP_TbdiDRT9EEP6aFRQo0,2153
56
- autonomous_app-0.3.5.dist-info/LICENSE,sha256=-PHHSuDRkodHo3PEdMkDtoIdmLAOomMq6lsLaOetU8g,1076
57
- autonomous_app-0.3.5.dist-info/METADATA,sha256=kytfTSGcjr-XpafI0e0EHlS5vYvv2GBP3_r4Degu-_Y,4188
58
- autonomous_app-0.3.5.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
59
- autonomous_app-0.3.5.dist-info/top_level.txt,sha256=ZyxWWDdbvZekF3UFunxl4BQsVDb_FOW3eTn0vun_jb4,11
60
- autonomous_app-0.3.5.dist-info/RECORD,,
56
+ autonomous_app-0.3.7.dist-info/LICENSE,sha256=-PHHSuDRkodHo3PEdMkDtoIdmLAOomMq6lsLaOetU8g,1076
57
+ autonomous_app-0.3.7.dist-info/METADATA,sha256=2J4B5989B5ELoWYz0nL9dzRuQquwq1WLhgcZBTpy0GY,4188
58
+ autonomous_app-0.3.7.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
59
+ autonomous_app-0.3.7.dist-info/top_level.txt,sha256=ZyxWWDdbvZekF3UFunxl4BQsVDb_FOW3eTn0vun_jb4,11
60
+ autonomous_app-0.3.7.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (74.1.2)
2
+ Generator: setuptools (75.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
autonomous/ai/oaiagent.py DELETED
@@ -1,40 +0,0 @@
1
- from autonomous import log
2
- from autonomous.model.autoattr import ReferenceAttr
3
- from autonomous.model.automodel import AutoModel
4
-
5
- from .models.openai import OpenAIModel
6
-
7
-
8
- class OAIAgent(AutoModel):
9
- client_model = ReferenceAttr(choices=[OpenAIModel])
10
- _ai_model = OpenAIModel
11
-
12
- @property
13
- def client(self):
14
- if self.client_model is None:
15
- self.client_model = self._ai_model()
16
- self.save()
17
- return self.client_model
18
-
19
- def clear_files(self, file_id=None):
20
- return self.client.clear_files(file_id)
21
-
22
- def attach_file(self, file_contents, filename="dbdata.json"):
23
- return self.client.attach_file(file_contents, filename)
24
-
25
- def generate(self, messages, function=None, additional_instructions=""):
26
- if function is None:
27
- return self.client.generate_text(messages, additional_instructions)
28
- else:
29
- return self.client.generate_json(
30
- messages, function, additional_instructions
31
- )
32
-
33
- def generate_audio(self, prompt, file_path, **kwargs):
34
- return self.client.generate_audio(self, file_path, **kwargs)
35
-
36
- def generate_image(self, prompt, **kwargs):
37
- return self.client.generate_image(prompt, **kwargs)
38
-
39
- def summarize_text(self, text, primer=""):
40
- return self.client.generate_image(text, primer)