liter_llm 2.1.0 → 2.1.1
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.lock +3 -3
- data/ext/liter_llm_rb/native/Cargo.toml +3 -3
- data/ext/liter_llm_rb/src/lib.rs +33 -2
- 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: 2fac5b39a78e7b0ba2fc6be32fdde5f79eb581385a6bf0ec4085faa5565f550f
|
|
4
|
+
data.tar.gz: 7abe061b587abd8a7f4f102793fbb44fa878e5b3596e13f09e65601a0ef30e41
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d3e83540844a170585517992d47e62efb42420039813609ed64916d15eef804c2ce7d64e6c3c80ec258d1e9e1c6e490a97309f1ad501fa9397829d61a91a4181
|
|
7
|
+
data.tar.gz: 3c4abef27ed348e45ad9634ba21bdef6f86f99195b08258497bd0d193608fcf68fa3fd3fc10b1d41da7db1c50e1d05c3b7e29f61c9e86e95a8d7c4371865ce02
|
|
@@ -1697,9 +1697,9 @@ checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae"
|
|
|
1697
1697
|
|
|
1698
1698
|
[[package]]
|
|
1699
1699
|
name = "liter-llm"
|
|
1700
|
-
version = "2.1.
|
|
1700
|
+
version = "2.1.1"
|
|
1701
1701
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1702
|
-
checksum = "
|
|
1702
|
+
checksum = "71e3d2ee6d906bd5bd018254d38737e0287f355d4e9706736128e63bc87009a1"
|
|
1703
1703
|
dependencies = [
|
|
1704
1704
|
"ahash",
|
|
1705
1705
|
"arc-swap",
|
|
@@ -1742,7 +1742,7 @@ dependencies = [
|
|
|
1742
1742
|
|
|
1743
1743
|
[[package]]
|
|
1744
1744
|
name = "liter-llm-rb"
|
|
1745
|
-
version = "2.1.
|
|
1745
|
+
version = "2.1.1"
|
|
1746
1746
|
dependencies = [
|
|
1747
1747
|
"futures",
|
|
1748
1748
|
"liter-llm",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# This file is auto-generated by alef — DO NOT EDIT.
|
|
2
|
-
# alef:hash:
|
|
2
|
+
# alef:hash:8ee1b6e150f8695841cbc61738b1d6c4711c9a9fe834562664a5bfb006ed704a
|
|
3
3
|
# To regenerate: alef generate
|
|
4
4
|
# To verify freshness: alef verify
|
|
5
5
|
|
|
6
6
|
[package]
|
|
7
7
|
name = "liter-llm-rb"
|
|
8
|
-
version = "2.1.
|
|
8
|
+
version = "2.1.1"
|
|
9
9
|
edition = "2024"
|
|
10
10
|
license = "MIT"
|
|
11
11
|
description = "Universal LLM API client with Rust-powered polyglot bindings."
|
|
@@ -31,7 +31,7 @@ wasm-http = ["liter-llm/wasm-http"]
|
|
|
31
31
|
|
|
32
32
|
[dependencies]
|
|
33
33
|
futures = "0.3"
|
|
34
|
-
liter-llm = { version = "2.1.
|
|
34
|
+
liter-llm = { version = "2.1.1", features = ["native-http", "full"] }
|
|
35
35
|
magnus = "0.9"
|
|
36
36
|
rb-sys = ">=0.9.130, <0.10"
|
|
37
37
|
serde = { version = "1", features = ["derive"] }
|
data/ext/liter_llm_rb/src/lib.rs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// This file is auto-generated by alef. DO NOT EDIT.
|
|
2
|
-
// alef:hash:
|
|
2
|
+
// alef:hash:b9959449e602c92504188e4992627401dc218754267986b232c4fb71d53a59c3
|
|
3
3
|
// Re-generate with: alef generate
|
|
4
4
|
#![allow(dead_code, unused_imports, unused_variables)]
|
|
5
5
|
#![allow(
|
|
@@ -13550,7 +13550,38 @@ pub enum ToolChoice {
|
|
|
13550
13550
|
|
|
13551
13551
|
impl magnus::TryConvert for ToolChoice {
|
|
13552
13552
|
fn try_convert(val: magnus::Value) -> Result<Self, magnus::Error> {
|
|
13553
|
-
|
|
13553
|
+
// The native class is the only unambiguous input for a discriminator-free enum, but it is
|
|
13554
|
+
// not the only legitimate one: serde's own Deserialize accepts every variant's wire form,
|
|
13555
|
+
// so a caller holding a decoded String or Hash must keep working. Take the wrapped instance
|
|
13556
|
+
// when there is one, otherwise fall through to the serde reader below.
|
|
13557
|
+
if let Ok(wrapped) = <&Self as magnus::TryConvert>::try_convert(val) {
|
|
13558
|
+
return Ok(wrapped.clone());
|
|
13559
|
+
} // For data enums with fields (e.g., PageAction), try to deserialize from JSON first.
|
|
13560
|
+
// For unit enums or when passed as a string, fall back to string-based conversion.
|
|
13561
|
+
let json_str: String = if let Ok(s) = <String as magnus::TryConvert>::try_convert(val) {
|
|
13562
|
+
s
|
|
13563
|
+
} else {
|
|
13564
|
+
val.funcall::<_, _, String>("to_json", ()).map_err(|e| {
|
|
13565
|
+
magnus::Error::new(
|
|
13566
|
+
unsafe { Ruby::get_unchecked() }.exception_type_error(),
|
|
13567
|
+
format!("no implicit conversion into ToolChoice: {}", e),
|
|
13568
|
+
)
|
|
13569
|
+
})?
|
|
13570
|
+
};
|
|
13571
|
+
// Try deserializing as JSON first (handles JSON strings like "\"markdown\"" or "{\"click\":{\"selector\":\"...\"}}\"")
|
|
13572
|
+
// For internally-tagged enums, a bare variant string is wrapped as {"<tag>": value}.
|
|
13573
|
+
// If that fails, try treating it as a plain string value and wrap in quotes
|
|
13574
|
+
// If both fail, try as Custom variant (for untagged enum support)
|
|
13575
|
+
serde_json::from_str(&json_str)
|
|
13576
|
+
.or_else(|_| serde_json::from_str(&format!("\"{json_str}\"")))
|
|
13577
|
+
.or_else(|_| {
|
|
13578
|
+
// Try as a JSON string for Custom variant (untagged enums accept any remaining value)
|
|
13579
|
+
match serde_json::to_value(&json_str) {
|
|
13580
|
+
Ok(val) => serde_json::from_value(val),
|
|
13581
|
+
Err(e) => Err(e),
|
|
13582
|
+
}
|
|
13583
|
+
})
|
|
13584
|
+
.map_err(|e| magnus::Error::new(unsafe { Ruby::get_unchecked() }.exception_type_error(), e.to_string()))
|
|
13554
13585
|
}
|
|
13555
13586
|
}
|
|
13556
13587
|
|
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:5bcf51fe4904f5876e8b2685e02d50a1d932faa82247d16cedafb3a57552930e
|
|
3
3
|
# To regenerate: alef generate
|
|
4
4
|
# To verify freshness: alef verify
|
|
5
5
|
# frozen_string_literal: true
|
|
6
6
|
|
|
7
7
|
module LiterLlm
|
|
8
8
|
## The version string for this package.
|
|
9
|
-
VERSION = "2.1.
|
|
9
|
+
VERSION = "2.1.1"
|
|
10
10
|
end
|