autonomous-app 0.3.21__py3-none-any.whl → 0.3.23__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.21"
1
+ __version__ = "0.3.23"
2
2
 
3
3
  from dotenv import load_dotenv
4
4
 
@@ -1,3 +1,4 @@
1
+ import filters
1
2
  from autonomous import log
2
3
  from autonomous.ai.baseagent import BaseAgent
3
4
  from autonomous.model.autoattr import ReferenceAttr, StringAttr
@@ -24,3 +25,6 @@ class AudioAgent(BaseAgent):
24
25
 
25
26
  def transcribe(self, audio, **kwargs):
26
27
  return self.get_client().generate_audio_text(audio, **kwargs)
28
+
29
+ def available_voices(self, filters=filters):
30
+ return self.get_client().list_voices(filters=filters)
@@ -1,18 +1,14 @@
1
- import datetime
2
1
  import io
3
- import json
4
2
  import os
5
3
  import random
6
4
  import wave
7
- from http import client
8
5
 
9
6
  from google import genai
10
7
  from google.genai import types
11
- from PIL import Image as PILImage
12
8
  from pydub import AudioSegment
13
9
 
14
10
  from autonomous import log
15
- from autonomous.model.autoattr import DictAttr, ListAttr, StringAttr
11
+ from autonomous.model.autoattr import ListAttr, StringAttr
16
12
  from autonomous.model.automodel import AutoModel
17
13
 
18
14
 
@@ -25,6 +21,38 @@ class GeminiAIModel(AutoModel):
25
21
  _stt_model = "gemini-3-pro-preview"
26
22
  _tts_model = "gemini-2.5-flash-preview-tts"
27
23
  MAX_FILES = 14
24
+ VOICES = {
25
+ "Zephyr": ["female"],
26
+ "Puck": ["male"],
27
+ "Charon": ["male"],
28
+ "Kore": ["female"],
29
+ "Fenrir": ["non-binary"],
30
+ "Leda": ["female"],
31
+ "Orus": ["male"],
32
+ "Aoede": ["female"],
33
+ "Callirhoe": ["female"],
34
+ "Autonoe": ["female"],
35
+ "Enceladus": ["male"],
36
+ "Iapetus": ["male"],
37
+ "Umbriel": ["male"],
38
+ "Algieba": ["male"],
39
+ "Despina": ["female"],
40
+ "Erinome": ["female"],
41
+ "Algenib": ["male"],
42
+ "Rasalgethi": ["non-binary"],
43
+ "Laomedeia": ["female"],
44
+ "Achernar": ["female"],
45
+ "Alnilam": ["male"],
46
+ "Schedar": ["male"],
47
+ "Gacrux": ["female"],
48
+ "Pulcherrima": ["non-binary"],
49
+ "Achird": ["male"],
50
+ "Zubenelgenubi": ["male"],
51
+ "Vindemiatrix": ["female"],
52
+ "Sadachbia": ["male"],
53
+ "Sadaltager": ["male"],
54
+ "Sulafar": ["female"],
55
+ }
28
56
 
29
57
  messages = ListAttr(StringAttr(default=[]))
30
58
  name = StringAttr(default="agent")
@@ -163,42 +191,17 @@ class GeminiAIModel(AutoModel):
163
191
  )
164
192
  return response.text
165
193
 
