llms-py 3.0.1__py3-none-any.whl → 3.0.3__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.
- llms/{extensions/app/db_manager.py → db.py} +180 -16
- llms/extensions/app/__init__.py +96 -29
- llms/extensions/app/db.py +16 -124
- llms/extensions/app/ui/threadStore.mjs +23 -2
- llms/extensions/core_tools/__init__.py +37 -0
- llms/extensions/gallery/__init__.py +15 -13
- llms/extensions/gallery/db.py +117 -172
- llms/extensions/gallery/ui/index.mjs +1 -1
- llms/extensions/providers/__init__.py +3 -1
- llms/extensions/providers/anthropic.py +7 -3
- llms/extensions/providers/cerebras.py +37 -0
- llms/extensions/providers/chutes.py +1 -1
- llms/extensions/providers/google.py +131 -28
- llms/extensions/providers/nvidia.py +2 -2
- llms/extensions/providers/openai.py +2 -2
- llms/extensions/providers/openrouter.py +4 -2
- llms/llms.json +3 -0
- llms/main.py +83 -34
- llms/providers.json +1 -1
- llms/ui/ai.mjs +1 -1
- llms/ui/app.css +106 -3
- llms/ui/ctx.mjs +34 -0
- llms/ui/index.mjs +2 -0
- llms/ui/modules/chat/ChatBody.mjs +245 -248
- llms/ui/modules/chat/index.mjs +93 -2
- llms/ui/modules/icons.mjs +46 -0
- llms/ui/modules/layout.mjs +28 -0
- llms/ui/modules/model-selector.mjs +0 -40
- llms/ui/tailwind.input.css +1 -1
- llms/ui/utils.mjs +9 -1
- {llms_py-3.0.1.dist-info → llms_py-3.0.3.dist-info}/METADATA +1 -1
- {llms_py-3.0.1.dist-info → llms_py-3.0.3.dist-info}/RECORD +36 -34
- {llms_py-3.0.1.dist-info → llms_py-3.0.3.dist-info}/WHEEL +0 -0
- {llms_py-3.0.1.dist-info → llms_py-3.0.3.dist-info}/entry_points.txt +0 -0
- {llms_py-3.0.1.dist-info → llms_py-3.0.3.dist-info}/licenses/LICENSE +0 -0
- {llms_py-3.0.1.dist-info → llms_py-3.0.3.dist-info}/top_level.txt +0 -0
llms/ui/ai.mjs
CHANGED
llms/ui/app.css
CHANGED
|
@@ -18,6 +18,12 @@
|
|
|
18
18
|
--color-red-700: oklch(50.5% 0.213 27.518);
|
|
19
19
|
--color-red-800: oklch(44.4% 0.177 26.899);
|
|
20
20
|
--color-red-900: oklch(39.6% 0.141 25.723);
|
|
21
|
+
--color-orange-100: oklch(95.4% 0.038 75.164);
|
|
22
|
+
--color-orange-200: oklch(90.1% 0.076 70.697);
|
|
23
|
+
--color-orange-400: oklch(75% 0.183 55.934);
|
|
24
|
+
--color-orange-600: oklch(64.6% 0.222 41.116);
|
|
25
|
+
--color-orange-800: oklch(47% 0.157 37.304);
|
|
26
|
+
--color-orange-900: oklch(40.8% 0.123 38.172);
|
|
21
27
|
--color-yellow-50: oklch(98.7% 0.026 102.212);
|
|
22
28
|
--color-yellow-100: oklch(97.3% 0.071 103.193);
|
|
23
29
|
--color-yellow-200: oklch(94.5% 0.129 101.54);
|
|
@@ -26,6 +32,8 @@
|
|
|
26
32
|
--color-yellow-500: oklch(79.5% 0.184 86.047);
|
|
27
33
|
--color-yellow-600: oklch(68.1% 0.162 75.834);
|
|
28
34
|
--color-yellow-700: oklch(55.4% 0.135 66.442);
|
|
35
|
+
--color-yellow-800: oklch(47.6% 0.114 61.907);
|
|
36
|
+
--color-yellow-900: oklch(42.1% 0.095 57.708);
|
|
29
37
|
--color-green-50: oklch(98.2% 0.018 155.826);
|
|
30
38
|
--color-green-100: oklch(96.2% 0.044 156.743);
|
|
31
39
|
--color-green-200: oklch(92.5% 0.084 155.995);
|
|
@@ -125,6 +133,7 @@
|
|
|
125
133
|
--container-2xl: 42rem;
|
|
126
134
|
--container-3xl: 48rem;
|
|
127
135
|
--container-4xl: 56rem;
|
|
136
|
+
--container-5xl: 64rem;
|
|
128
137
|
--container-6xl: 72rem;
|
|
129
138
|
--container-7xl: 80rem;
|
|
130
139
|
--text-xs: 0.75rem;
|
|
@@ -345,9 +354,6 @@
|
|
|
345
354
|
.pointer-events-none {
|
|
346
355
|
pointer-events: none;
|
|
347
356
|
}
|
|
348
|
-
.collapse {
|
|
349
|
-
visibility: collapse;
|
|
350
|
-
}
|
|
351
357
|
.invisible {
|
|
352
358
|
visibility: hidden;
|
|
353
359
|
}
|
|
@@ -515,6 +521,9 @@
|
|
|
515
521
|
.-m-2\.5 {
|
|
516
522
|
margin: calc(var(--spacing) * -2.5);
|
|
517
523
|
}
|
|
524
|
+
.m-2 {
|
|
525
|
+
margin: calc(var(--spacing) * 2);
|
|
526
|
+
}
|
|
518
527
|
.-mx-1 {
|
|
519
528
|
margin-inline: calc(var(--spacing) * -1);
|
|
520
529
|
}
|
|
@@ -730,6 +739,10 @@
|
|
|
730
739
|
width: calc(var(--spacing) * 8);
|
|
731
740
|
height: calc(var(--spacing) * 8);
|
|
732
741
|
}
|
|
742
|
+
.size-10 {
|
|
743
|
+
width: calc(var(--spacing) * 10);
|
|
744
|
+
height: calc(var(--spacing) * 10);
|
|
745
|
+
}
|
|
733
746
|
.size-20 {
|
|
734
747
|
width: calc(var(--spacing) * 20);
|
|
735
748
|
height: calc(var(--spacing) * 20);
|
|
@@ -905,6 +918,9 @@
|
|
|
905
918
|
.max-w-4xl {
|
|
906
919
|
max-width: var(--container-4xl);
|
|
907
920
|
}
|
|
921
|
+
.max-w-5xl {
|
|
922
|
+
max-width: var(--container-5xl);
|
|
923
|
+
}
|
|
908
924
|
.max-w-6xl {
|
|
909
925
|
max-width: var(--container-6xl);
|
|
910
926
|
}
|
|
@@ -1093,6 +1109,9 @@
|
|
|
1093
1109
|
.cursor-default {
|
|
1094
1110
|
cursor: default;
|
|
1095
1111
|
}
|
|
1112
|
+
.cursor-help {
|
|
1113
|
+
cursor: help;
|
|
1114
|
+
}
|
|
1096
1115
|
.cursor-not-allowed {
|
|
1097
1116
|
cursor: not-allowed;
|
|
1098
1117
|
}
|
|
@@ -1658,6 +1677,9 @@
|
|
|
1658
1677
|
.bg-indigo-700 {
|
|
1659
1678
|
background-color: var(--color-indigo-700);
|
|
1660
1679
|
}
|
|
1680
|
+
.bg-orange-100 {
|
|
1681
|
+
background-color: var(--color-orange-100);
|
|
1682
|
+
}
|
|
1661
1683
|
.bg-purple-100 {
|
|
1662
1684
|
background-color: var(--color-purple-100);
|
|
1663
1685
|
}
|
|
@@ -1889,6 +1911,9 @@
|
|
|
1889
1911
|
.p-6 {
|
|
1890
1912
|
padding: calc(var(--spacing) * 6);
|
|
1891
1913
|
}
|
|
1914
|
+
.p-8 {
|
|
1915
|
+
padding: calc(var(--spacing) * 8);
|
|
1916
|
+
}
|
|
1892
1917
|
.px-1 {
|
|
1893
1918
|
padding-inline: calc(var(--spacing) * 1);
|
|
1894
1919
|
}
|
|
@@ -2042,6 +2067,9 @@
|
|
|
2042
2067
|
.pl-5 {
|
|
2043
2068
|
padding-left: calc(var(--spacing) * 5);
|
|
2044
2069
|
}
|
|
2070
|
+
.pl-9 {
|
|
2071
|
+
padding-left: calc(var(--spacing) * 9);
|
|
2072
|
+
}
|
|
2045
2073
|
.pl-10 {
|
|
2046
2074
|
padding-left: calc(var(--spacing) * 10);
|
|
2047
2075
|
}
|
|
@@ -2294,6 +2322,12 @@
|
|
|
2294
2322
|
.text-indigo-700 {
|
|
2295
2323
|
color: var(--color-indigo-700);
|
|
2296
2324
|
}
|
|
2325
|
+
.text-orange-600 {
|
|
2326
|
+
color: var(--color-orange-600);
|
|
2327
|
+
}
|
|
2328
|
+
.text-orange-800 {
|
|
2329
|
+
color: var(--color-orange-800);
|
|
2330
|
+
}
|
|
2297
2331
|
.text-purple-600 {
|
|
2298
2332
|
color: var(--color-purple-600);
|
|
2299
2333
|
}
|
|
@@ -2690,6 +2724,10 @@
|
|
|
2690
2724
|
--tw-duration: 100ms;
|
|
2691
2725
|
transition-duration: 100ms;
|
|
2692
2726
|
}
|
|
2727
|
+
.duration-150 {
|
|
2728
|
+
--tw-duration: 150ms;
|
|
2729
|
+
transition-duration: 150ms;
|
|
2730
|
+
}
|
|
2693
2731
|
.duration-200 {
|
|
2694
2732
|
--tw-duration: 200ms;
|
|
2695
2733
|
transition-duration: 200ms;
|
|
@@ -2776,6 +2814,13 @@
|
|
|
2776
2814
|
}
|
|
2777
2815
|
}
|
|
2778
2816
|
}
|
|
2817
|
+
.group-hover\:text-blue-600 {
|
|
2818
|
+
&:is(:where(.group):hover *) {
|
|
2819
|
+
@media (hover: hover) {
|
|
2820
|
+
color: var(--color-blue-600);
|
|
2821
|
+
}
|
|
2822
|
+
}
|
|
2823
|
+
}
|
|
2779
2824
|
.group-hover\:text-gray-400 {
|
|
2780
2825
|
&:is(:where(.group):hover *) {
|
|
2781
2826
|
@media (hover: hover) {
|
|
@@ -3061,6 +3106,13 @@
|
|
|
3061
3106
|
}
|
|
3062
3107
|
}
|
|
3063
3108
|
}
|
|
3109
|
+
.hover\:border-blue-400 {
|
|
3110
|
+
&:hover {
|
|
3111
|
+
@media (hover: hover) {
|
|
3112
|
+
border-color: var(--color-blue-400);
|
|
3113
|
+
}
|
|
3114
|
+
}
|
|
3115
|
+
}
|
|
3064
3116
|
.hover\:border-blue-400\/50 {
|
|
3065
3117
|
&:hover {
|
|
3066
3118
|
@media (hover: hover) {
|
|
@@ -3588,6 +3640,13 @@
|
|
|
3588
3640
|
color: var(--color-white);
|
|
3589
3641
|
}
|
|
3590
3642
|
}
|
|
3643
|
+
.focus\:placeholder-gray-400 {
|
|
3644
|
+
&:focus {
|
|
3645
|
+
&::placeholder {
|
|
3646
|
+
color: var(--color-gray-400);
|
|
3647
|
+
}
|
|
3648
|
+
}
|
|
3649
|
+
}
|
|
3591
3650
|
.focus\:ring-0 {
|
|
3592
3651
|
&:focus {
|
|
3593
3652
|
--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color, hsl(var(--ring)));
|
|
@@ -3980,6 +4039,11 @@
|
|
|
3980
4039
|
align-items: center;
|
|
3981
4040
|
}
|
|
3982
4041
|
}
|
|
4042
|
+
.sm\:justify-between {
|
|
4043
|
+
@media (width >= 40rem) {
|
|
4044
|
+
justify-content: space-between;
|
|
4045
|
+
}
|
|
4046
|
+
}
|
|
3983
4047
|
.sm\:gap-2 {
|
|
3984
4048
|
@media (width >= 40rem) {
|
|
3985
4049
|
gap: calc(var(--spacing) * 2);
|
|
@@ -4305,6 +4369,11 @@
|
|
|
4305
4369
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
4306
4370
|
}
|
|
4307
4371
|
}
|
|
4372
|
+
.lg\:grid-cols-3 {
|
|
4373
|
+
@media (width >= 64rem) {
|
|
4374
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
4375
|
+
}
|
|
4376
|
+
}
|
|
4308
4377
|
.lg\:grid-cols-4 {
|
|
4309
4378
|
@media (width >= 64rem) {
|
|
4310
4379
|
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
@@ -4380,6 +4449,11 @@
|
|
|
4380
4449
|
max-width: var(--breakpoint-xl);
|
|
4381
4450
|
}
|
|
4382
4451
|
}
|
|
4452
|
+
.\32 xl\:grid-cols-4 {
|
|
4453
|
+
@media (width >= 96rem) {
|
|
4454
|
+
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
4455
|
+
}
|
|
4456
|
+
}
|
|
4383
4457
|
.\32 xl\:grid-cols-5 {
|
|
4384
4458
|
@media (width >= 96rem) {
|
|
4385
4459
|
grid-template-columns: repeat(5, minmax(0, 1fr));
|
|
@@ -4768,6 +4842,11 @@
|
|
|
4768
4842
|
background-color: var(--color-indigo-900);
|
|
4769
4843
|
}
|
|
4770
4844
|
}
|
|
4845
|
+
.dark\:bg-orange-900 {
|
|
4846
|
+
&:where(.dark, .dark *) {
|
|
4847
|
+
background-color: var(--color-orange-900);
|
|
4848
|
+
}
|
|
4849
|
+
}
|
|
4771
4850
|
.dark\:bg-purple-600 {
|
|
4772
4851
|
&:where(.dark, .dark *) {
|
|
4773
4852
|
background-color: var(--color-purple-600);
|
|
@@ -4868,6 +4947,11 @@
|
|
|
4868
4947
|
color: var(--color-black);
|
|
4869
4948
|
}
|
|
4870
4949
|
}
|
|
4950
|
+
.dark\:text-blue-200 {
|
|
4951
|
+
&:where(.dark, .dark *) {
|
|
4952
|
+
color: var(--color-blue-200);
|
|
4953
|
+
}
|
|
4954
|
+
}
|
|
4871
4955
|
.dark\:text-blue-300 {
|
|
4872
4956
|
&:where(.dark, .dark *) {
|
|
4873
4957
|
color: var(--color-blue-300);
|
|
@@ -4994,6 +5078,16 @@
|
|
|
4994
5078
|
color: var(--color-indigo-500);
|
|
4995
5079
|
}
|
|
4996
5080
|
}
|
|
5081
|
+
.dark\:text-orange-200 {
|
|
5082
|
+
&:where(.dark, .dark *) {
|
|
5083
|
+
color: var(--color-orange-200);
|
|
5084
|
+
}
|
|
5085
|
+
}
|
|
5086
|
+
.dark\:text-orange-400 {
|
|
5087
|
+
&:where(.dark, .dark *) {
|
|
5088
|
+
color: var(--color-orange-400);
|
|
5089
|
+
}
|
|
5090
|
+
}
|
|
4997
5091
|
.dark\:text-purple-300 {
|
|
4998
5092
|
&:where(.dark, .dark *) {
|
|
4999
5093
|
color: var(--color-purple-300);
|
|
@@ -5175,6 +5269,15 @@
|
|
|
5175
5269
|
}
|
|
5176
5270
|
}
|
|
5177
5271
|
}
|
|
5272
|
+
.dark\:hover\:border-blue-600 {
|
|
5273
|
+
&:where(.dark, .dark *) {
|
|
5274
|
+
&:hover {
|
|
5275
|
+
@media (hover: hover) {
|
|
5276
|
+
border-color: var(--color-blue-600);
|
|
5277
|
+
}
|
|
5278
|
+
}
|
|
5279
|
+
}
|
|
5280
|
+
}
|
|
5178
5281
|
.dark\:hover\:border-gray-600 {
|
|
5179
5282
|
&:where(.dark, .dark *) {
|
|
5180
5283
|
&:hover {
|
llms/ui/ctx.mjs
CHANGED
|
@@ -7,6 +7,7 @@ export class ExtensionScope {
|
|
|
7
7
|
constructor(ctx, id) {
|
|
8
8
|
/**@type {AppContext} */
|
|
9
9
|
this.ctx = ctx
|
|
10
|
+
this.router = ctx.router
|
|
10
11
|
this.id = id
|
|
11
12
|
this.baseUrl = `${ctx.ai.base}/ext/${this.id}`
|
|
12
13
|
this.storageKey = `llms.${this.id}`
|
|
@@ -29,6 +30,7 @@ export class ExtensionScope {
|
|
|
29
30
|
return this.ctx.ai.get(combinePaths(this.baseUrl, url), options)
|
|
30
31
|
}
|
|
31
32
|
delete(url, options) {
|
|
33
|
+
this.ctx.clearError()
|
|
32
34
|
return this.ctx.ai.get(combinePaths(this.baseUrl, url), {
|
|
33
35
|
...options,
|
|
34
36
|
method: 'DELETE'
|
|
@@ -38,41 +40,49 @@ export class ExtensionScope {
|
|
|
38
40
|
return this.ctx.ai.getJson(combinePaths(this.baseUrl, url), options)
|
|
39
41
|
}
|
|
40
42
|
async deleteJson(url, options) {
|
|
43
|
+
this.ctx.clearError()
|
|
41
44
|
return this.ctx.ai.getJson(combinePaths(this.baseUrl, url), {
|
|
42
45
|
...options,
|
|
43
46
|
method: 'DELETE'
|
|
44
47
|
})
|
|
45
48
|
}
|
|
46
49
|
post(url, options) {
|
|
50
|
+
this.ctx.clearError()
|
|
47
51
|
return this.ctx.ai.post(combinePaths(this.baseUrl, url), options)
|
|
48
52
|
}
|
|
49
53
|
put(url, options) {
|
|
54
|
+
this.ctx.clearError()
|
|
50
55
|
return this.ctx.ai.post(combinePaths(this.baseUrl, url), {
|
|
51
56
|
...options,
|
|
52
57
|
method: 'PUT'
|
|
53
58
|
})
|
|
54
59
|
}
|
|
55
60
|
patch(url, options) {
|
|
61
|
+
this.ctx.clearError()
|
|
56
62
|
return this.ctx.ai.post(combinePaths(this.baseUrl, url), {
|
|
57
63
|
...options,
|
|
58
64
|
method: 'PATCH'
|
|
59
65
|
})
|
|
60
66
|
}
|
|
61
67
|
async postForm(url, options) {
|
|
68
|
+
this.ctx.clearError()
|
|
62
69
|
return await this.ctx.ai.postForm(combinePaths(this.baseUrl, url), options)
|
|
63
70
|
}
|
|
64
71
|
async postJson(url, body) {
|
|
72
|
+
this.ctx.clearError()
|
|
65
73
|
return this.ctx.ai.postJson(combinePaths(this.baseUrl, url), {
|
|
66
74
|
body: body instanceof FormData ? body : JSON.stringify(body)
|
|
67
75
|
})
|
|
68
76
|
}
|
|
69
77
|
async putJson(url, body) {
|
|
78
|
+
this.ctx.clearError()
|
|
70
79
|
return this.ctx.ai.postJson(combinePaths(this.baseUrl, url), {
|
|
71
80
|
method: 'PUT',
|
|
72
81
|
body: body instanceof FormData ? body : JSON.stringify(body)
|
|
73
82
|
})
|
|
74
83
|
}
|
|
75
84
|
async patchJson(url, body) {
|
|
85
|
+
this.ctx.clearError()
|
|
76
86
|
return this.ctx.ai.postJson(combinePaths(this.baseUrl, url), {
|
|
77
87
|
method: 'PATCH',
|
|
78
88
|
body: body instanceof FormData ? body : JSON.stringify(body)
|
|
@@ -97,6 +107,22 @@ export class ExtensionScope {
|
|
|
97
107
|
toast(msg) {
|
|
98
108
|
this.ctx.toast(msg)
|
|
99
109
|
}
|
|
110
|
+
to(route) {
|
|
111
|
+
if (typeof route == 'string') {
|
|
112
|
+
route = route.startsWith(this.baseUrl)
|
|
113
|
+
? route
|
|
114
|
+
: combinePaths(this.baseUrl, route)
|
|
115
|
+
const path = { path: route }
|
|
116
|
+
console.log(`to/${this.id}`, path)
|
|
117
|
+
this.router.push(path)
|
|
118
|
+
} else {
|
|
119
|
+
route.path = route.path.startsWith(this.baseUrl)
|
|
120
|
+
? route.path
|
|
121
|
+
: combinePaths(this.baseUrl, route.path)
|
|
122
|
+
console.log(`to/${this.id}`, route)
|
|
123
|
+
this.router.push(route)
|
|
124
|
+
}
|
|
125
|
+
}
|
|
100
126
|
}
|
|
101
127
|
|
|
102
128
|
export class AppContext {
|
|
@@ -119,6 +145,8 @@ export class AppContext {
|
|
|
119
145
|
this.chatErrorFilters = []
|
|
120
146
|
this.createThreadFilters = []
|
|
121
147
|
this.updateThreadFilters = []
|
|
148
|
+
this.threadHeaderComponents = {}
|
|
149
|
+
this.threadFooterComponents = {}
|
|
122
150
|
this.top = {}
|
|
123
151
|
this.left = {}
|
|
124
152
|
this.layout = reactive(storageObject(`llms.layout`))
|
|
@@ -279,6 +307,12 @@ export class AppContext {
|
|
|
279
307
|
this.toggleLayout('left', toggle)
|
|
280
308
|
return toggle
|
|
281
309
|
}
|
|
310
|
+
setThreadHeaders(components) {
|
|
311
|
+
Object.assign(this.threadHeaderComponents, components)
|
|
312
|
+
}
|
|
313
|
+
setThreadFooters(components) {
|
|
314
|
+
Object.assign(this.threadFooterComponents, components)
|
|
315
|
+
}
|
|
282
316
|
|
|
283
317
|
createErrorStatus(status) {
|
|
284
318
|
return this.ai.createErrorStatus(status)
|
llms/ui/index.mjs
CHANGED
|
@@ -7,6 +7,7 @@ import ai from './ai.mjs'
|
|
|
7
7
|
import LayoutModule from './modules/layout.mjs'
|
|
8
8
|
import ChatModule from './modules/chat/index.mjs'
|
|
9
9
|
import ModelSelectorModule from './modules/model-selector.mjs'
|
|
10
|
+
import IconsModule from './modules/icons.mjs'
|
|
10
11
|
import { utilsFunctions, utilsFormatters } from './utils.mjs'
|
|
11
12
|
import { marked, markdownFormatters } from './markdown.mjs'
|
|
12
13
|
import { AppContext } from './ctx.mjs'
|
|
@@ -18,6 +19,7 @@ const BuiltInModules = {
|
|
|
18
19
|
LayoutModule,
|
|
19
20
|
ChatModule,
|
|
20
21
|
ModelSelectorModule,
|
|
22
|
+
IconsModule,
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
|