autonomous-app 0.2.23__py3-none-any.whl → 0.2.25__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.2.23"
1
+ __version__ = "0.2.25"
2
2
 
3
3
  from .logger import log
4
4
  from .model.automodel import AutoModel
autonomous/ai/oaiagent.py CHANGED
@@ -1,4 +1,3 @@
1
- import io
2
1
  import json
3
2
  import os
4
3
  import random
@@ -60,7 +59,7 @@ class OAIAgent(AutoModel):
60
59
  vector_store_id=self.vector_store
61
60
  ).data
62
61
  for vsf in vector_store_files:
63
- self.client.files.delete(file_id=vsf["id"])
62
+ self.client.files.delete(file_id=vsf.id)
64
63
  else:
65
64
  self.client.files.delete(file_id=file_id)
66
65
  self.tools.pop("file_search", None)
@@ -2,6 +2,8 @@
2
2
  # default : Optional[str] = "value" # for default values
3
3
  import copy
4
4
  import importlib
5
+
6
+ # import traceback
5
7
  from abc import ABC
6
8
  from datetime import datetime
7
9
 
@@ -21,11 +23,17 @@ class DelayedModel:
21
23
  module_name, class_name = model.rsplit(".", 1)
22
24
  try:
23
25
  module = importlib.import_module(module_name)
24
- except ModuleNotFoundError as e:
25
- log(e)
26
+ model = getattr(module, class_name)
27
+ except (ModuleNotFoundError, AttributeError) as e:
28
+ # stack = traceback.extract_stack()
29
+ # function_names = [
30
+ # f"{frame.filename}:{frame.lineno} - {frame.name} "
31
+ # for frame in stack[:-1]
32
+ # if "__" not in frame.filename
33
+ # ]
34
+ # log(e, *function_names)
26
35
  raise DanglingReferenceError(model, pk, None)
27
36
  else:
28
- model = getattr(module, class_name)
29
37
  object.__setattr__(self, "_delayed_model", model)
30
38
  object.__setattr__(self, "_delayed_pk", pk)
31
39
  object.__setattr__(self, "_delayed_obj", None)
@@ -43,9 +51,6 @@ class DelayedModel:
43
51
 
44
52
  return object.__getattribute__(self, "_delayed_obj")
45
53
 
46
- # def __getattr__(self, name):
47
- # return getattr(self._instance(), name)
48
-
49
54
  def __getattribute__(self, name):
50
55
  # log(name)
