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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e8dc16375bc94045a728b37d6d388a8670699c35af4213bc4d16163fbb0047c
4
- data.tar.gz: c9695ac8ce5d6bf351afd3148d281a26733f37a43674fae71c3c81c7530cdc2e
3
+ metadata.gz: e8446cff4207c4784ce29233712430d50c2cbaa551cfe8ad27f413f27ad8346b
4
+ data.tar.gz: 8c7105302b673479be9a840ed1a19c815cf5a0415195db5373ce739c472dc2f3
5
5
  SHA512:
6
- metadata.gz: 67a532ea9c46961a8636f1332590876f8d5d26e67384789c9a4ab7907c4a2150240a7c9d63ae188d19a269e345ff0dfafcf24ab1cb4a987e4eab5cc2439bbf06
7
- data.tar.gz: 333888fdd41e2ce21b369fc0844ca3b181f2db603833bf8cbf8a46e59b8049dcb31a216fb4adcb12fe5a69dc33ec21725131e6e8ce8e7e7633814f5dc7c51c7b
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- langchainrb (0.6.7)
4
+ langchainrb (0.6.8)
5
5
  baran (~> 0.1.6)
6
6
  colorize (~> 0.8.1)
7
7
  json-schema (~> 4.0.0)
@@ -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
@@ -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: message[:content],
194
- role: (message[:role] == "ai") ? "assistant" : message[:role]
196
+ content: content,
197
+ role: (role == "ai") ? "assistant" : role
195
198
  }
196
199
  end
197
200
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Langchain
4
- VERSION = "0.6.7"
4
+ VERSION = "0.6.8"
5
5
  end
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.7
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-20 00:00:00.000000000 Z
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