autonomous-app 0.3.46__py3-none-any.whl → 0.3.48__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.46"
1
+ __version__ = "0.3.48"
2
2
 
3
3
  from dotenv import load_dotenv
4
4
 
@@ -0,0 +1,86 @@
1
+ import base64
2
+ import io
3
+ import json
4
+
5
+ from autonomous import log
6
+ from autonomous.model.autoattr import ListAttr, StringAttr
7
+ from autonomous.model.automodel import AutoModel
8
+
9
+
10
+ class MockAIModel(AutoModel):
11
+ """
12
+ A Offline Mock Model for development.
13
+ Returns valid, structure-compliant dummy data instantly.
14
+ """
15
+
16
+ messages = ListAttr(StringAttr(default=[]))
17
+ name = StringAttr(default="mock_agent")
18
+ instructions = StringAttr(default="You are a Mock AI.")
19
+ description = StringAttr(default="Offline Mock Provider for testing.")
20
+
21
+ # A 1x1 Red Pixel PNG (Base64 decoded to bytes)
22
+ # This ensures PIL/Frontend code receives valid image data.
23
+ _MOCK_IMAGE_BYTES = base64.b64decode(
24
+ "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="
25
+ )
26
+
27
+ # A 1-second silent WAV file (Base64 decoded to bytes)
28
+ _MOCK_AUDIO_BYTES = base64.b64decode(
29
+ "UklGRigAAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YQAAAAEA"
30
+ )
31
+
32
+ def generate_json(self, message, system_prompt=None, uri="", context={}):
33
+ """
34
+ Returns a rich dummy JSON object.
35
+ It attempts to guess the context based on keys found in the prompt,
36
+ otherwise returns a safe default TTRPG object.
37
+ """
38
+ log(f"⚡ [MOCK] Generating JSON for prompt: {message[:50]}...", _print=True)
39
+
40
+ # 1. Default Mock Object
41
+ mock_response = {
42
+ "name": "The Mockingbird Tavern",
43
+ "description": "A glitchy, holographic tavern that only exists in offline mode. The ale tastes like static.",
44
+ "backstory": "Created by a developer at 30,000 feet, this tavern serves as a placeholder for real content. It was built on the ruins of a NullReferenceException.",
45
+ "appearance": "Wireframe walls with textures that haven't loaded yet.",
46
+ "secrets": "If you look closely at the bartender, you can see he is just a looping IF statement.",
47
+ "tags": ["offline", "dev-mode", "test"],
48
+ "type": "Location",
49
+ }
50
+
51
+ # 2. Heuristic: If the user provided a context with 'name', use it.
52
+ # This makes the mock feel slightly responsive.
53
+ if context:
54
+ if "name" in context:
55
+ mock_response["name"] = f"Mock {context['name']}"
56
+ if "title" in context:
57
+ mock_response["name"] = f"Mock {context['title']}"
58
+
59
+ return mock_response
60
+
61
+ def generate_text(self, message, additional_instructions="", uri="", context={}):
62
+ log(f"⚡ [MOCK] Generating Text...", _print=True)
63
+ return (
64
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit. "
65
+ "This is MOCK TEXT generated because you are currently offline. "
66
+ "The quick brown fox jumps over the lazy dog."
67
+ )
68
+
69
+ def summarize_text(self, text, primer=""):
70
+ log(f"⚡ [MOCK] Summarizing {len(text)} chars...", _print=True)
71
+ return "This is a mock summary of the provided text. It is concise and offline."
72
+
73
+ def generate_transcription(self, audio_file, prompt=""):
74
+ log(f"⚡ [MOCK] Transcribing Audio...", _print=True)
75
+ return "This is a mock transcription of the audio file."
76
+
77
+ def generate_audio(self, prompt, voice=None):
78
+ log(f"⚡ [MOCK] Generating Audio...", _print=True)
79
+ return self._MOCK_AUDIO_BYTES
80
+
81
+ def generate_image(
82
+ self, prompt, negative_prompt="", files=None, aspect_ratio="2KPortrait"
83
+ ):
84
+ log(f"⚡ [MOCK] Generating Image ({aspect_ratio})...", _print=True)
85
+ # Returns a valid 1x1 pixel PNG so your UI displays something red instead of crashing
86
+ return self._MOCK_IMAGE_BYTES
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: autonomous-app
3
- Version: 0.3.46
3
+ Version: 0.3.48
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,4 +1,4 @@
1
- autonomous/__init__.py,sha256=oTRnzQVLqzzRuzTfq9kDt3WcUBxfsZLBRfPfmNA4DQ0,95
1
+ autonomous/__init__.py,sha256=5NSHkTcQ1Im9Xo5O3r5nNTJr-fjzyglGsXdHD9FPF8Q,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
@@ -10,6 +10,7 @@ autonomous/ai/textagent.py,sha256=0y2Hvb9pup1OnsA51hGPcD8yllZOZtztDLQvCNYABaw,10
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
12
  autonomous/ai/models/local_model.py,sha256=-2-b_W2tvjgMMI15u9Y83olOgbnyp847zR9GKIOrbYs,12064
13
+ autonomous/ai/models/mock_model.py,sha256=fjIThcfOuZYj6mWEQZJg8fIwGABKRR3j5WVjh6hgnPY,3694
13
14
  autonomous/apis/version_control/GHCallbacks.py,sha256=AyiUlYfV5JePi11GVyqYyXoj5UTbPKzS-HRRI94rjJo,1069
14
15
  autonomous/apis/version_control/GHOrganization.py,sha256=mi2livdsGurKiifbvuLwiFbdDzL77IlEfhwEa-tG77I,1155
15
16
  autonomous/apis/version_control/GHRepo.py,sha256=hTFHMkxSbSlVELfh8S6mq6ijkIKPRQO-Q5775ZjRKD4,4622
@@ -55,7 +56,7 @@ autonomous/taskrunner/__init__.py,sha256=ughX-QfWBas5W3aB2SiF887SWJ3Dzc2X43Yxtmp
55
56
  autonomous/taskrunner/autotasks.py,sha256=2zRaqHYqfdlgC_BQm6B6D2svN1ukyWeJJHwweZFHVoo,2616
56
57
  autonomous/taskrunner/task_router.py,sha256=W09HtRUuhwlnGxM5w4l6Hzw6mfS6L4ljWiMzD3ZVFeU,601
57
58
  autonomous/utils/markdown.py,sha256=tf8vlHARiQO1X_aGbqlYozzP_TbdiDRT9EEP6aFRQo0,2153
58
- autonomous_app-0.3.46.dist-info/METADATA,sha256=MymAvUzR0fJygsoepf5t9x_GkOv3Mkx32fRpA7ZGIlc,3024
59
- autonomous_app-0.3.46.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
60
- autonomous_app-0.3.46.dist-info/top_level.txt,sha256=ZyxWWDdbvZekF3UFunxl4BQsVDb_FOW3eTn0vun_jb4,11
61
- autonomous_app-0.3.46.dist-info/RECORD,,
59
+ autonomous_app-0.3.48.dist-info/METADATA,sha256=jfU8tlq0YqBXvWsTgyqSHF70JTqS3el1X7jG2BdPCJM,3024
60
+ autonomous_app-0.3.48.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
61
+ autonomous_app-0.3.48.dist-info/top_level.txt,sha256=ZyxWWDdbvZekF3UFunxl4BQsVDb_FOW3eTn0vun_jb4,11
62
+ autonomous_app-0.3.48.dist-info/RECORD,,