166
- def generate_audio(self, prompt, voice=None):
167
- voice = voice or random.choice(
168
- [
169
- "Zephyr",
170
- "Puck",
171
- "Charon",
172
- "Kore",
173
- "Fenrir",
174
- "Leda",
175
- "Orus",
176
- "Aoede",
177
- "Callirhoe",
178
- "Autonoe",
179
- "Enceladus",
180
- "Iapetus",
181
- "Umbriel",
182
- "Algieba",
183
- "Despina",
184
- "Erinome",
185
- "Algenib",
186
- "Rasalgethi",
187
- "Laomedeia",
188
- "Achernar",
189
- "Alnilam",
190
- "Schedar",
191
- "Gacrux",
192
- "Pulcherrima",
193
- "Achird",
194
- "Zubenelgenubi",
195
- "Vindemiatrix",
196
- "Sadachbia",
197
- "Sadaltager",
198
- "Sulafar",
199
- ]
200
- )
201
-
194
+ def list_voices(self, filters=[]):
195
+ if not filters:
196
+ return list(self.VOICES.keys())
197
+ voices = []
198
+ for voice, attribs in self.VOICES.items():
199
+ if any(f.lower() in attribs for f in filters):
200
+ voices.append(voice)
201
+ return voices
202
+
203
+ def generate_audio(self, prompt, voice=None, **kwargs):
204
+ voice = voice or random.choice(self.list_voices())
202
205
  try:
203
206
  response = self.client.models.generate_content(
204
207
  model=self._tts_model,
@@ -247,7 +250,8 @@ class GeminiAIModel(AutoModel):
247
250
  for fn, f in kwargs.get("files").items():
248
251
  media = io.BytesIO(f)
249
252
  myfile = self.client.files.upload(
250
- file=media, config={"mime_type": "image/webp", "display_name": fn}
253
+ file=media,
254
+ config={"mime_type": "image/webp", "display_name": fn},
251
255
  )
252
256
  contents += [myfile]
253
257
  counter += 1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: autonomous-app
3
- Version: 0.3.21
3
+ Version: 0.3.23
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,8 +1,8 @@
1
- autonomous/__init__.py,sha256=lcpO1uAyZyvv8X7N8OTm83vpd0a4N0Ng_gei6D0Henw,95
1
+ autonomous/__init__.py,sha256=Cl4ElD8pxdGQWiDyFqzC7jzlOMNMDBIRbtYOcr8ARWk,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=9QsA-cwj3P4j730bvzUJ3nbucU8tsNLYk_swbkapVvI,966
5
+ autonomous/ai/audioagent.py,sha256=uCFHbAH7oYrCJII4N_pU7nC6HJMRmyDHtuBRwHfI4Jw,1093
6
6
  autonomous/ai/baseagent.py,sha256=HYCqC4HmK5afNMunmTkhRE8O0OaONl2GxXnISkdOM58,1094
7
7
  autonomous/ai/imageagent.py,sha256=bIOrgg_CM-rgfyLme7V9vPqP8WKVMIAVoB2E9lLtIRk,521
8
8
  autonomous/ai/jsonagent.py,sha256=a_l4HyyVRj3FB6py_P1xdc4Bj9uNI1YmJrWQXAksIvs,964
@@ -10,7 +10,7 @@ autonomous/ai/textagent.py,sha256=wI1-VC9zscKYyxYBg4pZ0ZyNJ5ZvKkLfWsIY1vJFChk,86
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=iwR2snCvPzD2lsAE7sbdIiqI5QMtv4TEKEfLkdLbTxI,11035
13
+ autonomous/ai/models/gemini.py,sha256=koyhxNQVYloYRdqFDKQZSJV0NVj0dVL88JV7F31irP0,11372
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.21.dist-info/METADATA,sha256=0QGJsmxnVV6fQQISDgeEvYGfFrj64Y8B2OOO8S2jZCk,3015
61
- autonomous_app-0.3.21.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
62
- autonomous_app-0.3.21.dist-info/top_level.txt,sha256=ZyxWWDdbvZekF3UFunxl4BQsVDb_FOW3eTn0vun_jb4,11
63
- autonomous_app-0.3.21.dist-info/RECORD,,
60
+ autonomous_app-0.3.23.dist-info/METADATA,sha256=CrJoGDvDKbdrCSYUyEkQWE21uK67NOEXDPPdyfjczHM,3015
61
+ autonomous_app-0.3.23.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
62
+ autonomous_app-0.3.23.dist-info/top_level.txt,sha256=ZyxWWDdbvZekF3UFunxl4BQsVDb_FOW3eTn0vun_jb4,11
63
+ autonomous_app-0.3.23.dist-info/RECORD,,