liter_llm 1.4.0.pre.rc.29 → 1.4.0.pre.rc.30
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.
- checksums.yaml +4 -4
- data/ext/liter_llm_rb/native/Cargo.toml +1 -1
- data/lib/liter_llm/native.rb +42 -47
- data/lib/liter_llm/version.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ba671548820431facda5b6334c82fe19dab9875733db3040b4cb5a27f7edc700
|
|
4
|
+
data.tar.gz: 131746071425227c33e8fcc380582dc275e9a359fdbdc9bcec5e4fa70955dd06
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3fc11ad72115caa191faa1dd5190a946fd1f2ab0abcc61f68ea9c8622fff7e2fbd87dc683ca23ec2f98bf96d4e73e0abdc5d5d5fe8e1d47d23a4b93ca9cd4014
|
|
7
|
+
data.tar.gz: 17016f709cbc6f877fd6e97ed6f056763667983b375be881e37ffacb985a4c628788e7d04811dbed9faf91465b939c53ffae3407709374b9a1ad2c15f57d6773
|
data/lib/liter_llm/native.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# This file is auto-generated by alef — DO NOT EDIT.
|
|
2
|
-
# alef:hash:
|
|
2
|
+
# alef:hash:ea7df9806a13b721a1e6d4b6b72dd51b2c5b0fb97e42a2ffa64d7a8c73dd542d
|
|
3
3
|
# To regenerate: alef generate
|
|
4
4
|
# To verify freshness: alef verify --exit-code
|
|
5
5
|
# Issues & docs: https://github.com/kreuzberg-dev/alef
|
|
@@ -13,6 +13,7 @@ module LiterLlm
|
|
|
13
13
|
module Message
|
|
14
14
|
extend T::Helpers
|
|
15
15
|
extend T::Sig
|
|
16
|
+
|
|
16
17
|
interface!
|
|
17
18
|
|
|
18
19
|
# Dispatch from a Hash to the appropriate variant constructor.
|
|
@@ -20,18 +21,17 @@ module LiterLlm
|
|
|
20
21
|
# @return [variant_class] an instance of the appropriate variant
|
|
21
22
|
sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.untyped) }
|
|
22
23
|
def self.from_hash(hash)
|
|
23
|
-
discriminator = hash[:role] || hash[
|
|
24
|
+
discriminator = hash[:role] || hash['role']
|
|
24
25
|
case discriminator
|
|
25
|
-
when
|
|
26
|
-
when
|
|
27
|
-
when
|
|
28
|
-
when
|
|
29
|
-
when
|
|
30
|
-
when
|
|
26
|
+
when 'system' then MessageSystem.from_hash(hash)
|
|
27
|
+
when 'user' then MessageUser.from_hash(hash)
|
|
28
|
+
when 'assistant' then MessageAssistant.from_hash(hash)
|
|
29
|
+
when 'tool' then MessageTool.from_hash(hash)
|
|
30
|
+
when 'developer' then MessageDeveloper.from_hash(hash)
|
|
31
|
+
when 'function' then MessageFunction.from_hash(hash)
|
|
31
32
|
else raise "Unknown discriminator: #{discriminator}"
|
|
32
33
|
end
|
|
33
34
|
end
|
|
34
|
-
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
# Variant MessageSystem of the Message sum type.
|
|
@@ -65,7 +65,7 @@ module LiterLlm
|
|
|
65
65
|
# @return [self]
|
|
66
66
|
sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.attached_class) }
|
|
67
67
|
def self.from_hash(hash)
|
|
68
|
-
new(value: hash[:_0] || hash[
|
|
68
|
+
new(value: hash[:_0] || hash['_0'])
|
|
69
69
|
end
|
|
70
70
|
end
|
|
71
71
|
|
|
@@ -100,7 +100,7 @@ module LiterLlm
|
|
|
100
100
|
# @return [self]
|
|
101
101
|
sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.attached_class) }
|
|
102
102
|
def self.from_hash(hash)
|
|
103
|
-
new(value: hash[:_0] || hash[
|
|
103
|
+
new(value: hash[:_0] || hash['_0'])
|
|
104
104
|
end
|
|
105
105
|
end
|
|
106
106
|
|
|
@@ -135,7 +135,7 @@ module LiterLlm
|
|
|
135
135
|
# @return [self]
|
|
136
136
|
sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.attached_class) }
|
|
137
137
|
def self.from_hash(hash)
|
|
138
|
-
new(value: hash[:_0] || hash[
|
|
138
|
+
new(value: hash[:_0] || hash['_0'])
|
|
139
139
|
end
|
|
140
140
|
end
|
|
141
141
|
|
|
@@ -170,7 +170,7 @@ module LiterLlm
|
|
|
170
170
|
# @return [self]
|
|
171
171
|
sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.attached_class) }
|
|
172
172
|
def self.from_hash(hash)
|
|
173
|
-
new(value: hash[:_0] || hash[
|
|
173
|
+
new(value: hash[:_0] || hash['_0'])
|
|
174
174
|
end
|
|
175
175
|
end
|
|
176
176
|
|
|
@@ -205,7 +205,7 @@ module LiterLlm
|
|
|
205
205
|
# @return [self]
|
|
206
206
|
sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.attached_class) }
|
|
207
207
|
def self.from_hash(hash)
|
|
208
|
-
new(value: hash[:_0] || hash[
|
|
208
|
+
new(value: hash[:_0] || hash['_0'])
|
|
209
209
|
end
|
|
210
210
|
end
|
|
211
211
|
|
|
@@ -240,10 +240,9 @@ module LiterLlm
|
|
|
240
240
|
# @return [self]
|
|
241
241
|
sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.attached_class) }
|
|
242
242
|
def self.from_hash(hash)
|
|
243
|
-
new(value: hash[:_0] || hash[
|
|
243
|
+
new(value: hash[:_0] || hash['_0'])
|
|
244
244
|
end
|
|
245
245
|
end
|
|
246
|
-
|
|
247
246
|
end
|
|
248
247
|
|
|
249
248
|
module LiterLlm
|
|
@@ -251,6 +250,7 @@ module LiterLlm
|
|
|
251
250
|
module ContentPart
|
|
252
251
|
extend T::Helpers
|
|
253
252
|
extend T::Sig
|
|
253
|
+
|
|
254
254
|
interface!
|
|
255
255
|
|
|
256
256
|
# Dispatch from a Hash to the appropriate variant constructor.
|
|
@@ -258,16 +258,15 @@ module LiterLlm
|
|
|
258
258
|
# @return [variant_class] an instance of the appropriate variant
|
|
259
259
|
sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.untyped) }
|
|
260
260
|
def self.from_hash(hash)
|
|
261
|
-
discriminator = hash[:type] || hash[
|
|
261
|
+
discriminator = hash[:type] || hash['type']
|
|
262
262
|
case discriminator
|
|
263
|
-
when
|
|
264
|
-
when
|
|
265
|
-
when
|
|
266
|
-
when
|
|
263
|
+
when 'text' then ContentPartText.from_hash(hash)
|
|
264
|
+
when 'image_url' then ContentPartImageUrl.from_hash(hash)
|
|
265
|
+
when 'document' then ContentPartDocument.from_hash(hash)
|
|
266
|
+
when 'input_audio' then ContentPartInputAudio.from_hash(hash)
|
|
267
267
|
else raise "Unknown discriminator: #{discriminator}"
|
|
268
268
|
end
|
|
269
269
|
end
|
|
270
|
-
|
|
271
270
|
end
|
|
272
271
|
|
|
273
272
|
# Plain text.
|
|
@@ -295,7 +294,7 @@ module LiterLlm
|
|
|
295
294
|
# @return [self]
|
|
296
295
|
sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.attached_class) }
|
|
297
296
|
def self.from_hash(hash)
|
|
298
|
-
new(text: hash[:text] || hash[
|
|
297
|
+
new(text: hash[:text] || hash['text'])
|
|
299
298
|
end
|
|
300
299
|
end
|
|
301
300
|
|
|
@@ -324,7 +323,7 @@ module LiterLlm
|
|
|
324
323
|
# @return [self]
|
|
325
324
|
sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.attached_class) }
|
|
326
325
|
def self.from_hash(hash)
|
|
327
|
-
new(image_url: hash[:image_url] || hash[
|
|
326
|
+
new(image_url: hash[:image_url] || hash['image_url'])
|
|
328
327
|
end
|
|
329
328
|
end
|
|
330
329
|
|
|
@@ -353,7 +352,7 @@ module LiterLlm
|
|
|
353
352
|
# @return [self]
|
|
354
353
|
sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.attached_class) }
|
|
355
354
|
def self.from_hash(hash)
|
|
356
|
-
new(document: hash[:document] || hash[
|
|
355
|
+
new(document: hash[:document] || hash['document'])
|
|
357
356
|
end
|
|
358
357
|
end
|
|
359
358
|
|
|
@@ -382,10 +381,9 @@ module LiterLlm
|
|
|
382
381
|
# @return [self]
|
|
383
382
|
sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.attached_class) }
|
|
384
383
|
def self.from_hash(hash)
|
|
385
|
-
new(input_audio: hash[:input_audio] || hash[
|
|
384
|
+
new(input_audio: hash[:input_audio] || hash['input_audio'])
|
|
386
385
|
end
|
|
387
386
|
end
|
|
388
|
-
|
|
389
387
|
end
|
|
390
388
|
|
|
391
389
|
module LiterLlm
|
|
@@ -393,6 +391,7 @@ module LiterLlm
|
|
|
393
391
|
module ResponseFormat
|
|
394
392
|
extend T::Helpers
|
|
395
393
|
extend T::Sig
|
|
394
|
+
|
|
396
395
|
interface!
|
|
397
396
|
|
|
398
397
|
# Dispatch from a Hash to the appropriate variant constructor.
|
|
@@ -400,15 +399,14 @@ module LiterLlm
|
|
|
400
399
|
# @return [variant_class] an instance of the appropriate variant
|
|
401
400
|
sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.untyped) }
|
|
402
401
|
def self.from_hash(hash)
|
|
403
|
-
discriminator = hash[:type] || hash[
|
|
402
|
+
discriminator = hash[:type] || hash['type']
|
|
404
403
|
case discriminator
|
|
405
|
-
when
|
|
406
|
-
when
|
|
407
|
-
when
|
|
404
|
+
when 'text' then ResponseFormatText.from_hash(hash)
|
|
405
|
+
when 'json_object' then ResponseFormatJsonObject.from_hash(hash)
|
|
406
|
+
when 'json_schema' then ResponseFormatJsonSchema.from_hash(hash)
|
|
408
407
|
else raise "Unknown discriminator: #{discriminator}"
|
|
409
408
|
end
|
|
410
409
|
end
|
|
411
|
-
|
|
412
410
|
end
|
|
413
411
|
|
|
414
412
|
# Plain text output (default).
|
|
@@ -477,10 +475,9 @@ module LiterLlm
|
|
|
477
475
|
# @return [self]
|
|
478
476
|
sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.attached_class) }
|
|
479
477
|
def self.from_hash(hash)
|
|
480
|
-
new(json_schema: hash[:json_schema] || hash[
|
|
478
|
+
new(json_schema: hash[:json_schema] || hash['json_schema'])
|
|
481
479
|
end
|
|
482
480
|
end
|
|
483
|
-
|
|
484
481
|
end
|
|
485
482
|
|
|
486
483
|
module LiterLlm
|
|
@@ -488,6 +485,7 @@ module LiterLlm
|
|
|
488
485
|
module OcrDocument
|
|
489
486
|
extend T::Helpers
|
|
490
487
|
extend T::Sig
|
|
488
|
+
|
|
491
489
|
interface!
|
|
492
490
|
|
|
493
491
|
# Dispatch from a Hash to the appropriate variant constructor.
|
|
@@ -495,14 +493,13 @@ module LiterLlm
|
|
|
495
493
|
# @return [variant_class] an instance of the appropriate variant
|
|
496
494
|
sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.untyped) }
|
|
497
495
|
def self.from_hash(hash)
|
|
498
|
-
discriminator = hash[:type] || hash[
|
|
496
|
+
discriminator = hash[:type] || hash['type']
|
|
499
497
|
case discriminator
|
|
500
|
-
when
|
|
501
|
-
when
|
|
498
|
+
when 'document_url' then OcrDocumentUrl.from_hash(hash)
|
|
499
|
+
when 'base64' then OcrDocumentBase64.from_hash(hash)
|
|
502
500
|
else raise "Unknown discriminator: #{discriminator}"
|
|
503
501
|
end
|
|
504
502
|
end
|
|
505
|
-
|
|
506
503
|
end
|
|
507
504
|
|
|
508
505
|
# A publicly accessible document URL.
|
|
@@ -524,7 +521,7 @@ module LiterLlm
|
|
|
524
521
|
# @return [self]
|
|
525
522
|
sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.attached_class) }
|
|
526
523
|
def self.from_hash(hash)
|
|
527
|
-
new(url: hash[:url] || hash[
|
|
524
|
+
new(url: hash[:url] || hash['url'])
|
|
528
525
|
end
|
|
529
526
|
end
|
|
530
527
|
|
|
@@ -551,10 +548,9 @@ module LiterLlm
|
|
|
551
548
|
# @return [self]
|
|
552
549
|
sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.attached_class) }
|
|
553
550
|
def self.from_hash(hash)
|
|
554
|
-
new(data: hash[:data] || hash[
|
|
551
|
+
new(data: hash[:data] || hash['data'], media_type: hash[:media_type] || hash['media_type'])
|
|
555
552
|
end
|
|
556
553
|
end
|
|
557
|
-
|
|
558
554
|
end
|
|
559
555
|
|
|
560
556
|
module LiterLlm
|
|
@@ -562,6 +558,7 @@ module LiterLlm
|
|
|
562
558
|
module CacheBackend
|
|
563
559
|
extend T::Helpers
|
|
564
560
|
extend T::Sig
|
|
561
|
+
|
|
565
562
|
interface!
|
|
566
563
|
|
|
567
564
|
# Dispatch from a Hash to the appropriate variant constructor.
|
|
@@ -569,14 +566,13 @@ module LiterLlm
|
|
|
569
566
|
# @return [variant_class] an instance of the appropriate variant
|
|
570
567
|
sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.untyped) }
|
|
571
568
|
def self.from_hash(hash)
|
|
572
|
-
discriminator = hash[:type] || hash[
|
|
569
|
+
discriminator = hash[:type] || hash['type']
|
|
573
570
|
case discriminator
|
|
574
|
-
when
|
|
575
|
-
when
|
|
571
|
+
when 'memory' then CacheBackendMemory.from_hash(hash)
|
|
572
|
+
when 'open_dal' then CacheBackendOpenDal.from_hash(hash)
|
|
576
573
|
else raise "Unknown discriminator: #{discriminator}"
|
|
577
574
|
end
|
|
578
575
|
end
|
|
579
|
-
|
|
580
576
|
end
|
|
581
577
|
|
|
582
578
|
# In-memory LRU cache (default). No external dependencies.
|
|
@@ -621,8 +617,7 @@ module LiterLlm
|
|
|
621
617
|
# @return [self]
|
|
622
618
|
sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.attached_class) }
|
|
623
619
|
def self.from_hash(hash)
|
|
624
|
-
new(scheme: hash[:scheme] || hash[
|
|
620
|
+
new(scheme: hash[:scheme] || hash['scheme'], config: hash[:config] || hash['config'])
|
|
625
621
|
end
|
|
626
622
|
end
|
|
627
|
-
|
|
628
623
|
end
|
data/lib/liter_llm/version.rb
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# This file is auto-generated by alef — DO NOT EDIT.
|
|
2
|
-
# alef:hash:
|
|
2
|
+
# alef:hash:c7b4202dcf3e5bb7f9700733c6955ccf97d38e3df9c1c4491fb53b5400e265f8
|
|
3
3
|
# To regenerate: alef generate
|
|
4
4
|
# To verify freshness: alef verify --exit-code
|
|
5
5
|
# Issues & docs: https://github.com/kreuzberg-dev/alef
|
|
6
6
|
# frozen_string_literal: true
|
|
7
7
|
|
|
8
8
|
module LiterLlm
|
|
9
|
-
VERSION = '1.4.0.pre.rc.
|
|
9
|
+
VERSION = '1.4.0.pre.rc.30'
|
|
10
10
|
end
|