llms-py 2.0.9__py3-none-any.whl → 2.0.10__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.
Files changed (43) hide show
  1. llms.py +14 -7
  2. llms_py-2.0.10.data/data/index.html +80 -0
  3. {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/llms.json +1 -4
  4. llms_py-2.0.10.data/data/ui/Avatar.mjs +28 -0
  5. llms_py-2.0.10.data/data/ui/Brand.mjs +23 -0
  6. {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/ChatPrompt.mjs +101 -69
  7. {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/Main.mjs +43 -183
  8. llms_py-2.0.10.data/data/ui/ModelSelector.mjs +29 -0
  9. llms_py-2.0.10.data/data/ui/ProviderStatus.mjs +105 -0
  10. {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/Recents.mjs +2 -1
  11. llms_py-2.0.10.data/data/ui/SettingsDialog.mjs +374 -0
  12. {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/Sidebar.mjs +11 -27
  13. llms_py-2.0.10.data/data/ui/SignIn.mjs +64 -0
  14. llms_py-2.0.10.data/data/ui/SystemPromptEditor.mjs +31 -0
  15. llms_py-2.0.10.data/data/ui/SystemPromptSelector.mjs +36 -0
  16. llms_py-2.0.10.data/data/ui/Welcome.mjs +8 -0
  17. llms_py-2.0.10.data/data/ui/ai.mjs +80 -0
  18. {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/app.css +76 -10
  19. llms_py-2.0.10.data/data/ui/lib/servicestack-vue.mjs +37 -0
  20. {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/markdown.mjs +9 -2
  21. {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/tailwind.input.css +13 -4
  22. {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/threadStore.mjs +2 -2
  23. {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/typography.css +109 -1
  24. {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/utils.mjs +8 -2
  25. {llms_py-2.0.9.dist-info → llms_py-2.0.10.dist-info}/METADATA +1 -1
  26. llms_py-2.0.10.dist-info/RECORD +40 -0
  27. llms_py-2.0.9.data/data/index.html +0 -64
  28. llms_py-2.0.9.data/data/ui/lib/servicestack-vue.min.mjs +0 -37
  29. llms_py-2.0.9.dist-info/RECORD +0 -30
  30. {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/requirements.txt +0 -0
  31. {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/App.mjs +0 -0
  32. {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/fav.svg +0 -0
  33. {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/lib/highlight.min.mjs +0 -0
  34. {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/lib/idb.min.mjs +0 -0
  35. {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/lib/marked.min.mjs +0 -0
  36. /llms_py-2.0.9.data/data/ui/lib/servicestack-client.min.mjs → /llms_py-2.0.10.data/data/ui/lib/servicestack-client.mjs +0 -0
  37. {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/lib/vue-router.min.mjs +0 -0
  38. {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/lib/vue.min.mjs +0 -0
  39. {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui.json +0 -0
  40. {llms_py-2.0.9.dist-info → llms_py-2.0.10.dist-info}/WHEEL +0 -0
  41. {llms_py-2.0.9.dist-info → llms_py-2.0.10.dist-info}/entry_points.txt +0 -0
  42. {llms_py-2.0.9.dist-info → llms_py-2.0.10.dist-info}/licenses/LICENSE +0 -0
  43. {llms_py-2.0.9.dist-info → llms_py-2.0.10.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,80 @@
1
+ import { reactive } from "vue"
2
+ import { useThreadStore } from "./threadStore.mjs"
3
+
4
+ const base = ''
5
+ const headers = { 'Accept': 'application/json' }
6
+ const prefsKey = 'llms.prefs'
7
+
8
+ export const o = {
9
+ base,
10
+ prefsKey,
11
+ welcome: 'Welcome to llms.py',
12
+ auth: null,
13
+ requiresAuth: false,
14
+ headers,
15
+
16
+ resolveUrl(url){
17
+ return url.startsWith('http') || url.startsWith('/v1') ? url : base + url
18
+ },
19
+ get(url, options) {
20
+ return fetch(this.resolveUrl(url), {
21
+ ...options,
22
+ headers: Object.assign({}, this.headers, options?.headers),
23
+ })
24
+ },
25
+ post(url, options) {
26
+ return fetch(this.resolveUrl(url), {
27
+ method: 'POST',
28
+ ...options,
29
+ headers: Object.assign({'Content-Type': 'application/json'}, this.headers, options?.headers),
30
+ })
31
+ },
32
+
33
+ async getConfig() {
34
+ return this.get('/config')
35
+ },
36
+ async getModels() {
37
+ return this.get('/models')
38
+ },
39
+ async getAuth() {
40
+ return this.requiresAuth
41
+ ? this.get('/auth')
42
+ : new Promise(resolve => resolve({ json: () => ({ responseStatus: { errorCode: '!requiresAuth' } })}))
43
+ },
44
+ get isAdmin() {
45
+ return !this.requiresAuth || this.auth && this.auth.roles?.includes('Admin')
46
+ },
47
+
48
+ signIn(auth) {
49
+ this.auth = auth
50
+ if (auth?.apiKey) {
51
+ this.headers.Authorization = `Bearer ${auth.apiKey}`
52
+ } else if (this.headers.Authorization) {
53
+ delete this.headers.Authorization
54
+ }
55
+ },
56
+ async init() {
57
+ // Load models and prompts
58
+ const { initDB } = useThreadStore()
59
+ const [_, configRes, modelsRes, authRes] = await Promise.all([
60
+ initDB(),
61
+ this.getConfig(),
62
+ this.getModels(),
63
+ this.getAuth(),
64
+ ])
65
+ const config = await configRes.json()
66
+ const models = await modelsRes.json()
67
+ const auth = this.requiresAuth
68
+ ? await authRes.json()
69
+ : null
70
+ if (auth?.responseStatus?.errorCode) {
71
+ console.error(auth.responseStatus.errorCode, auth.responseStatus.message)
72
+ } else {
73
+ this.signIn(auth)
74
+ }
75
+ return { config, models, auth }
76
+ }
77
+ }
78
+
79
+ let ai = reactive(o)
80
+ export default ai
@@ -76,7 +76,6 @@
76
76
  --color-purple-800: oklch(43.8% 0.218 303.724);
77
77
  --color-slate-50: oklch(98.4% 0.003 247.858);
78
78
  --color-slate-200: oklch(92.9% 0.013 255.508);
79
- --color-slate-300: oklch(86.9% 0.022 252.894);
80
79
  --color-slate-400: oklch(70.4% 0.04 256.788);
81
80
  --color-slate-500: oklch(55.4% 0.046 257.417);
82
81
  --color-slate-700: oklch(37.2% 0.044 257.287);
@@ -354,6 +353,9 @@
354
353
  .z-20 {
355
354
  z-index: 20;
356
355
  }
356
+ .z-50 {
357
+ z-index: 50;
358
+ }
357
359
  .col-span-3 {
358
360
  grid-column: span 3 / span 3;
359
361
  }
@@ -405,9 +407,15 @@
405
407
  .-mt-8 {
406
408
  margin-top: calc(var(--spacing) * -8);
407
409
  }
410
+ .-mt-12 {
411
+ margin-top: calc(var(--spacing) * -12);
412
+ }
408
413
  .mt-1 {
409
414
  margin-top: calc(var(--spacing) * 1);
410
415
  }
416
+ .mt-1\.5 {
417
+ margin-top: calc(var(--spacing) * 1.5);
418
+ }
411
419
  .mt-2 {
412
420
  margin-top: calc(var(--spacing) * 2);
413
421
  }
@@ -545,15 +553,15 @@
545
553
  .h-8 {
546
554
  height: calc(var(--spacing) * 8);
547
555
  }
548
- .h-10 {
549
- height: calc(var(--spacing) * 10);
550
- }
551
556
  .h-12 {
552
557
  height: calc(var(--spacing) * 12);
553
558
  }
554
559
  .h-16 {
555
560
  height: calc(var(--spacing) * 16);
556
561
  }
562
+ .h-\[37px\] {
563
+ height: 37px;
564
+ }
557
565
  .h-full {
558
566
  height: 100%;
559
567
  }
@@ -569,8 +577,14 @@
569
577
  .max-h-80 {
570
578
  max-height: calc(var(--spacing) * 80);
571
579
  }
572
- .max-h-112 {
573
- max-height: calc(var(--spacing) * 112);
580
+ .max-h-120 {
581
+ max-height: calc(var(--spacing) * 120);
582
+ }
583
+ .max-h-\[90vh\] {
584
+ max-height: 90vh;
585
+ }
586
+ .max-h-\[calc\(90vh-140px\)\] {
587
+ max-height: calc(90vh - 140px);
574
588
  }
575
589
  .min-h-0 {
576
590
  min-height: calc(var(--spacing) * 0);
@@ -581,6 +595,9 @@
581
595
  .min-h-full {
582
596
  min-height: 100%;
583
597
  }
598
+ .min-h-screen {
599
+ min-height: 100vh;
600
+ }
584
601
  .w-2 {
585
602
  width: calc(var(--spacing) * 2);
586
603
  }
@@ -743,6 +760,9 @@
743
760
  .appearance-none {
744
761
  appearance: none;
745
762
  }
763
+ .grid-cols-1 {
764
+ grid-template-columns: repeat(1, minmax(0, 1fr));
765
+ }
746
766
  .grid-cols-3 {
747
767
  grid-template-columns: repeat(3, minmax(0, 1fr));
748
768
  }
@@ -782,6 +802,9 @@
782
802
  .gap-3 {
783
803
  gap: calc(var(--spacing) * 3);
784
804
  }
805
+ .gap-4 {
806
+ gap: calc(var(--spacing) * 4);
807
+ }
785
808
  .gap-6 {
786
809
  gap: calc(var(--spacing) * 6);
787
810
  }
@@ -994,6 +1017,12 @@
994
1017
  .border-yellow-400 {
995
1018
  border-color: var(--color-yellow-400);
996
1019
  }
1020
+ .bg-black\/40 {
1021
+ background-color: color-mix(in srgb, #000 40%, transparent);
1022
+ @supports (color: color-mix(in lab, red, red)) {
1023
+ background-color: color-mix(in oklab, var(--color-black) 40%, transparent);
1024
+ }
1025
+ }
997
1026
  .bg-blue-50 {
998
1027
  background-color: var(--color-blue-50);
999
1028
  }
@@ -1165,6 +1194,9 @@
1165
1194
  .pt-2 {
1166
1195
  padding-top: calc(var(--spacing) * 2);
1167
1196
  }
1197
+ .pt-3 {
1198
+ padding-top: calc(var(--spacing) * 3);
1199
+ }
1168
1200
  .pt-4 {
1169
1201
  padding-top: calc(var(--spacing) * 4);
1170
1202
  }
@@ -1474,6 +1506,10 @@
1474
1506
  .opacity-100 {
1475
1507
  opacity: 100%;
1476
1508
  }
1509
+ .\!shadow-none {
1510
+ --tw-shadow: 0 0 #0000 !important;
1511
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;
1512
+ }
1477
1513
  .shadow {
1478
1514
  --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
1479
1515
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
@@ -1924,6 +1960,13 @@
1924
1960
  }
1925
1961
  }
1926
1962
  }
1963
+ .hover\:text-gray-600 {
1964
+ &:hover {
1965
+ @media (hover: hover) {
1966
+ color: var(--color-gray-600);
1967
+ }
1968
+ }
1969
+ }
1927
1970
  .hover\:text-gray-700 {
1928
1971
  &:hover {
1929
1972
  @media (hover: hover) {
@@ -2513,6 +2556,11 @@
2513
2556
  max-width: var(--container-xl);
2514
2557
  }
2515
2558
  }
2559
+ .md\:grid-cols-2 {
2560
+ @media (width >= 48rem) {
2561
+ grid-template-columns: repeat(2, minmax(0, 1fr));
2562
+ }
2563
+ }
2516
2564
  .md\:rounded-lg {
2517
2565
  @media (width >= 48rem) {
2518
2566
  border-radius: var(--radius-lg);
@@ -3472,6 +3520,9 @@
3472
3520
  padding: 0.5rem 0.75rem;
3473
3521
  font-size: 1rem;
3474
3522
  }
3523
+ .dark [type='text'],.dark [type='email'],.dark [type='url'],.dark [type='password'],.dark [type='number'],.dark [type='date'],.dark [type='datetime-local'],.dark [type='month'],.dark [type='week'],.dark [type='search'],.dark [type='tel'],.dark [type='time'],.dark [type='color'],.dark [multiple],.dark textarea,.dark select {
3524
+ background-color: var(--color-gray-800);
3525
+ }
3475
3526
  [type='text']:focus,[type='email']:focus,[type='url']:focus,[type='password']:focus,[type='number']:focus,[type='date']:focus,[type='datetime-local']:focus,[type='month']:focus,[type='week']:focus,[type='search']:focus,[type='tel']:focus,[type='time']:focus,[type='color']:focus,[multiple]:focus,textarea:focus,select:focus {
3476
3527
  outline: 2px solid transparent;
3477
3528
  outline-offset: 2px;
@@ -3514,7 +3565,7 @@
3514
3565
  -webkit-print-color-adjust: unset;
3515
3566
  color-adjust: unset;
3516
3567
  }
3517
- [type='radio'] {
3568
+ [type='checkbox'],[type='radio'] {
3518
3569
  -webkit-appearance: none;
3519
3570
  -moz-appearance: none;
3520
3571
  appearance: none;
@@ -3538,7 +3589,7 @@
3538
3589
  [type='radio'] {
3539
3590
  border-radius: 100%;
3540
3591
  }
3541
- [type='radio']:focus {
3592
+ [type='checkbox']:focus,[type='radio']:focus {
3542
3593
  outline: 2px solid transparent;
3543
3594
  outline-offset: 2px;
3544
3595
  --tw-ring-inset: var(--tw-empty,/*!*/ /*!*/);
@@ -3549,17 +3600,32 @@
3549
3600
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
3550
3601
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
3551
3602
  }
3552
- [type='radio']:checked {
3603
+ [type='checkbox']:checked,[type='radio']:checked {
3553
3604
  border-color: transparent;
3554
3605
  background-color: currentColor;
3555
3606
  background-size: 100% 100%;
3556
3607
  background-position: center;
3557
3608
  background-repeat: no-repeat;
3558
3609
  }
3610
+ [type='checkbox']:checked {
3611
+ background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
3612
+ }
3559
3613
  [type='radio']:checked {
3560
3614
  background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e");
3561
3615
  }
3562
- [type='radio']:checked:hover,[type='radio']:checked:focus {
3616
+ [type='checkbox']:checked:hover,[type='checkbox']:checked:focus,[type='radio']:checked:hover,[type='radio']:checked:focus {
3617
+ border-color: transparent;
3618
+ background-color: currentColor;
3619
+ }
3620
+ [type='checkbox']:indeterminate {
3621
+ background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3e%3c/svg%3e");
3622
+ border-color: transparent;
3623
+ background-color: currentColor;
3624
+ background-size: 100% 100%;
3625
+ background-position: center;
3626
+ background-repeat: no-repeat;
3627
+ }
3628
+ [type='checkbox']:indeterminate:hover,[type='checkbox']:indeterminate:focus {
3563
3629
  border-color: transparent;
3564
3630
  background-color: currentColor;
3565
3631
  }