autonomous-app 0.3.49__py3-none-any.whl → 0.3.50__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 +1 -1
- autonomous/ai/models/local_model.py +38 -2
- autonomous/taskrunner/autotasks.py +44 -8
- {autonomous_app-0.3.49.dist-info → autonomous_app-0.3.50.dist-info}/METADATA +1 -1
- {autonomous_app-0.3.49.dist-info → autonomous_app-0.3.50.dist-info}/RECORD +8 -8
- {autonomous_app-0.3.49.dist-info → autonomous_app-0.3.50.dist-info}/WHEEL +0 -0
- {autonomous_app-0.3.49.dist-info → autonomous_app-0.3.50.dist-info}/top_level.txt +0 -0
autonomous/__init__.py
CHANGED
autonomous/ai/audioagent.py
CHANGED
|
@@ -8,7 +8,7 @@ from autonomous.model.autoattr import StringAttr
|
|
|
8
8
|
class AudioAgent(BaseAgent):
|
|
9
9
|
name = StringAttr(default="audioagent")
|
|
10
10
|
|
|
11
|
-
provider = StringAttr(default="
|
|
11
|
+
provider = StringAttr(default="local")
|
|
12
12
|
|
|
13
13
|
instructions = StringAttr(
|
|
14
14
|
default="You are highly skilled AI trained to assist with generating audio files."
|
|
@@ -24,10 +24,36 @@ class LocalAIModel(AutoModel):
|
|
|
24
24
|
_text_model = "llama3"
|
|
25
25
|
_json_model = "llama3"
|
|
26
26
|
|
|
27
|
-
# ... VOICES dictionary ... (Keep existing voices)
|
|
28
27
|
VOICES = {
|
|
29
28
|
"Zephyr": ["female"],
|
|
30
|
-
|
|
29
|
+
"Puck": ["male"],
|
|
30
|
+
"Charon": ["male"],
|
|
31
|
+
"Kore": ["female"],
|
|
32
|
+
"Fenrir": ["non-binary"],
|
|
33
|
+
"Leda": ["female"],
|
|
34
|
+
"Orus": ["male"],
|
|
35
|
+
"Aoede": ["female"],
|
|
36
|
+
"Callirhoe": ["female"],
|
|
37
|
+
"Autonoe": ["female"],
|
|
38
|
+
"Enceladus": ["male"],
|
|
39
|
+
"Iapetus": ["male"],
|
|
40
|
+
"Umbriel": ["male"],
|
|
41
|
+
"Algieba": ["male"],
|
|
42
|
+
"Despina": ["female"],
|
|
43
|
+
"Erinome": ["female"],
|
|
44
|
+
"Algenib": ["male"],
|
|
45
|
+
"Rasalgethi": ["non-binary"],
|
|
46
|
+
"Laomedeia": ["female"],
|
|
47
|
+
"Achernar": ["female"],
|
|
48
|
+
"Alnilam": ["male"],
|
|
49
|
+
"Schedar": ["male"],
|
|
50
|
+
"Gacrux": ["female"],
|
|
51
|
+
"Pulcherrima": ["non-binary"],
|
|
52
|
+
"Achird": ["male"],
|
|
53
|
+
"Zubenelgenubi": ["male"],
|
|
54
|
+
"Vindemiatrix": ["female"],
|
|
55
|
+
"Sadachbia": ["male"],
|
|
56
|
+
"Sadaltager": ["male"],
|
|
31
57
|
"Sulafar": ["female"],
|
|
32
58
|
}
|
|
33
59
|
|
|
@@ -219,11 +245,21 @@ class LocalAIModel(AutoModel):
|
|
|
219
245
|
files = {"file": ("audio.mp3", f_obj, "audio/mpeg")}
|
|
220
246
|
response = requests.post(f"{self._media_url}/transcribe", files=files)
|
|
221
247
|
response.raise_for_status()
|
|
248
|
+
log(f"Transcription response: {response.json()}", _print=True)
|
|
222
249
|
return response.json().get("text", "")
|
|
223
250
|
except Exception as e:
|
|
224
251
|
log(f"STT Error: {e}", _print=True)
|
|
225
252
|
return ""
|
|
226
253
|
|
|
254
|
+
def list_voices(self, filters=[]):
|
|
255
|
+
if not filters:
|
|
256
|
+
return list(self.VOICES.keys())
|
|
257
|
+
voices = []
|
|
258
|
+
for voice, attribs in self.VOICES.items():
|
|
259
|
+
if any(f.lower() in attribs for f in filters):
|
|
260
|
+
voices.append(voice)
|
|
261
|
+
return voices
|
|
262
|
+
|
|
227
263
|
def generate_audio(
|
|
228
264
|
self,
|
|
229
265
|
prompt,
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import os
|
|
2
2
|
from enum import Enum
|
|
3
|
+
|
|
3
4
|
from redis import Redis
|
|
4
5
|
from rq import Queue
|
|
5
6
|
from rq.job import Job
|
|
6
7
|
|
|
8
|
+
|
|
7
9
|
# 1. Define Priorities clearly
|
|
8
10
|
class TaskPriority(Enum):
|
|
9
11
|
HIGH = "high"
|
|
10
12
|
DEFAULT = "default"
|
|
11
13
|
LOW = "low"
|
|
12
14
|
|
|
15
|
+
|
|
13
16
|
class AutoTask:
|
|
14
17
|
def __init__(self, job):
|
|
15
18
|
self.job = job
|
|
@@ -28,9 +31,10 @@ class AutoTask:
|
|
|
28
31
|
"id": self.id,
|
|
29
32
|
"return_value": self.job.result,
|
|
30
33
|
"status": self.status,
|
|
31
|
-
"error": self.job.exc_info
|
|
34
|
+
"error": self.job.exc_info,
|
|
32
35
|
}
|
|
33
36
|
|
|
37
|
+
|
|
34
38
|
class AutoTasks:
|
|
35
39
|
_connection = None
|
|
36
40
|
# We remove the single 'queue' class attribute because we now have multiple
|
|
@@ -76,12 +80,7 @@ class AutoTasks:
|
|
|
76
80
|
q = self._get_queue(queue_name)
|
|
77
81
|
|
|
78
82
|
# 4. Enqueue
|
|
79
|
-
job = q.enqueue(
|
|
80
|
-
func,
|
|
81
|
-
args=args,
|
|
82
|
-
kwargs=kwargs,
|
|
83
|
-
job_timeout=job_timeout
|
|
84
|
-
)
|
|
83
|
+
job = q.enqueue(func, args=args, kwargs=kwargs, job_timeout=job_timeout)
|
|
85
84
|
|
|
86
85
|
return AutoTask(job)
|
|
87
86
|
|
|
@@ -90,4 +89,41 @@ class AutoTasks:
|
|
|
90
89
|
job = Job.fetch(job_id, connection=AutoTasks._connection)
|
|
91
90
|
return AutoTask(job)
|
|
92
91
|
except Exception:
|
|
93
|
-
return None
|
|
92
|
+
return None
|
|
93
|
+
|
|
94
|
+
def get_tasks(self):
|
|
95
|
+
|
|
96
|
+
high_queue = Queue("high", connection=self._connection)
|
|
97
|
+
default_queue = Queue("default", connection=self._connection)
|
|
98
|
+
low_queue = Queue("low", connection=self._connection)
|
|
99
|
+
|
|
100
|
+
registries = {
|
|
101
|
+
"started": [
|
|
102
|
+
high_queue.started_job_registry,
|
|
103
|
+
default_queue.started_job_registry,
|
|
104
|
+
low_queue.started_job_registry,
|
|
105
|
+
],
|
|
106
|
+
"finished": [
|
|
107
|
+
high_queue.finished_job_registry,
|
|
108
|
+
default_queue.finished_job_registry,
|
|
109
|
+
low_queue.finished_job_registry,
|
|
110
|
+
],
|
|
111
|
+
"failed": [
|
|
112
|
+
high_queue.failed_job_registry,
|
|
113
|
+
default_queue.failed_job_registry,
|
|
114
|
+
low_queue.failed_job_registry,
|
|
115
|
+
],
|
|
116
|
+
"queued": [high_queue, default_queue, low_queue],
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
tasks = {}
|
|
120
|
+
for status, regs in registries.items():
|
|
121
|
+
all_job_ids = []
|
|
122
|
+
for reg in regs:
|
|
123
|
+
all_job_ids.extend(reg.get_job_ids())
|
|
124
|
+
# Use a set to remove duplicate job_ids if a job is in multiple registries
|
|
125
|
+
unique_job_ids = sorted(list(set(all_job_ids)), reverse=True)
|
|
126
|
+
jobs = Job.fetch_many(unique_job_ids, connection=self._connection)
|
|
127
|
+
# Filter out None values in case a job expired between fetch and get
|
|
128
|
+
tasks[status] = [job for job in jobs if job]
|
|
129
|
+
return tasks
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: autonomous-app
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.50
|
|
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,15 +1,15 @@
|
|
|
1
|
-
autonomous/__init__.py,sha256=
|
|
1
|
+
autonomous/__init__.py,sha256=Bfx9V4lwColWq8lzS8MH_02fwl8OseyZms6DSENLM_g,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=
|
|
5
|
+
autonomous/ai/audioagent.py,sha256=6gMcmLrEuMdbjd9NnwzVmxeToFqXQ6ppAQCRWMcmg_Y,1091
|
|
6
6
|
autonomous/ai/baseagent.py,sha256=icOPygr1NdH64u1ZYbwHHywYIY1ZtaLY9HtfNmUbx4k,4702
|
|
7
7
|
autonomous/ai/imageagent.py,sha256=1RT7OYTnRUo3q5k5w83A3cOh3hXUlrx0jRkg0YJSgZ0,900
|
|
8
8
|
autonomous/ai/jsonagent.py,sha256=NpF-bJXolTBeW9xVdeEfdNwzdlaaRMjFwo_s-d9ApLM,1166
|
|
9
9
|
autonomous/ai/textagent.py,sha256=0y2Hvb9pup1OnsA51hGPcD8yllZOZtztDLQvCNYABaw,1043
|
|
10
10
|
autonomous/ai/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
11
|
autonomous/ai/models/gemini.py,sha256=JtMw1RatDuTtDaVe5sp_t-nOdWbGvJzljWHhNh9o3yk,13107
|
|
12
|
-
autonomous/ai/models/local_model.py,sha256=
|
|
12
|
+
autonomous/ai/models/local_model.py,sha256=o2C7hrSrOyXgDqzYl1AX0cdoPCICfk_pAGm65OQDbtg,14197
|
|
13
13
|
autonomous/ai/models/mock_model.py,sha256=IT4ip821ZewDOFbHrAFJ3Ks_OUIN-Z0lEF6oGs5j4WU,3061
|
|
14
14
|
autonomous/apis/version_control/GHCallbacks.py,sha256=AyiUlYfV5JePi11GVyqYyXoj5UTbPKzS-HRRI94rjJo,1069
|
|
15
15
|
autonomous/apis/version_control/GHOrganization.py,sha256=mi2livdsGurKiifbvuLwiFbdDzL77IlEfhwEa-tG77I,1155
|
|
@@ -53,10 +53,10 @@ autonomous/storage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuF
|
|
|
53
53
|
autonomous/storage/imagestorage.py,sha256=SmBjBNBlP1ZEjxdOnGVzCHZhbEhMKTUQC2TbpWbejDE,6168
|
|
54
54
|
autonomous/storage/localstorage.py,sha256=FzrR6O9mMGAZt5dDgqzkeOQVfGRXCygR0kksz2MPpwE,2286
|
|
55
55
|
autonomous/taskrunner/__init__.py,sha256=ughX-QfWBas5W3aB2SiF887SWJ3Dzc2X43Yxtmpl43k,47
|
|
56
|
-
autonomous/taskrunner/autotasks.py,sha256=
|
|
56
|
+
autonomous/taskrunner/autotasks.py,sha256=smrWEGBE9QLpLco4ydOFi_gVcFp1mVxfQioACL2FBA8,4029
|
|
57
57
|
autonomous/taskrunner/task_router.py,sha256=W09HtRUuhwlnGxM5w4l6Hzw6mfS6L4ljWiMzD3ZVFeU,601
|
|
58
58
|
autonomous/utils/markdown.py,sha256=tf8vlHARiQO1X_aGbqlYozzP_TbdiDRT9EEP6aFRQo0,2153
|
|
59
|
-
autonomous_app-0.3.
|
|
60
|
-
autonomous_app-0.3.
|
|
61
|
-
autonomous_app-0.3.
|
|
62
|
-
autonomous_app-0.3.
|
|
59
|
+
autonomous_app-0.3.50.dist-info/METADATA,sha256=g_6i1h0xP6Ee-izUtTmz2-nyAEPBI9pIVwSDGmiGG-s,3024
|
|
60
|
+
autonomous_app-0.3.50.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
61
|
+
autonomous_app-0.3.50.dist-info/top_level.txt,sha256=ZyxWWDdbvZekF3UFunxl4BQsVDb_FOW3eTn0vun_jb4,11
|
|
62
|
+
autonomous_app-0.3.50.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|