51
56
  if name in [
@@ -304,7 +309,8 @@ class AutoModel(ABC):
304
309
  """
305
310
  table = cls.table()
306
311
  result = table.get(pk)
307
- return cls(**result) if result else None
312
+ obj = cls(**result) if result else None
313
+ return obj
308
314
 
309
315
  @classmethod
310
316
  def random(cls):
@@ -1,3 +1,4 @@
1
+ # import traceback
1
2
  from datetime import datetime
2
3
 
3
4
  from autonomous import log
@@ -75,7 +76,8 @@ class AutoDecoder:
75
76
  name = obj["__extended_json_type__"]
76
77
  decoder_name = f"decode_{name}"
77
78
  decoder = getattr(self, decoder_name)
78
- except (KeyError, AttributeError, TypeError):
79
+ except (KeyError, AttributeError, TypeError) as e:
80
+ log(e)
79
81
  return obj
80
82
  else:
81
83
  return decoder(obj)
@@ -92,7 +94,13 @@ class AutoDecoder:
92
94
  raise KeyError
93
95
  return DelayedModel(obj["_automodel"], obj["pk"])
94
96
  except DanglingReferenceError as e:
95
- log(e)
97
+ # stack = traceback.extract_stack()
98
+ # function_names = [
99
+ # f"{frame.filename}:{frame.lineno} - {frame.name} "
100
+ # for frame in stack[:-1]
101
+ # if "__" not in frame.filename
102
+ # ]
103
+ # log(e, *function_names)
96
104
  return None
97
105
  except KeyError:
98
106
  log(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: autonomous-app
3
- Version: 0.2.23
3
+ Version: 0.2.25
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
@@ -44,7 +44,7 @@ Requires-Dist: jsmin
44
44
  Requires-Dist: requests
45
45
  Requires-Dist: gunicorn
46
46
  Requires-Dist: Authlib
47
- Requires-Dist: openai >=1.21.1
47
+ Requires-Dist: openai>=1.21.1
48
48
  Requires-Dist: validators
49
49
  Requires-Dist: dateparser
50
50
  Requires-Dist: python-slugify
@@ -1,8 +1,8 @@
1
- autonomous/__init__.py,sha256=ye9QZlO6j8ZNUNYXFl1tzzfFxNQpCCa3i527pQF1FrY,87
1
+ autonomous/__init__.py,sha256=Pa14MsIwcZt2j4Yx8BZsCMkrdkksmvUGFatPIZZ-Yuw,87
2
2
  autonomous/cli.py,sha256=z4AaGeWNW_uBLFAHng0J_lfS9v3fXemK1PeT85u4Eo4,42
3
3
  autonomous/logger.py,sha256=jePQ4kTtECTwGtIcDmpLSE6rSwhaUEiQe2vK06h5XIg,1915
4
4
  autonomous/ai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- autonomous/ai/oaiagent.py,sha256=73gBZqlYTL8i7WuUrhu-G4JflzBDVdhragj9PvBkyKM,7697
5
+ autonomous/ai/oaiagent.py,sha256=orMbB9EaL84gdVkRdVaCY4Q1ybDS-FOisVEoa0KCNYI,7684
6
6
  autonomous/auth/__init__.py,sha256=IW5tQ8VYwHIbDfMYA0wYgx4PprwcjUWV4EoIJ8HTlMU,161
7
7
  autonomous/auth/autoauth.py,sha256=Q2DfcWjh0vTSSpf5SqyK4SElVDcxu8435GhLSPqTYco,3724
8
8
  autonomous/auth/github.py,sha256=dHf84bJdV9rXGcvRLzWCPW9CvuA-VEmqYi_QQFwd2kY,886
@@ -15,9 +15,9 @@ autonomous/errors/__init__.py,sha256=OruWG9IkAF4LN-OAo5c2K9Dnds4oZFJJQHKaXbQaWnA
15
15
  autonomous/errors/danglingreferenceerror.py,sha256=obfNjpn2vsyK4ak-UuuwFTMVzecs1SaeFPshOvnukS8,275
16
16
  autonomous/model/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
17
17
  autonomous/model/autoattribute.py,sha256=q09cORKC6-LpoZ3Ez-lRkd5kxuSFQrB2nA2f9_8k2c8,588
18
- autonomous/model/automodel.py,sha256=-YXzE6Pacxao3bu6_ItivRxryd-YLbd-F9_TRaStIwk,12672
18
+ autonomous/model/automodel.py,sha256=k8S-083N1FEcBx578rEoMqBSlKg3lRrCbCxxNRbtqfY,12918
19
19
  autonomous/model/orm.py,sha256=IJrbp15RmBgF61vLsqcS_VdnAnw9736sLW75_xFYE9Y,2521
20
- autonomous/model/serializer.py,sha256=ixJ5LZ0sicv49WIaPKSzNX0IFy0InlHYv9X-uG8Pi5Y,3048
20
+ autonomous/model/serializer.py,sha256=DBJMQRmNKQk5kQzh94anNMZYVajRCnFv7ATrZWp7vdg,3366
21
21
  autonomous/storage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
22
  autonomous/storage/imagestorage.py,sha256=azV594Z_v-wf3W8lUtgLIb5q5O5VrAtqE2kxGtSIUKA,6250
23
23
  autonomous/storage/localstorage.py,sha256=FzrR6O9mMGAZt5dDgqzkeOQVfGRXCygR0kksz2MPpwE,2286
@@ -29,8 +29,8 @@ autonomous/storage/version_control/GHVersionControl.py,sha256=VIhVRxe6gJgozFWyhy
29
29
  autonomous/storage/version_control/__init__.py,sha256=tP0bAWYl1RwBRi62HsIidmgyqHuSlCUqwGuKUKKRugc,117
30
30
  autonomous/tasks/__init__.py,sha256=pn7iZ14MhcHUdzcLkfkd4-45wgPP0tXahAz_cFgb_Tg,32
31
31
  autonomous/tasks/autotask.py,sha256=_WQ8w1LyV2FVJ0Ct0FoF9q1W8ClXfS57-omnBb0LNWE,4910
32
- autonomous_app-0.2.23.dist-info/LICENSE,sha256=-PHHSuDRkodHo3PEdMkDtoIdmLAOomMq6lsLaOetU8g,1076
33
- autonomous_app-0.2.23.dist-info/METADATA,sha256=d6iKy7LcXIZ_wNRczRNHY_aw2rE5zZBBQSDR6skBW0w,4229
34
- autonomous_app-0.2.23.dist-info/WHEEL,sha256=Wyh-_nZ0DJYolHNn1_hMa4lM7uDedD_RGVwbmTjyItk,91
35
- autonomous_app-0.2.23.dist-info/top_level.txt,sha256=ZyxWWDdbvZekF3UFunxl4BQsVDb_FOW3eTn0vun_jb4,11
36
- autonomous_app-0.2.23.dist-info/RECORD,,
32
+ autonomous_app-0.2.25.dist-info/LICENSE,sha256=-PHHSuDRkodHo3PEdMkDtoIdmLAOomMq6lsLaOetU8g,1076
33
+ autonomous_app-0.2.25.dist-info/METADATA,sha256=1SQ3jDCcHQA7EEcXPAM7Az9QtuALhMxo80ghvkJGqJk,4228
34
+ autonomous_app-0.2.25.dist-info/WHEEL,sha256=HiCZjzuy6Dw0hdX5R3LCFPDmFS4BWl8H-8W39XfmgX4,91
35
+ autonomous_app-0.2.25.dist-info/top_level.txt,sha256=ZyxWWDdbvZekF3UFunxl4BQsVDb_FOW3eTn0vun_jb4,11
36
+ autonomous_app-0.2.25.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (71.1.0)
2
+ Generator: setuptools (72.2.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5