langchainrb 0.6.7 → 0.6.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.tool-versions +1 -0
- data/Gemfile.lock +1 -1
- data/lib/langchain/llm/google_palm.rb +2 -2
- data/lib/langchain/llm/openai.rb +5 -2
- data/lib/langchain/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8446cff4207c4784ce29233712430d50c2cbaa551cfe8ad27f413f27ad8346b
|
4
|
+
data.tar.gz: 8c7105302b673479be9a840ed1a19c815cf5a0415195db5373ce739c472dc2f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7bd52c8d161a2d26a1e717711053267ed3b78def7efa2e9411017d324e278baceb1d88eb709cb701986201b785e1ad8ee455948b1bba59d6cb478226b1b5df4
|
7
|
+
data.tar.gz: eeb639084a8990e1d36d035e6cd6d725377cecc61b3116f70254787f5d591a387c6f53e308dd482d2a96257f231866cffdf6326c516dcf78e60017817d8ebb93
|
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 3.1.2
|
data/Gemfile.lock
CHANGED
@@ -155,8 +155,8 @@ module Langchain::LLM
|
|
155
155
|
def transform_messages(messages)
|
156
156
|
messages.map do |message|
|
157
157
|
{
|
158
|
-
author: message[:role],
|
159
|
-
content: message[:content]
|
158
|
+
author: message[:role] || message["role"],
|
159
|
+
content: message[:content] || message["content"]
|
160
160
|
}
|
161
161
|
end
|
162
162
|
end
|
data/lib/langchain/llm/openai.rb
CHANGED
@@ -189,9 +189,12 @@ module Langchain::LLM
|
|
189
189
|
|
190
190
|
def transform_messages(messages)
|
191
191
|
messages.map do |message|
|
192
|
+
role = message[:role] || message["role"]
|
193
|
+
content = message[:content] || message["content"]
|
194
|
+
|
192
195
|
{
|
193
|
-
content:
|
194
|
-
role: (
|
196
|
+
content: content,
|
197
|
+
role: (role == "ai") ? "assistant" : role
|
195
198
|
}
|
196
199
|
end
|
197
200
|
end
|
data/lib/langchain/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: langchainrb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrei Bondarev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-07-
|
11
|
+
date: 2023-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: baran
|
@@ -482,6 +482,7 @@ files:
|
|
482
482
|
- ".env.example"
|
483
483
|
- ".rspec"
|
484
484
|
- ".rubocop.yml"
|
485
|
+
- ".tool-versions"
|
485
486
|
- CHANGELOG.md
|
486
487
|
- Gemfile
|
487
488
|
- Gemfile.lock
|