ruby_llm-agents 1.3.2 → 1.3.3
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 185514669cc03ca7601f244c9bc0a0db41c58515e0693480fc18d93ef2e2d028
|
|
4
|
+
data.tar.gz: f2319cb5e4020219b8f2ca6fc1ceed3fe738696a37c09ed4c98395cd450aabe6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 55744523240ada2af5ab892da799eb4c42abedf3b504aff16f9f30b1fbc54ca6f919aae62e115a58005975845e87b716ee3b6b620882d6b1ca973c39ce0a06a1
|
|
7
|
+
data.tar.gz: d5ef918e581f8b469dead7fe638bf4cdf14dea177f0e534af4aab62fbbe814295677117030eec72e81433a4025b02f34f6774bc56a6a55c0f5fdc87b0272a10e
|
|
@@ -213,7 +213,7 @@ module RubyLLM
|
|
|
213
213
|
batches = input_list.each_slice(batch_count).to_a
|
|
214
214
|
|
|
215
215
|
batches.each_with_index do |batch, index|
|
|
216
|
-
batch_result = execute_batch(batch)
|
|
216
|
+
batch_result = execute_batch(batch, context)
|
|
217
217
|
|
|
218
218
|
all_vectors.concat(batch_result[:vectors])
|
|
219
219
|
total_input_tokens += batch_result[:input_tokens] || 0
|
|
@@ -331,10 +331,10 @@ module RubyLLM
|
|
|
331
331
|
#
|
|
332
332
|
# @param texts [Array<String>] Texts to embed
|
|
333
333
|
# @return [Hash] Batch result with vectors, tokens, cost
|
|
334
|
-
def execute_batch(texts)
|
|
334
|
+
def execute_batch(texts, context = nil)
|
|
335
335
|
preprocessed = texts.map { |t| preprocess(t) }
|
|
336
336
|
|
|
337
|
-
embed_options = { model: resolved_model }
|
|
337
|
+
embed_options = { model: context&.model || resolved_model }
|
|
338
338
|
embed_options[:dimensions] = resolved_dimensions if resolved_dimensions
|
|
339
339
|
|
|
340
340
|
response = RubyLLM.embed(preprocessed, **embed_options)
|