llm_chain 0.5.1 → 0.5.2

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.
data/lib/llm_chain.rb CHANGED
@@ -28,6 +28,12 @@ module LLMChain
28
28
  class ServerError < Error; end
29
29
  class TimeoutError < Error; end
30
30
  class MemoryError < Error; end
31
+ end
32
+
33
+ # Загружаем валидатор после определения базовых классов
34
+ require_relative "llm_chain/configuration_validator"
35
+
36
+ module LLMChain
31
37
 
32
38
  # Простая система конфигурации
33
39
  class Configuration
@@ -53,12 +59,13 @@ module LLMChain
53
59
  end
54
60
 
55
61
  # Быстрое создание цепочки с настройками по умолчанию
56
- def quick_chain(model: nil, tools: true, memory: true, **options)
62
+ def quick_chain(model: nil, tools: true, memory: true, validate_config: true, **options)
57
63
  model ||= configuration.default_model
58
64
 
59
65
  chain_options = {
60
66
  model: model,
61
67
  retriever: false,
68
+ validate_config: validate_config,
62
69
  **options
63
70
  }
64
71
 
@@ -73,5 +80,39 @@ module LLMChain
73
80
 
74
81
  Chain.new(**chain_options)
75
82
  end
83
+
84
+ # Диагностика системы
85
+ def diagnose_system
86
+ puts "🔍 LLMChain System Diagnostics"
87
+ puts "=" * 50
88
+
89
+ results = ConfigurationValidator.validate_environment
90
+
91
+ puts "\n📋 System Components:"
92
+ puts " Ruby: #{results[:ruby] ? '✅' : '❌'} (#{RUBY_VERSION})"
93
+ puts " Python: #{results[:python] ? '✅' : '❌'}"
94
+ puts " Node.js: #{results[:node] ? '✅' : '❌'}"
95
+ puts " Internet: #{results[:internet] ? '✅' : '❌'}"
96
+ puts " Ollama: #{results[:ollama] ? '✅' : '❌'}"
97
+
98
+ puts "\n🔑 API Keys:"
99
+ results[:apis].each do |api, available|
100
+ puts " #{api.to_s.capitalize}: #{available ? '✅' : '❌'}"
101
+ end
102
+
103
+ if results[:warnings].any?
104
+ puts "\n⚠️ Warnings:"
105
+ results[:warnings].each { |warning| puts " • #{warning}" }
106
+ end
107
+
108
+ puts "\n💡 Recommendations:"
109
+ puts " • Install missing components for full functionality"
110
+ puts " • Configure API keys for enhanced features"
111
+ puts " • Start Ollama server: ollama serve" unless results[:ollama]
112
+
113
+ puts "\n" + "=" * 50
114
+
115
+ results
116
+ end
76
117
  end
77
118
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: llm_chain
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - FuryCow
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-06-25 00:00:00.000000000 Z
11
+ date: 2025-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -133,6 +133,7 @@ files:
133
133
  - lib/llm_chain/clients/ollama_base.rb
134
134
  - lib/llm_chain/clients/openai.rb
135
135
  - lib/llm_chain/clients/qwen.rb
136
+ - lib/llm_chain/configuration_validator.rb
136
137
  - lib/llm_chain/embeddings/clients/local/ollama_client.rb
137
138
  - lib/llm_chain/embeddings/clients/local/weaviate_retriever.rb
138
139
  - lib/llm_chain/embeddings/clients/local/weaviate_vector_store.rb