llms-py 3.0.2__py3-none-any.whl → 3.0.4__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/main.py CHANGED
@@ -41,7 +41,7 @@ try:
41
41
  except ImportError:
42
42
  HAS_PIL = False
43
43
 
44
- VERSION = "3.0.2"
44
+ VERSION = "3.0.4"
45
45
  _ROOT = None
46
46
  DEBUG = os.getenv("DEBUG") == "1"
47
47
  MOCK = os.getenv("MOCK") == "1"
@@ -1288,6 +1288,8 @@ def to_error_message(e):
1288
1288
  # check if has 'message' attribute
1289
1289
  if hasattr(e, "message"):
1290
1290
  return e.message
1291
+ if hasattr(e, "status"):
1292
+ return str(e.status)
1291
1293
  return str(e)
1292
1294
 
1293
1295
 
llms/ui/ai.mjs CHANGED
@@ -6,7 +6,7 @@ const headers = { 'Accept': 'application/json' }
6
6
  const prefsKey = 'llms.prefs'
7
7
 
8
8
  export const o = {
9
- version: '3.0.2',
9
+ version: '3.0.4',
10
10
  base,
11
11
  prefsKey,
12
12
  welcome: 'Welcome to llms.py',
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);
@@ -348,6 +354,9 @@
348
354
  .pointer-events-none {
349
355
  pointer-events: none;
350
356
  }
357
+ .collapse {
358
+ visibility: collapse;
359
+ }
351
360
  .invisible {
352
361
  visibility: hidden;
353
362
  }
@@ -1103,6 +1112,9 @@
1103
1112
  .cursor-default {
1104
1113
  cursor: default;
1105
1114
  }
1115
+ .cursor-help {
1116
+ cursor: help;
1117
+ }
1106
1118
  .cursor-not-allowed {
1107
1119
  cursor: not-allowed;
1108
1120
  }
@@ -1668,6 +1680,9 @@
1668
1680
  .bg-indigo-700 {
1669
1681
  background-color: var(--color-indigo-700);
1670
1682
  }
1683
+ .bg-orange-100 {
1684
+ background-color: var(--color-orange-100);
1685
+ }
1671
1686
  .bg-purple-100 {
1672
1687
  background-color: var(--color-purple-100);
1673
1688
  }
@@ -1743,9 +1758,6 @@
1743
1758
  .bg-yellow-50 {
1744
1759
  background-color: var(--color-yellow-50);
1745
1760
  }
1746
- .bg-yellow-100 {
1747
- background-color: var(--color-yellow-100);
1748
- }
1749
1761
  .bg-yellow-400 {
1750
1762
  background-color: var(--color-yellow-400);
1751
1763
  }
@@ -2313,6 +2325,12 @@
2313
2325
  .text-indigo-700 {
2314
2326
  color: var(--color-indigo-700);
2315
2327
  }
2328
+ .text-orange-600 {
2329
+ color: var(--color-orange-600);
2330
+ }
2331
+ .text-orange-800 {
2332
+ color: var(--color-orange-800);
2333
+ }
2316
2334
  .text-purple-600 {
2317
2335
  color: var(--color-purple-600);
2318
2336
  }
@@ -2385,9 +2403,6 @@
2385
2403
  .text-yellow-700 {
2386
2404
  color: var(--color-yellow-700);
2387
2405
  }
2388
- .text-yellow-800 {
2389
- color: var(--color-yellow-800);
2390
- }
2391
2406
  .capitalize {
2392
2407
  text-transform: capitalize;
2393
2408
  }
@@ -2756,6 +2771,10 @@
2756
2771
  --tw-outline-style: none;
2757
2772
  outline-style: none;
2758
2773
  }
2774
+ .select-all {
2775
+ -webkit-user-select: all;
2776
+ user-select: all;
2777
+ }
2759
2778
  .select-none {
2760
2779
  -webkit-user-select: none;
2761
2780
  user-select: none;
@@ -4830,6 +4849,11 @@
4830
4849
  background-color: var(--color-indigo-900);
4831
4850
  }
4832
4851
  }
4852
+ .dark\:bg-orange-900 {
4853
+ &:where(.dark, .dark *) {
4854
+ background-color: var(--color-orange-900);
4855
+ }
4856
+ }
4833
4857
  .dark\:bg-purple-600 {
4834
4858
  &:where(.dark, .dark *) {
4835
4859
  background-color: var(--color-purple-600);
@@ -4920,23 +4944,11 @@
4920
4944
  background-color: var(--color-yellow-200);
4921
4945
  }
4922
4946
  }
4923
- .dark\:bg-yellow-900 {
4924
- &:where(.dark, .dark *) {
4925
- background-color: var(--color-yellow-900);
4926
- }
4927
- }
4928
4947
  .dark\:fill-gray-300 {
4929
4948
  &:where(.dark, .dark *) {
4930
4949
  fill: var(--color-gray-300);
4931
4950
  }
4932
4951
  }
