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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 51ef2b5c1780ff68752d82960a651443f6b0d5f7de38f9d0313acd17bdaaa144
4
- data.tar.gz: 16af241a4eff83e5a5290832dc4ad14f4f8ed724f7c91abbfa060b4bf8c44ddb
3
+ metadata.gz: 91d4780990957a409d46cf941454353f54645dcdda52e7dcd5a89e393dd58a27
4
+ data.tar.gz: b1761828c3b3c263ed9970cfc7ed44bb99883f8f08bce1a3a5309c3135f0bc5a
5
5
  SHA512:
6
- metadata.gz: 3172fe8597368c0ba863f6593f6c080a41b73de0890a3a02ca49f8e1dbcbf33bc17ab4c4a06a1b557dc324a949e9cabb2ee307752b8af8afd16872398c1dcaeb
7
- data.tar.gz: eb185bd46ca110d9bbcb9134872dae8dab0c76db52841d4c85e38ec4a98f1c41033ab620930c4f9a22ec2238f2fa6f6d421b65bb7811492fccd8097c03cc099a
6
+ metadata.gz: 5750aeb0a5c696adde1466eaa8f103f15774bd57c92ca2c93bcd933b47d2238b2e9a975eea2a20eadfa6ae517e625e8fbe0c1d0f130020ed532c264426b32209
7
+ data.tar.gz: 472b52a34a5a07209693ff92f40d03ffcd7b90d2d01df31d608b3947c3ac39a29e04745f2de7d6ef051104c27762a072f7e5ed8a8b17e5ef17c316553dc61276
data/CHANGELOG.md CHANGED
@@ -1,11 +1,19 @@
1
1
  # Changelog
2
2
 
3
- ## [Pending]
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
12
+ ## [0.1.1] - 2025-07-20
6
13
 
7
14
  ### Added
8
- - Minor specs improvements and examples cleanup
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
- SUPPORTED_ATTRIBUTES = %i[
18
- openai_api_key openai_organization_id openai_project_id
19
- anthropic_api_key gemini_api_key deepseek_api_key openrouter_api_key
20
- ollama_api_base bedrock_api_key bedrock_secret_key bedrock_region
21
- bedrock_session_token openai_api_base default_model
22
- default_embedding_model default_image_model request_timeout max_retries
23
- retry_interval retry_backoff_factor retry_interval_randomness
24
- http_proxy logger log_file log_level log_assume_model_exists
25
- ].freeze
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(*SUPPORTED_ATTRIBUTES)
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 `ruby_llm` config object.
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::SUPPORTED_ATTRIBUTES.each do |attr|
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Deepsearch
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
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.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.0'
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.0'
53
+ version: '1.6'
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: bundler
56
56
  requirement: !ruby/object:Gem::Requirement