autonomous-app 0.3.27__py3-none-any.whl → 0.3.28__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.27"
1
+ __version__ = "0.3.28"
2
2
 
3
3
  from dotenv import load_dotenv
4
4
 
@@ -1,8 +1,9 @@
1
1
  import json
2
2
 
3
+ from autonomous.ai.baseagent import BaseAgent
3
4
  from autonomous.model.autoattr import ReferenceAttr, StringAttr
4
5
  from autonomous.model.automodel import AutoModel
5
- from autonomous.ai.baseagent import BaseAgent
6
+
6
7
  from .models.openai import OpenAIModel
7
8
 
8
9
 
@@ -24,3 +25,6 @@ class JSONAgent(BaseAgent):
24
25
  elif not isinstance(result, dict):
25
26
  raise ValueError(f"Invalid JSON response from AI model.\n\n{result}")
26
27
  return result
28
+
29
+ def upload(self, file):
30
+ return self.get_client().upload(file=file)
@@ -23,6 +23,16 @@ class GeminiAIModel(AutoModel):
23
23
  _json_model = "gemini-3-pro-preview"
24
24
  _stt_model = "gemini-3-pro-preview"
25
25
  _tts_model = "gemini-2.5-flash-preview-tts"
26
+
27
+ messages = ListAttr(StringAttr(default=[]))
28
+ name = StringAttr(default="agent")
29
+ instructions = StringAttr(
30
+ default="You are highly skilled AI trained to assist with various tasks."
31
+ )
32
+ description = StringAttr(
33
+ default="A helpful AI assistant trained to assist with various tasks."
34
+ )
35
+
26
36
  MAX_FILES = 14
27
37
  MAX_SUMMARY_TOKEN_LENGTH = 10000
28
38
  VOICES = {
@@ -58,15 +68,6 @@ class GeminiAIModel(AutoModel):
58
68
  "Sulafar": ["female"],
59
69
  }
60
70
 
61
- messages = ListAttr(StringAttr(default=[]))
62
- name = StringAttr(default="agent")
63
- instructions = StringAttr(
64
- default="You are highly skilled AI trained to assist with various tasks."
65
- )
66
- description = StringAttr(
67
- default="A helpful AI assistant trained to assist with various tasks."
68
- )
69
-
70
71
  @property
71
72
  def client(self):
72
73
  if not self._client:
@@ -114,8 +115,16 @@ class GeminiAIModel(AutoModel):
114
115
  existing_files = self.client.files.list()
115
116
  log(f"Existing files: {[f.display_name for f in existing_files]}", _print=True)
116
117
  for f in existing_files:
117
- result = self.client.files.delete(name=f.name)
118
- log(f"Deleting old version of {f.name}: {result}", _print=True)
118
+ # Delete old files (older than 10 minutes)
119
+ age_seconds = (
120
+ (time.time() - f.update_time.timestamp())
121
+ if f.update_time
122
+ else (time.time() - f.create_time.timestamp())
123
+ )
124
+ log(age_seconds, _print=True)
125
+ if age_seconds > 900:
126
+ result = self.client.files.delete(name=f.name)
127
+ log(f"Deleting old version of {f.name}: {result}", _print=True)
119
128
  file_refs = []
120
129
  for file_dict in file_list:
121
130
  fn = file_dict["name"]
@@ -132,7 +141,10 @@ class GeminiAIModel(AutoModel):
132
141
  time.sleep(1)
133
142
  uploaded_file = self.client.get_file(uploaded_file.name)
134
143
  file_refs.append(uploaded_file)
135
- return file_refs
144
+ return file_refs
145
+
146
+ def upload(self, file):
147
+ return self._add_files([file])
136
148
 
137
149
  def generate_json(self, message, function, additional_instructions="", **kwargs):
138
150
  # The API call must use the 'tools' parameter instead of 'response_json_schema'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: autonomous-app
3
- Version: 0.3.27
3
+ Version: 0.3.28
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
  Project-URL: homepage, https://github.com/Sallenmoore/autonomous
