deepsearch-rb 0.1.1 → 0.1.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -3
- data/lib/deepsearch/configuration.rb +32 -18
- data/lib/deepsearch/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91d4780990957a409d46cf941454353f54645dcdda52e7dcd5a89e393dd58a27
|
4
|
+
data.tar.gz: b1761828c3b3c263ed9970cfc7ed44bb99883f8f08bce1a3a5309c3135f0bc5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5750aeb0a5c696adde1466eaa8f103f15774bd57c92ca2c93bcd933b47d2238b2e9a975eea2a20eadfa6ae517e625e8fbe0c1d0f130020ed532c264426b32209
|
7
|
+
data.tar.gz: 472b52a34a5a07209693ff92f40d03ffcd7b90d2d01df31d608b3947c3ac39a29e04745f2de7d6ef051104c27762a072f7e5ed8a8b17e5ef17c316553dc61276
|
data/CHANGELOG.md
CHANGED
@@ -1,11 +1,19 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
## [
|
3
|
+
## [Released]
|
4
|
+
|
5
|
+
## [0.1.2] - 2025-09-17
|
6
|
+
|
7
|
+
### Fixed
|
8
|
+
- Fixed compatibility with a new version of RubyLLM
|
9
|
+
|
10
|
+
## [Released]
|
4
11
|
|
5
|
-
## [0.1.1] - 2025-07-
|
12
|
+
## [0.1.1] - 2025-07-20
|
6
13
|
|
7
14
|
### Added
|
8
|
-
-
|
15
|
+
- Calls to embedding API are now executed async
|
16
|
+
- Added multi-step-chain example
|
9
17
|
|
10
18
|
## [Released]
|
11
19
|
|
@@ -13,21 +13,38 @@ module Deepsearch
|
|
13
13
|
# config.ruby_llm.default_model = "gpt-4o-mini"
|
14
14
|
# config.ruby_llm.request_timeout = 90
|
15
15
|
# end
|
16
|
+
#
|
16
17
|
class RubyLLMConfig
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
18
|
+
def self.supported_attributes
|
19
|
+
@supported_attributes ||= discover_attributes
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.reset_supported_attributes!
|
23
|
+
@supported_attributes = nil
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def self.discover_attributes
|
29
|
+
if defined?(RubyLLM::Configuration)
|
30
|
+
config_instance = RubyLLM::Configuration.new
|
31
|
+
else
|
32
|
+
require "ruby_llm"
|
33
|
+
config_instance = RubyLLM::Configuration.new
|
34
|
+
end
|
35
|
+
|
36
|
+
# Getting all setter methods (ending with =) and remove the = suffix
|
37
|
+
config_instance.public_methods(false)
|
38
|
+
.select { |method| method.to_s.end_with?('=') }
|
39
|
+
.map { |method| method.to_s.chomp('=').to_sym }
|
40
|
+
.reject { |attr| [:configuration].include?(attr) }
|
41
|
+
end
|
42
|
+
|
43
|
+
public
|
26
44
|
|
27
|
-
attr_accessor(*
|
45
|
+
attr_accessor(*supported_attributes)
|
28
46
|
|
29
47
|
def initialize
|
30
|
-
# Set some sensible defaults for Deepsearch's use case
|
31
48
|
@default_model = "gpt-4o-mini"
|
32
49
|
@default_embedding_model = "text-embedding-3-small"
|
33
50
|
@request_timeout = 30 # seconds
|
@@ -35,7 +52,6 @@ module Deepsearch
|
|
35
52
|
end
|
36
53
|
end
|
37
54
|
|
38
|
-
# Configuration class for managing gem settings
|
39
55
|
class Configuration
|
40
56
|
# @!attribute listener
|
41
57
|
# An object that can listen to events from the Deepsearch pipeline.
|
@@ -62,7 +78,6 @@ module Deepsearch
|
|
62
78
|
@prompts = PromptsConfig.new
|
63
79
|
end
|
64
80
|
|
65
|
-
# Reset configuration to default values
|
66
81
|
def reset!
|
67
82
|
@tavily_api_key = nil
|
68
83
|
@serper_api_key = nil
|
@@ -73,14 +88,13 @@ module Deepsearch
|
|
73
88
|
@prompts = PromptsConfig.new
|
74
89
|
end
|
75
90
|
|
76
|
-
# Configure RubyLLM with current settings from the `
|
91
|
+
# Configure RubyLLM with current settings from the `RubyLLMConfig` config object.
|
77
92
|
def configure_llm!
|
78
|
-
require "ruby_llm"
|
93
|
+
require "ruby_llm" unless defined?(RubyLLM)
|
79
94
|
|
80
95
|
RubyLLM.configure do |config|
|
81
|
-
RubyLLMConfig
|
82
|
-
value = @ruby_llm.public_send(attr)
|
83
|
-
# Only set the value if it's not nil to avoid overriding RubyLLM's internal defaults.
|
96
|
+
RubyLLMConfig.supported_attributes.each do |attr|
|
97
|
+
value = @ruby_llm.public_send(attr)
|
84
98
|
config.public_send("#{attr}=", value) unless value.nil?
|
85
99
|
end
|
86
100
|
end
|
data/lib/deepsearch/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deepsearch-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Shagov
|
@@ -41,16 +41,16 @@ dependencies:
|
|
41
41
|
name: ruby_llm
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
|
-
- - "
|
44
|
+
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '1.
|
46
|
+
version: '1.6'
|
47
47
|
type: :runtime
|
48
48
|
prerelease: false
|
49
49
|
version_requirements: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- - "
|
51
|
+
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '1.
|
53
|
+
version: '1.6'
|
54
54
|
- !ruby/object:Gem::Dependency
|
55
55
|
name: bundler
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|