Terminal-Assistant-Interface 1.1.1__tar.gz → 1.1.2__tar.gz
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.
- {terminal_assistant_interface-1.1.1 → terminal_assistant_interface-1.1.2}/PKG-INFO +1 -1
- {terminal_assistant_interface-1.1.1 → terminal_assistant_interface-1.1.2}/pyproject.toml +1 -1
- {terminal_assistant_interface-1.1.1 → terminal_assistant_interface-1.1.2}/src/Terminal_Assistant_Interface.egg-info/PKG-INFO +1 -1
- {terminal_assistant_interface-1.1.1 → terminal_assistant_interface-1.1.2}/src/termiai/__init__.py +32 -5
- {terminal_assistant_interface-1.1.1 → terminal_assistant_interface-1.1.2}/src/termilib/tools.py +3 -0
- {terminal_assistant_interface-1.1.1 → terminal_assistant_interface-1.1.2}/LICENSE +0 -0
- {terminal_assistant_interface-1.1.1 → terminal_assistant_interface-1.1.2}/README.md +0 -0
- {terminal_assistant_interface-1.1.1 → terminal_assistant_interface-1.1.2}/setup.cfg +0 -0
- {terminal_assistant_interface-1.1.1 → terminal_assistant_interface-1.1.2}/src/Terminal_Assistant_Interface.egg-info/SOURCES.txt +0 -0
- {terminal_assistant_interface-1.1.1 → terminal_assistant_interface-1.1.2}/src/Terminal_Assistant_Interface.egg-info/dependency_links.txt +0 -0
- {terminal_assistant_interface-1.1.1 → terminal_assistant_interface-1.1.2}/src/Terminal_Assistant_Interface.egg-info/entry_points.txt +0 -0
- {terminal_assistant_interface-1.1.1 → terminal_assistant_interface-1.1.2}/src/Terminal_Assistant_Interface.egg-info/requires.txt +0 -0
- {terminal_assistant_interface-1.1.1 → terminal_assistant_interface-1.1.2}/src/Terminal_Assistant_Interface.egg-info/top_level.txt +0 -0
- {terminal_assistant_interface-1.1.1 → terminal_assistant_interface-1.1.2}/src/termiai/__main__.py +0 -0
- {terminal_assistant_interface-1.1.1 → terminal_assistant_interface-1.1.2}/src/termiai/clean.py +0 -0
- {terminal_assistant_interface-1.1.1 → terminal_assistant_interface-1.1.2}/src/termiai_main.py +0 -0
- {terminal_assistant_interface-1.1.1 → terminal_assistant_interface-1.1.2}/src/termilib/__init__.py +0 -0
- {terminal_assistant_interface-1.1.1 → terminal_assistant_interface-1.1.2}/src/termilib/__main__.py +0 -0
- {terminal_assistant_interface-1.1.1 → terminal_assistant_interface-1.1.2}/src/termilib/ftapi.py +0 -0
- {terminal_assistant_interface-1.1.1 → terminal_assistant_interface-1.1.2}/src/termilib/icon_data.py +0 -0
- {terminal_assistant_interface-1.1.1 → terminal_assistant_interface-1.1.2}/src/termilib/test.py +0 -0
{terminal_assistant_interface-1.1.1 → terminal_assistant_interface-1.1.2}/src/termiai/__init__.py
RENAMED
|
@@ -206,37 +206,60 @@ def main(page: ft.Page):
|
|
|
206
206
|
darkTog = ft.Switch(label="Dark mode", on_change=darkMode, value=tools.APPCONFIG.get("dark", False))
|
|
207
207
|
def apiChange(e):
|
|
208
208
|
tools.APPCONFIG["customUrlApiKey"] = api_key.value
|
|
209
|
+
tools.KEY = api_key.value
|
|
209
210
|
async def wait_and_done():
|
|
210
|
-
toggle_btn = e.control
|
|
211
211
|
api_key.password = api_key.disabled = toggle_btn.disabled = True
|
|
212
212
|
toggle_btn.icon = ft.Icons.DONE
|
|
213
213
|
page.update()
|
|
214
|
-
await asyncio.sleep(
|
|
214
|
+
await asyncio.sleep(2)
|
|
215
|
+
if not tools.APPCONFIG.get("customApi"):
|
|
216
|
+
return
|
|
215
217
|
toggle_btn.disabled = api_key.disabled = False
|
|
216
218
|
toggle_btn.icon = ft.Icons.VISIBILITY_OFF
|
|
217
219
|
page.update()
|
|
218
220
|
page.run_task(wait_and_done)
|
|
219
221
|
def endChange(e):
|
|
220
222
|
tools.APPCONFIG["customUrl"] = endpoint.value
|
|
223
|
+
tools.URL = endpoint.value
|
|
221
224
|
async def wait_and_done():
|
|
222
225
|
endpoint.disabled = True
|
|
223
226
|
emark.icon = ft.Icons.DONE
|
|
224
227
|
page.update()
|
|
225
|
-
await asyncio.sleep(
|
|
228
|
+
await asyncio.sleep(2)
|
|
226
229
|
if not tools.APPCONFIG.get("customApi"):
|
|
227
230
|
return
|
|
228
231
|
endpoint.disabled = False
|
|
229
232
|
emark.icon = ft.Icons.KEYBOARD_RETURN
|
|
230
233
|
page.update()
|
|
231
234
|
page.run_task(wait_and_done)
|
|
235
|
+
def modChange(e):
|
|
236
|
+
tools.APPCONFIG["customModel"] = modelai.value
|
|
237
|
+
tools.MODEL = modelai.value
|
|
238
|
+
async def wait_and_done():
|
|
239
|
+
modelai.disabled = True
|
|
240
|
+
modelaico.icon = ft.Icons.DONE
|
|
241
|
+
page.update()
|
|
242
|
+
await asyncio.sleep(2)
|
|
243
|
+
if not tools.APPCONFIG.get("customApi"):
|
|
244
|
+
return
|
|
245
|
+
modelai.disabled = False
|
|
246
|
+
modelaico.icon = ft.Icons.KEYBOARD_RETURN
|
|
247
|
+
page.update()
|
|
248
|
+
page.run_task(wait_and_done)
|
|
232
249
|
def server_select(e):
|
|
233
250
|
if e.control.value == "c":
|
|
234
251
|
tools.APPCONFIG["customApi"] = True
|
|
235
|
-
api_key.disabled = endpoint.disabled = False
|
|
252
|
+
api_key.disabled = endpoint.disabled = modelai.disabled = False
|
|
253
|
+
tools.MODEL = tools.APPCONFIG.get("customApiModel", "")
|
|
254
|
+
tools.KEY = tools.APPCONFIG.get("customUrlApiKey", "")
|
|
255
|
+
endpoint.value = tools.APPCONFIG.get("customUrl", "")
|
|
256
|
+
api_key.value = tools.KEY
|
|
257
|
+
modelai.value = tools.MODEL
|
|
236
258
|
else:
|
|
237
|
-
api_key.disabled = endpoint.disabled = True
|
|
259
|
+
api_key.disabled = endpoint.disabled = modelai.disabled = True
|
|
238
260
|
tools.APPCONFIG["customApi"] = False
|
|
239
261
|
tools.APPCONFIG["api"] = e.control.value
|
|
262
|
+
tools.MODEL = tools.KEY = None
|
|
240
263
|
tools.URL = tools.BASEAIURL % e.control.value
|
|
241
264
|
page.run_task(tools.loop)
|
|
242
265
|
def toggle_visibility(e):
|
|
@@ -247,8 +270,11 @@ def main(page: ft.Page):
|
|
|
247
270
|
endpoint = ft.TextField(disabled=not tools.APPCONFIG.get("customApi"), label="Custom endpoint URL", value=tools.URL if tools.APPCONFIG.get("customApi") else "", on_submit=endChange, expand=True)
|
|
248
271
|
emark = ft.Icon(ft.Icons.KEYBOARD_RETURN)
|
|
249
272
|
toggle_btn = ft.IconButton(icon=ft.Icons.VISIBILITY_OFF, on_click=toggle_visibility)
|
|
273
|
+
modelai = ft.TextField(disabled=not tools.APPCONFIG.get("customApi"), label="AI Model for Custom Endpoint", value=tools.MODEL if tools.APPCONFIG.get("customApi") else "", on_submit=modChange, expand=True)
|
|
274
|
+
modelaico = ft.Icon(ft.Icons.KEYBOARD_RETURN)
|
|
250
275
|
arow = ft.Row(controls=[api_key, toggle_btn])
|
|
251
276
|
erow = ft.Row(controls=[endpoint, emark])
|
|
277
|
+
mrow = ft.Row(controls=[modelai, modelaico])
|
|
252
278
|
choose_server = ft.Dropdown(
|
|
253
279
|
label="Select server",
|
|
254
280
|
width=700,
|
|
@@ -335,6 +361,7 @@ def main(page: ft.Page):
|
|
|
335
361
|
choose_server,
|
|
336
362
|
erow,
|
|
337
363
|
arow,
|
|
364
|
+
mrow,
|
|
338
365
|
choose_search,
|
|
339
366
|
backup_row,
|
|
340
367
|
],
|
{terminal_assistant_interface-1.1.1 → terminal_assistant_interface-1.1.2}/src/termilib/tools.py
RENAMED
|
@@ -254,6 +254,8 @@ async def post(data):
|
|
|
254
254
|
h = {"Content-Type": "application/json"}
|
|
255
255
|
if KEY:
|
|
256
256
|
h["Authorization"] = "Bearer " + KEY
|
|
257
|
+
if MODEL:
|
|
258
|
+
data["model"] = MODEL
|
|
257
259
|
r = await client.post(URL or "https://ai-proxy-x.onrender.com/", content=json.dumps(data), headers=h, timeout=120, follow_redirects=True)
|
|
258
260
|
m = r.json()
|
|
259
261
|
if isinstance(m, list):
|
|
@@ -522,6 +524,7 @@ CHATJSON = LiveJson(CHATS)
|
|
|
522
524
|
APPCONFIG = LiveJson(JOIN(CONFIGS, "appcfg.json"), default_data=DEFAULTDATA)
|
|
523
525
|
URL = APPCONFIG.get("customUrl", BASEAIURL % "x") or BASEAIURL % "x" if APPCONFIG.get("customApi") else BASEAIURL % APPCONFIG.get("api", "x")
|
|
524
526
|
KEY = APPCONFIG.get("customUrlApiKey") if APPCONFIG.get("customApi") else None
|
|
527
|
+
MODEL = APPCONFIG.get("customApiModel") if APPCONFIG.get("customApi") else None
|
|
525
528
|
INSTANTSEARCH = APPCONFIG.get("instantSearch", True)
|
|
526
529
|
|
|
527
530
|
if __name__ == '__main__':
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{terminal_assistant_interface-1.1.1 → terminal_assistant_interface-1.1.2}/src/termiai/__main__.py
RENAMED
|
File without changes
|
{terminal_assistant_interface-1.1.1 → terminal_assistant_interface-1.1.2}/src/termiai/clean.py
RENAMED
|
File without changes
|
{terminal_assistant_interface-1.1.1 → terminal_assistant_interface-1.1.2}/src/termiai_main.py
RENAMED
|
File without changes
|
{terminal_assistant_interface-1.1.1 → terminal_assistant_interface-1.1.2}/src/termilib/__init__.py
RENAMED
|
File without changes
|
{terminal_assistant_interface-1.1.1 → terminal_assistant_interface-1.1.2}/src/termilib/__main__.py
RENAMED
|
File without changes
|
{terminal_assistant_interface-1.1.1 → terminal_assistant_interface-1.1.2}/src/termilib/ftapi.py
RENAMED
|
File without changes
|
{terminal_assistant_interface-1.1.1 → terminal_assistant_interface-1.1.2}/src/termilib/icon_data.py
RENAMED
|
File without changes
|
{terminal_assistant_interface-1.1.1 → terminal_assistant_interface-1.1.2}/src/termilib/test.py
RENAMED
|
File without changes
|