llm_chain 0.5.5 → 0.6.0
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/CHANGELOG.md +48 -2
- data/README.md +104 -14
- data/examples/composite_agent_example.rb +121 -0
- data/examples/planner_agent_example.rb +103 -0
- data/examples/quick_demo.rb +0 -6
- data/examples/react_agent_example.rb +64 -0
- data/examples/tools_example.rb +1 -163
- data/lib/llm_chain/agents/agent_factory.rb +120 -0
- data/lib/llm_chain/agents/composite_agent.rb +341 -0
- data/lib/llm_chain/agents/planner_agent.rb +108 -0
- data/lib/llm_chain/agents/react_agent.rb +307 -0
- data/lib/llm_chain/agents.rb +19 -0
- data/lib/llm_chain/clients/gemma3.rb +5 -3
- data/lib/llm_chain/clients/openai.rb +1 -1
- data/lib/llm_chain/clients/qwen.rb +27 -15
- data/lib/llm_chain/configuration_validator.rb +11 -7
- data/lib/llm_chain/embeddings/clients/local/ollama_client.rb +2 -0
- data/lib/llm_chain/embeddings/clients/local/weaviate_vector_store.rb +2 -2
- data/lib/llm_chain/interfaces/agent.rb +54 -0
- data/lib/llm_chain/tools/code_interpreter.rb +10 -3
- data/lib/llm_chain/tools/date_time.rb +63 -7
- data/lib/llm_chain/tools/web_search.rb +83 -22
- data/lib/llm_chain/version.rb +1 -1
- data/lib/llm_chain.rb +1 -0
- metadata +114 -24
@@ -55,10 +55,17 @@ module LLMChain
|
|
55
55
|
|
56
56
|
def call(prompt, context: {})
|
57
57
|
code = extract_code(prompt)
|
58
|
-
language = detect_language(code, prompt)
|
58
|
+
language = context[:language]&.to_s || detect_language(code, prompt)
|
59
59
|
|
60
|
-
return "No code found to execute" if code.empty?
|
61
|
-
|
60
|
+
return { error: "No code found to execute" } if code.empty?
|
61
|
+
unless @allowed_languages.include?(language)
|
62
|
+
return {
|
63
|
+
code: code,
|
64
|
+
language: language,
|
65
|
+
error: "Language '#{language}' is not supported",
|
66
|
+
formatted: "Cannot execute: Language '#{language}' is not supported"
|
67
|
+
}
|
68
|
+
end
|
62
69
|
|
63
70
|
begin
|
64
71
|
if safe_to_execute?(code)
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
require 'time'
|
3
|
+
require 'json'
|
3
4
|
|
4
5
|
module LLMChain
|
5
6
|
module Tools
|
@@ -31,28 +32,83 @@ module LLMChain
|
|
31
32
|
def call(prompt, context: {})
|
32
33
|
params = extract_parameters(prompt)
|
33
34
|
tz = params[:timezone]
|
34
|
-
|
35
|
+
|
36
|
+
if tz
|
37
|
+
# Use TZInfo for proper timezone handling
|
38
|
+
require 'tzinfo'
|
39
|
+
tz_info = TZInfo::Timezone.get(map_timezone_name(tz))
|
40
|
+
time = tz_info.now
|
41
|
+
timezone_abbr = tz_info.current_period.abbreviation
|
42
|
+
else
|
43
|
+
time = Time.now
|
44
|
+
timezone_abbr = time.zone
|
45
|
+
end
|
46
|
+
|
35
47
|
{
|
36
|
-
timezone: tz
|
48
|
+
timezone: tz ? map_timezone_name(tz) : time.zone,
|
37
49
|
iso: time.iso8601,
|
38
|
-
formatted: time.strftime("%Y-%m-%d %H:%M:%S
|
50
|
+
formatted: time.strftime("%Y-%m-%d %H:%M:%S") + " #{timezone_abbr}"
|
39
51
|
}
|
40
52
|
end
|
41
53
|
|
42
54
|
def extract_parameters(prompt)
|
43
|
-
|
44
|
-
|
55
|
+
# First try to parse as JSON (for ReAct agent)
|
56
|
+
begin
|
57
|
+
json_params = JSON.parse(prompt)
|
58
|
+
return { timezone: json_params['timezone'] || json_params[:timezone] }
|
59
|
+
rescue JSON::ParserError
|
60
|
+
# Fallback to regex extraction
|
61
|
+
end
|
62
|
+
|
63
|
+
# Extract timezone from prompt using regex
|
64
|
+
tz_match = prompt.match(/in\s+([A-Za-z_\s\/]+)/)
|
65
|
+
timezone = tz_match && tz_match[1]&.strip
|
66
|
+
|
67
|
+
# Map common timezone names to IANA format
|
68
|
+
timezone = map_timezone_name(timezone) if timezone
|
69
|
+
|
70
|
+
{ timezone: timezone }
|
45
71
|
end
|
46
72
|
|
47
73
|
private
|
48
74
|
|
49
75
|
def timezone_offset(tz)
|
76
|
+
return 0 unless tz
|
77
|
+
|
78
|
+
# Map common timezone names to IANA format
|
79
|
+
tz = map_timezone_name(tz)
|
80
|
+
|
50
81
|
# Fallback: use TZInfo if available, else default to system
|
51
82
|
require 'tzinfo'
|
52
|
-
TZInfo::Timezone.get(tz).current_period.offset
|
53
|
-
rescue LoadError, TZInfo::InvalidTimezoneIdentifier
|
83
|
+
TZInfo::Timezone.get(tz).current_period.offset.utc_total_offset
|
84
|
+
rescue LoadError, NameError, TZInfo::InvalidTimezoneIdentifier
|
54
85
|
0
|
55
86
|
end
|
87
|
+
|
88
|
+
def map_timezone_name(tz)
|
89
|
+
return nil unless tz
|
90
|
+
|
91
|
+
# Map common timezone names to IANA format
|
92
|
+
timezone_map = {
|
93
|
+
'moscow' => 'Europe/Moscow',
|
94
|
+
'msk' => 'Europe/Moscow',
|
95
|
+
'new york' => 'America/New_York',
|
96
|
+
'nyc' => 'America/New_York',
|
97
|
+
'london' => 'Europe/London',
|
98
|
+
'paris' => 'Europe/Paris',
|
99
|
+
'tokyo' => 'Asia/Tokyo',
|
100
|
+
'beijing' => 'Asia/Shanghai',
|
101
|
+
'shanghai' => 'Asia/Shanghai',
|
102
|
+
'sydney' => 'Australia/Sydney',
|
103
|
+
'los angeles' => 'America/Los_Angeles',
|
104
|
+
'la' => 'America/Los_Angeles',
|
105
|
+
'chicago' => 'America/Chicago',
|
106
|
+
'utc' => 'UTC',
|
107
|
+
'gmt' => 'GMT'
|
108
|
+
}
|
109
|
+
|
110
|
+
timezone_map[tz.downcase] || tz
|
111
|
+
end
|
56
112
|
end
|
57
113
|
end
|
58
114
|
end
|
@@ -21,12 +21,20 @@ module LLMChain
|
|
21
21
|
BING_SAFE = 'Moderate'.freeze
|
22
22
|
BING_RESPONSE_FILTER = 'Webpages'.freeze
|
23
23
|
|
24
|
-
# ---
|
24
|
+
# --- Private constants for parsing ---
|
25
25
|
QUERY_COMMANDS_REGEX = /\b(search for|find|lookup|google|what is|who is|where is|when is)\b/i.freeze
|
26
26
|
POLITENESS_REGEX = /\b(please|can you|could you|would you)\b/i.freeze
|
27
27
|
NUM_RESULTS_REGEX = /(\d+)\s*(results?|items?|links?)/i.freeze
|
28
|
+
FOR_SEARCH_REGEX = /\A(for|to)?\s*search:?\s*/i.freeze
|
29
|
+
DOUBLE_COMMA_REGEX = /,\s*,/
|
30
|
+
TRAILING_PUNCTUATION_REGEX = /[,;]\s*$/
|
31
|
+
MULTISPACE_REGEX = /\s+/
|
28
32
|
MAX_QUERY_WORDS = 10
|
29
33
|
|
34
|
+
SERVER_ERROR_REGEX = /5\d\d/
|
35
|
+
|
36
|
+
# @param api_key [String, nil] API key for the search engine (Google or Bing)
|
37
|
+
# @param search_engine [Symbol] :google or :bing
|
30
38
|
def initialize(api_key: nil, search_engine: :google)
|
31
39
|
@api_key = api_key || ENV['GOOGLE_API_KEY'] || ENV['SEARCH_API_KEY']
|
32
40
|
@search_engine = search_engine
|
@@ -47,10 +55,15 @@ module LLMChain
|
|
47
55
|
)
|
48
56
|
end
|
49
57
|
|
58
|
+
# @param prompt [String]
|
59
|
+
# @return [Boolean] Whether the prompt contains search keywords
|
50
60
|
def match?(prompt)
|
51
61
|
contains_keywords?(prompt, SEARCH_KEYWORDS)
|
52
62
|
end
|
53
63
|
|
64
|
+
# @param prompt [String] User's original query
|
65
|
+
# @param context [Hash] (unused)
|
66
|
+
# @return [Hash] Search results and formatted string
|
54
67
|
def call(prompt, context: {})
|
55
68
|
query = extract_query(prompt)
|
56
69
|
return "No search query found" if query.empty?
|
@@ -71,6 +84,8 @@ module LLMChain
|
|
71
84
|
end
|
72
85
|
end
|
73
86
|
|
87
|
+
# @param prompt [String]
|
88
|
+
# @return [Hash] :query and :num_results
|
74
89
|
def extract_parameters(prompt)
|
75
90
|
{
|
76
91
|
query: extract_query(prompt),
|
@@ -80,20 +95,22 @@ module LLMChain
|
|
80
95
|
|
81
96
|
private
|
82
97
|
|
83
|
-
# @param prompt [String]
|
84
|
-
# @return [String]
|
98
|
+
# @param prompt [String] Original query
|
99
|
+
# @return [String] Extracted search query
|
85
100
|
def extract_query(prompt)
|
86
101
|
return "" if prompt.nil? || prompt.strip.empty?
|
87
102
|
query = prompt.gsub(QUERY_COMMANDS_REGEX, '')
|
88
103
|
.gsub(POLITENESS_REGEX, '')
|
89
104
|
.strip
|
90
|
-
|
91
|
-
|
105
|
+
query = query.gsub(NUM_RESULTS_REGEX, '').strip
|
106
|
+
query = query.sub(FOR_SEARCH_REGEX, '')
|
107
|
+
query = query.gsub(DOUBLE_COMMA_REGEX, ',').gsub(MULTISPACE_REGEX, ' ')
|
108
|
+
query = query.sub(TRAILING_PUNCTUATION_REGEX, '').strip
|
92
109
|
query
|
93
110
|
end
|
94
111
|
|
95
|
-
# @param prompt [String]
|
96
|
-
# @return [Integer]
|
112
|
+
# @param prompt [String] Original query
|
113
|
+
# @return [Integer] Number of results (default)
|
97
114
|
def extract_num_results(prompt)
|
98
115
|
return DEFAULT_NUM_RESULTS if prompt.nil? || prompt.empty?
|
99
116
|
match = prompt.match(NUM_RESULTS_REGEX)
|
@@ -101,6 +118,11 @@ module LLMChain
|
|
101
118
|
DEFAULT_NUM_RESULTS
|
102
119
|
end
|
103
120
|
|
121
|
+
# @param query [String] Search query
|
122
|
+
# @param num_results [Integer] Number of results
|
123
|
+
# @param max_retries [Integer] Maximum number of attempts
|
124
|
+
# @return [Array<Hash>] Array of search results
|
125
|
+
# @raise [StandardError] If all attempts fail
|
104
126
|
def perform_search_with_retry(query, num_results, max_retries: 3)
|
105
127
|
retries = 0
|
106
128
|
last_error = nil
|
@@ -118,14 +140,14 @@ module LLMChain
|
|
118
140
|
retry
|
119
141
|
else
|
120
142
|
log_error("Search failed after #{retries} attempts", e)
|
121
|
-
# Fallback to hardcoded results as last resort
|
122
|
-
hardcoded = get_hardcoded_results(query)
|
123
|
-
return hardcoded unless hardcoded.empty?
|
124
143
|
raise e
|
125
144
|
end
|
126
145
|
end
|
127
146
|
end
|
128
147
|
|
148
|
+
# @param query [String] Search query
|
149
|
+
# @param num_results [Integer] Number of results
|
150
|
+
# @return [Array<Hash>] Array of search results
|
129
151
|
def perform_search(query, num_results)
|
130
152
|
case @search_engine
|
131
153
|
when :google
|
@@ -137,7 +159,9 @@ module LLMChain
|
|
137
159
|
end
|
138
160
|
end
|
139
161
|
|
140
|
-
#
|
162
|
+
# @param query [String] Search query
|
163
|
+
# @param num_results [Integer] Number of results
|
164
|
+
# @return [Array<Hash>] Array of search results
|
141
165
|
def search_google_results(query, num_results)
|
142
166
|
unless @api_key
|
143
167
|
handle_api_error(StandardError.new("No API key"), "Google API key not provided, using fallback")
|
@@ -157,6 +181,10 @@ module LLMChain
|
|
157
181
|
end
|
158
182
|
end
|
159
183
|
|
184
|
+
# @param query [String] Search query
|
185
|
+
# @param num_results [Integer] Number of results
|
186
|
+
# @param search_engine_id [String] Google search engine ID
|
187
|
+
# @return [Net::HTTPResponse, nil] Google response or nil on error
|
160
188
|
def fetch_google_response(query, num_results, search_engine_id)
|
161
189
|
require 'timeout'
|
162
190
|
Timeout.timeout(GOOGLE_TIMEOUT) do
|
@@ -180,6 +208,8 @@ module LLMChain
|
|
180
208
|
nil
|
181
209
|
end
|
182
210
|
|
211
|
+
# @param response [Net::HTTPResponse, nil]
|
212
|
+
# @return [Array<Hash>] Array of search results
|
183
213
|
def parse_google_response(response)
|
184
214
|
return [] unless response && response.code == '200'
|
185
215
|
data = JSON.parse(response.body) rescue nil
|
@@ -199,7 +229,9 @@ module LLMChain
|
|
199
229
|
[]
|
200
230
|
end
|
201
231
|
|
202
|
-
#
|
232
|
+
# @param query [String] Search query
|
233
|
+
# @param num_results [Integer] Number of results
|
234
|
+
# @return [Array<Hash>] Array of search results
|
203
235
|
def search_bing_results(query, num_results)
|
204
236
|
unless @api_key
|
205
237
|
handle_api_error(StandardError.new("No API key"), "Bing API key not provided, using fallback")
|
@@ -214,6 +246,9 @@ module LLMChain
|
|
214
246
|
end
|
215
247
|
end
|
216
248
|
|
249
|
+
# @param query [String] Search query
|
250
|
+
# @param num_results [Integer] Number of results
|
251
|
+
# @return [Net::HTTPResponse, nil] Bing response or nil on error
|
217
252
|
def fetch_bing_response(query, num_results)
|
218
253
|
require 'timeout'
|
219
254
|
Timeout.timeout(BING_TIMEOUT) do
|
@@ -239,6 +274,8 @@ module LLMChain
|
|
239
274
|
nil
|
240
275
|
end
|
241
276
|
|
277
|
+
# @param response [Net::HTTPResponse, nil]
|
278
|
+
# @return [Array<Hash>] Array of search results
|
242
279
|
def parse_bing_response(response)
|
243
280
|
return [] unless response && response.code == '200'
|
244
281
|
data = JSON.parse(response.body) rescue nil
|
@@ -258,18 +295,29 @@ module LLMChain
|
|
258
295
|
[]
|
259
296
|
end
|
260
297
|
|
298
|
+
# @param error [Exception] Exception
|
299
|
+
# @param context [String, nil] Error context
|
300
|
+
# @return [void]
|
261
301
|
def handle_api_error(error, context = nil)
|
262
302
|
log_error(context || "API error", error)
|
263
303
|
end
|
264
304
|
|
265
|
-
#
|
305
|
+
# @param query [String] Search query
|
306
|
+
# @return [Array<Hash>] Array of results
|
266
307
|
def parse_hardcoded_results(query)
|
267
308
|
hardcoded = get_hardcoded_results(query)
|
268
309
|
return [] if hardcoded.empty?
|
269
310
|
hardcoded
|
270
311
|
end
|
271
312
|
|
272
|
-
#
|
313
|
+
# Заглушка для hardcoded results
|
314
|
+
def get_hardcoded_results(query)
|
315
|
+
[]
|
316
|
+
end
|
317
|
+
|
318
|
+
# @param query [String] Search query
|
319
|
+
# @param results [Array<Hash>] Array of search results
|
320
|
+
# @return [Hash] Formatted results
|
273
321
|
def format_search_results(query, results)
|
274
322
|
return {
|
275
323
|
query: query,
|
@@ -278,7 +326,12 @@ module LLMChain
|
|
278
326
|
} if results.empty?
|
279
327
|
|
280
328
|
formatted_results = results.map.with_index(1) do |result, index|
|
281
|
-
|
329
|
+
title = result[:title].to_s.strip
|
330
|
+
title = 'Untitled' if title.empty?
|
331
|
+
snippet = result[:snippet].to_s.strip
|
332
|
+
snippet = 'No description available' if snippet.empty?
|
333
|
+
url = result[:url].to_s.strip
|
334
|
+
"#{index}. #{title}\n #{snippet}\n #{url}"
|
282
335
|
end.join("\n\n")
|
283
336
|
|
284
337
|
{
|
@@ -289,7 +342,9 @@ module LLMChain
|
|
289
342
|
}
|
290
343
|
end
|
291
344
|
|
292
|
-
#
|
345
|
+
# @param message [String] Message
|
346
|
+
# @param error [Exception] Exception
|
347
|
+
# @return [void]
|
293
348
|
def log_error(message, error)
|
294
349
|
return unless should_log?
|
295
350
|
if defined?(Rails) && Rails.logger
|
@@ -299,6 +354,9 @@ module LLMChain
|
|
299
354
|
end
|
300
355
|
end
|
301
356
|
|
357
|
+
# @param message [String] Message
|
358
|
+
# @param error [Exception] Exception
|
359
|
+
# @return [void]
|
302
360
|
def log_retry(message, error)
|
303
361
|
return unless should_log?
|
304
362
|
if defined?(Rails) && Rails.logger
|
@@ -308,16 +366,19 @@ module LLMChain
|
|
308
366
|
end
|
309
367
|
end
|
310
368
|
|
369
|
+
# @return [Boolean] Whether logging is enabled
|
311
370
|
def should_log?
|
312
|
-
ENV['LLM_CHAIN_DEBUG'] == 'true'
|
313
|
-
|
314
|
-
|
371
|
+
return true if ENV['LLM_CHAIN_DEBUG'] == 'true'
|
372
|
+
return true if ENV['RAILS_ENV'] == 'development'
|
373
|
+
return true if defined?(Rails) && Rails.respond_to?(:env) && Rails.env.development?
|
374
|
+
false
|
315
375
|
end
|
316
376
|
|
377
|
+
# @param error [Exception]
|
378
|
+
# @return [Boolean] Whether the error is retryable
|
317
379
|
def retryable_error?(error)
|
318
|
-
# Определяем, стоит ли повторять запрос при данной ошибке
|
319
380
|
case error
|
320
|
-
when
|
381
|
+
when Timeout::Error, Net::OpenTimeout, Net::ReadTimeout
|
321
382
|
true
|
322
383
|
when SocketError
|
323
384
|
# DNS ошибки обычно временные
|
@@ -326,7 +387,7 @@ module LLMChain
|
|
326
387
|
true
|
327
388
|
when Net::HTTPError
|
328
389
|
# Повторяем только для серверных ошибок (5xx)
|
329
|
-
error.message.match?(
|
390
|
+
error.message.match?(SERVER_ERROR_REGEX)
|
330
391
|
else
|
331
392
|
false
|
332
393
|
end
|
data/lib/llm_chain/version.rb
CHANGED
data/lib/llm_chain.rb
CHANGED
@@ -21,6 +21,7 @@ require_relative "llm_chain/tools/date_time"
|
|
21
21
|
require_relative "llm_chain/embeddings/clients/local/weaviate_vector_store"
|
22
22
|
require_relative "llm_chain/embeddings/clients/local/weaviate_retriever"
|
23
23
|
require_relative "llm_chain/embeddings/clients/local/ollama_client"
|
24
|
+
require_relative "llm_chain/agents"
|
24
25
|
|
25
26
|
module LLMChain
|
26
27
|
# Exception classes
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: llm_chain
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- FuryCow
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-07-
|
11
|
+
date: 2025-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
19
|
+
version: '0.21'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
26
|
+
version: '0.21'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: redis
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
33
|
+
version: '5.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
40
|
+
version: '5.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: faraday
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -56,42 +56,42 @@ dependencies:
|
|
56
56
|
name: faraday-net_http
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
61
|
+
version: '3.0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
68
|
+
version: '3.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: json
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '2.6'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '2.6'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: weaviate-ruby
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: 0.9.1
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 0.9.1
|
97
97
|
- !ruby/object:Gem::Dependency
|
@@ -100,15 +100,91 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '3.
|
103
|
+
version: '3.12'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '3.
|
111
|
-
|
110
|
+
version: '3.12'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rubocop
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '1.50'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '1.50'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rubocop-rspec
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '2.20'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '2.20'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: yard
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0.9'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0.9'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: pry
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0.14'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0.14'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: pry-byebug
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - "~>"
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '3.10'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - "~>"
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '3.10'
|
181
|
+
description: "LLM Chain is a powerful Ruby framework that provides tools for building
|
182
|
+
sophisticated \nLLM-powered applications. It includes support for prompt management,
|
183
|
+
conversation chains, \nmemory systems, vector storage integration, and seamless
|
184
|
+
LLM provider connections.\n\nKey features:\n• Chain-based conversation flows\n•
|
185
|
+
Memory management with Redis\n• Vector storage with Weaviate\n• Multiple LLM provider
|
186
|
+
support\n• Prompt templating and management\n• Easy integration with existing Ruby
|
187
|
+
applications\n"
|
112
188
|
email:
|
113
189
|
- dreamweaver0408@gmail.com
|
114
190
|
executables:
|
@@ -123,10 +199,18 @@ files:
|
|
123
199
|
- LICENSE.txt
|
124
200
|
- README.md
|
125
201
|
- Rakefile
|
202
|
+
- examples/composite_agent_example.rb
|
203
|
+
- examples/planner_agent_example.rb
|
126
204
|
- examples/quick_demo.rb
|
205
|
+
- examples/react_agent_example.rb
|
127
206
|
- examples/tools_example.rb
|
128
207
|
- exe/llm-chain
|
129
208
|
- lib/llm_chain.rb
|
209
|
+
- lib/llm_chain/agents.rb
|
210
|
+
- lib/llm_chain/agents/agent_factory.rb
|
211
|
+
- lib/llm_chain/agents/composite_agent.rb
|
212
|
+
- lib/llm_chain/agents/planner_agent.rb
|
213
|
+
- lib/llm_chain/agents/react_agent.rb
|
130
214
|
- lib/llm_chain/builders/memory_context.rb
|
131
215
|
- lib/llm_chain/builders/prompt.rb
|
132
216
|
- lib/llm_chain/builders/rag_documents.rb
|
@@ -145,6 +229,7 @@ files:
|
|
145
229
|
- lib/llm_chain/embeddings/clients/local/ollama_client.rb
|
146
230
|
- lib/llm_chain/embeddings/clients/local/weaviate_retriever.rb
|
147
231
|
- lib/llm_chain/embeddings/clients/local/weaviate_vector_store.rb
|
232
|
+
- lib/llm_chain/interfaces/agent.rb
|
148
233
|
- lib/llm_chain/interfaces/builders/memory_context_builder.rb
|
149
234
|
- lib/llm_chain/interfaces/builders/prompt_builder.rb
|
150
235
|
- lib/llm_chain/interfaces/builders/rag_documents_builder.rb
|
@@ -171,6 +256,10 @@ licenses:
|
|
171
256
|
metadata:
|
172
257
|
homepage_uri: https://github.com/FuryCow/llm_chain
|
173
258
|
source_code_uri: https://github.com/FuryCow/llm_chain
|
259
|
+
changelog_uri: https://github.com/FuryCow/llm_chain/blob/main/CHANGELOG.md
|
260
|
+
documentation_uri: https://github.com/FuryCow/llm_chain#readme
|
261
|
+
bug_tracker_uri: https://github.com/FuryCow/llm_chain/issues
|
262
|
+
rubygems_mfa_required: 'true'
|
174
263
|
post_install_message:
|
175
264
|
rdoc_options: []
|
176
265
|
require_paths:
|
@@ -189,5 +278,6 @@ requirements: []
|
|
189
278
|
rubygems_version: 3.4.10
|
190
279
|
signing_key:
|
191
280
|
specification_version: 4
|
192
|
-
summary: Ruby
|
281
|
+
summary: A comprehensive Ruby framework for building LLM-powered applications with
|
282
|
+
chains, memory, and vector storage
|
193
283
|
test_files: []
|