@@ -1,16 +1,16 @@
1
- autonomous/__init__.py,sha256=kn0Y6qhJcvWmWzx8A45mzDbvKLy0PoPhcEa4xeWifcU,95
1
+ autonomous/__init__.py,sha256=cf_i1xIW4gWRL34z5iRAHqNKq4XELsusys3f4hdY1sQ,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
5
  autonomous/ai/audioagent.py,sha256=SvPLzKgqUnrkcsR7y93aURSrStIrryuntQMPS1SzUXw,1033
6
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=ldfWHtKfLa2ypoM95U6PFETAE9R5B53s5oGzIzF7dQk,984
8
+ autonomous/ai/jsonagent.py,sha256=VQGhK0RFo0H_eVH9dAyf4_lp-RIpdgH988joLoKjm94,1065
9
9
  autonomous/ai/textagent.py,sha256=1yM1aMvws64PocvG_L-POMDKjxq2JDuGqgc3haUHybU,926
10
10
  autonomous/ai/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  autonomous/ai/models/aws.py,sha256=bGDjnGTm350zOqor9IsICzUkBUN2bubGI_ZssQuSXIw,12715
12
12
  autonomous/ai/models/deepseek.py,sha256=fkoi-hJp60yFlZ9Cb9PdUrmNSErYltQ5ezkUI75llXc,2734
13
- autonomous/ai/models/gemini.py,sha256=jTCOEoCJd-sCB1oPjYuCitFuIheut3RvN4DpuGabx0c,13839
13
+ autonomous/ai/models/gemini.py,sha256=jrTMbh8SAdzzz27elOhs82iwjyutYcy8fvTOSdW-GFQ,14247
14
14
  autonomous/ai/models/local.py,sha256=fkoi-hJp60yFlZ9Cb9PdUrmNSErYltQ5ezkUI75llXc,2734
15
15
  autonomous/ai/models/openai.py,sha256=2-LttCm6woGklaLbs1H5LjlbfM-7leDwGmC9vksSqW4,13135
16
16
  autonomous/apis/version_control/GHCallbacks.py,sha256=AyiUlYfV5JePi11GVyqYyXoj5UTbPKzS-HRRI94rjJo,1069
@@ -57,7 +57,7 @@ autonomous/storage/localstorage.py,sha256=FzrR6O9mMGAZt5dDgqzkeOQVfGRXCygR0kksz2
57
57
  autonomous/tasks/__init__.py,sha256=pn7iZ14MhcHUdzcLkfkd4-45wgPP0tXahAz_cFgb_Tg,32
58
58
  autonomous/tasks/autotask.py,sha256=aK5iapDhgcAic3F5ZYMAhNKJkOepj8yWwbMizKDzUwQ,4153
59
59
  autonomous/utils/markdown.py,sha256=tf8vlHARiQO1X_aGbqlYozzP_TbdiDRT9EEP6aFRQo0,2153
60
- autonomous_app-0.3.27.dist-info/METADATA,sha256=x9PPnKHTy5dMQks_32hax4zXjUk1dxAAmlbpcG-JpIQ,3015
61
- autonomous_app-0.3.27.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
62
- autonomous_app-0.3.27.dist-info/top_level.txt,sha256=ZyxWWDdbvZekF3UFunxl4BQsVDb_FOW3eTn0vun_jb4,11
63
- autonomous_app-0.3.27.dist-info/RECORD,,
60
+ autonomous_app-0.3.28.dist-info/METADATA,sha256=HgUXCoGnskzg9FAnSZwfEGXB-5l1Rksw0XTMnGp6bBk,3015
61
+ autonomous_app-0.3.28.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
62
+ autonomous_app-0.3.28.dist-info/top_level.txt,sha256=ZyxWWDdbvZekF3UFunxl4BQsVDb_FOW3eTn0vun_jb4,11
63
+ autonomous_app-0.3.28.dist-info/RECORD,,