4933
- .dark\:dark\:text-gray-200 {
4934
- &:where(.dark, .dark *) {
4935
- &:where(.dark, .dark *) {
4936
- color: var(--color-gray-200);
4937
- }
4938
- }
4939
- }
4940
4952
  .dark\:text-black {
4941
4953
  &:where(.dark, .dark *) {
4942
4954
  color: var(--color-black);
@@ -5073,6 +5085,16 @@
5073
5085
  color: var(--color-indigo-500);
5074
5086
  }
5075
5087
  }
5088
+ .dark\:text-orange-200 {
5089
+ &:where(.dark, .dark *) {
5090
+ color: var(--color-orange-200);
5091
+ }
5092
+ }
5093
+ .dark\:text-orange-400 {
5094
+ &:where(.dark, .dark *) {
5095
+ color: var(--color-orange-400);
5096
+ }
5097
+ }
5076
5098
  .dark\:text-purple-300 {
5077
5099
  &:where(.dark, .dark *) {
5078
5100
  color: var(--color-purple-300);
@@ -5118,11 +5140,6 @@
5118
5140
  color: var(--color-white);
5119
5141
  }
5120
5142
  }
5121
- .dark\:text-yellow-200 {
5122
- &:where(.dark, .dark *) {
5123
- color: var(--color-yellow-200);
5124
- }
5125
- }
5126
5143
  .dark\:placeholder-gray-400 {
5127
5144
  &:where(.dark, .dark *) {
5128
5145
  &::placeholder {
llms/ui/ctx.mjs CHANGED
@@ -30,6 +30,7 @@ export class ExtensionScope {
30
30
  return this.ctx.ai.get(combinePaths(this.baseUrl, url), options)
31
31
  }
32
32
  delete(url, options) {
33
+ this.ctx.clearError()
33
34
  return this.ctx.ai.get(combinePaths(this.baseUrl, url), {
34
35
  ...options,
35
36
  method: 'DELETE'
@@ -39,41 +40,49 @@ export class ExtensionScope {
39
40
  return this.ctx.ai.getJson(combinePaths(this.baseUrl, url), options)
40
41
  }
41
42
  async deleteJson(url, options) {
43
+ this.ctx.clearError()
42
44
  return this.ctx.ai.getJson(combinePaths(this.baseUrl, url), {
43
45
  ...options,
44
46
  method: 'DELETE'
45
47
  })
46
48
  }
47
49
  post(url, options) {
50
+ this.ctx.clearError()
48
51
  return this.ctx.ai.post(combinePaths(this.baseUrl, url), options)
49
52
  }
50
53
  put(url, options) {
54
+ this.ctx.clearError()
51
55
  return this.ctx.ai.post(combinePaths(this.baseUrl, url), {
52
56
  ...options,
53
57
  method: 'PUT'
54
58
  })
55
59
  }
56
60
  patch(url, options) {
61
+ this.ctx.clearError()
57
62
  return this.ctx.ai.post(combinePaths(this.baseUrl, url), {
58
63
  ...options,
59
64
  method: 'PATCH'
60
65
  })
61
66
  }
62
67
  async postForm(url, options) {
68
+ this.ctx.clearError()
63
69
  return await this.ctx.ai.postForm(combinePaths(this.baseUrl, url), options)
64
70
  }
65
71
  async postJson(url, body) {
72
+ this.ctx.clearError()
66
73
  return this.ctx.ai.postJson(combinePaths(this.baseUrl, url), {
67
74
  body: body instanceof FormData ? body : JSON.stringify(body)
68
75
  })
69
76
  }
70
77
  async putJson(url, body) {
78
+ this.ctx.clearError()
71
79
  return this.ctx.ai.postJson(combinePaths(this.baseUrl, url), {
72
80
  method: 'PUT',
73
81
  body: body instanceof FormData ? body : JSON.stringify(body)
74
82
  })
75
83
  }
76
84
  async patchJson(url, body) {
85
+ this.ctx.clearError()
77
86
  return this.ctx.ai.postJson(combinePaths(this.baseUrl, url), {
78
87
  method: 'PATCH',
79
88
  body: body instanceof FormData ? body : JSON.stringify(body)
@@ -136,6 +145,7 @@ export class AppContext {
136
145
  this.chatErrorFilters = []
137
146
  this.createThreadFilters = []
138
147
  this.updateThreadFilters = []
148
+ this.threadHeaderComponents = {}
139
149
  this.threadFooterComponents = {}
140
150
  this.top = {}
141
151
  this.left = {}
@@ -297,6 +307,9 @@ export class AppContext {
297
307
  this.toggleLayout('left', toggle)
298
308
  return toggle
299
309
  }
310
+ setThreadHeaders(components) {
311
+ Object.assign(this.threadHeaderComponents, components)
312
+ }
300
313
  setThreadFooters(components) {
301
314
  Object.assign(this.threadFooterComponents, components)
302
315
  }