ai-agents 0.2.0 → 0.2.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: b2d0dbff300d9f3bd08da74d39e1fbf2eecbfa0b293558af01b5ecfcc765d58c
4
- data.tar.gz: 84a94feb4a5faea46ec658159f1266d315ba8175ad8b4c62915745c6e430c741
3
+ metadata.gz: 0a7f03e74e5438811518c7dc1f6cf24414d24453770858d2a8e12dda823ba428
4
+ data.tar.gz: d87e91cc47ae009e23db840a29f0fbce3d4c0e913ca3364c1fdaddcdc1816623
5
5
  SHA512:
6
- metadata.gz: 7bb4ab502f7c3362a3bc6f3549c30166f5e8e19d5f9aee7c3bf1fe17af334ae765122ecbff8c6b045aa28d5fac6e639dd5f56002ab7b24626ed0b2aae36eba48
7
- data.tar.gz: 185d68208135a2f24b5ad8f5bbc075cdf06bcd54bad1b99f7910050224439bb8aacdec7a5c64f9768f7ec9cebdea9efa9e33734db4a650dd97bb16de901a00b5
6
+ metadata.gz: 900501d264a748f85f2c0faa1eb3e1d23a0d9bfc0416eaeebc6fa814446ba0e22d61a93cc97095a76982b915c711603fd7ded72fcc7911bc18875834f95530ab
7
+ data.tar.gz: 3fceb514188c816412726fa27ff5f88c32b81d6d2d19fe8895576428235ac44eab8161c729e08424c560b44a907dfd9c1c412aa703aaed1bc9694fdb7065f79f
@@ -1,5 +1,5 @@
1
1
  ---
2
- allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*)
2
+ allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*), Bash(bundle install)
3
3
  description: Bump version, update changelog and commit changes
4
4
  ---
5
5
 
data/CHANGELOG.md CHANGED
@@ -5,6 +5,25 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.2.2] - 2025-07-14
9
+
10
+ ### Added
11
+ - Support for additional LLM providers:
12
+ - DeepSeek (`deepseek_api_key`)
13
+ - OpenRouter (`openrouter_api_key`)
14
+ - Ollama (`ollama_api_base`)
15
+ - AWS Bedrock (`bedrock_api_key`, `bedrock_secret_key`, `bedrock_region`, `bedrock_session_token`)
16
+ - OpenAI API base URL configuration (`openai_api_base`) for custom endpoints
17
+ - OpenAI organization and project ID configuration (`openai_organization_id`, `openai_project_id`)
18
+ - Updated `Configuration#configured?` method to check all supported providers
19
+
20
+ ## [0.2.1] - 2025-07-08
21
+
22
+ ### Fixed
23
+ - Fixed string role handling in conversation history restoration
24
+ - `msg[:role]` is now converted to symbol before checking inclusion in restore_conversation_history
25
+ - Prevents string roles like "user" from being skipped during history restoration
26
+
8
27
  ## [0.2.0] - 2025-07-08
9
28
 
10
29
  ### Added
@@ -32,4 +51,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
32
51
  - Thread-safe agent execution architecture
33
52
  - Tool integration system
34
53
  - Shared context management
35
- - Provider support for OpenAI, Anthropic, and Gemini
54
+ - Provider support for OpenAI, Anthropic, and Gemini
data/lib/agents/runner.rb CHANGED
@@ -199,7 +199,7 @@ module Agents
199
199
 
200
200
  history.each do |msg|
201
201
  # Only restore user and assistant messages with content
202
- next unless %i[user assistant].include?(msg[:role])
202
+ next unless %i[user assistant].include?(msg[:role].to_sym)
203
203
  next unless msg[:content] && !msg[:content].strip.empty?
204
204
 
205
205
  chat.add_message(
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Agents
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.2"
5
5
  end
data/lib/agents.rb CHANGED
@@ -42,18 +42,52 @@ module Agents
42
42
 
43
43
  def configure_ruby_llm!
44
44
  RubyLLM.configure do |config|
45
- config.openai_api_key = configuration.openai_api_key if configuration.openai_api_key
46
- config.anthropic_api_key = configuration.anthropic_api_key if configuration.anthropic_api_key
47
- config.gemini_api_key = configuration.gemini_api_key if configuration.gemini_api_key
48
- config.default_model = configuration.default_model
49
- config.log_level = configuration.debug == true ? :debug : :info
50
- config.request_timeout = configuration.request_timeout if configuration.request_timeout
45
+ configure_providers(config)
46
+ configure_general_settings(config)
51
47
  end
52
48
  end
49
+
50
+ def configure_providers(config)
51
+ # OpenAI configuration
52
+ apply_if_present(config, :openai_api_key)
53
+ apply_if_present(config, :openai_api_base)
54
+ apply_if_present(config, :openai_organization_id)
55
+ apply_if_present(config, :openai_project_id)
56
+
57
+ # Other providers
58
+ apply_if_present(config, :anthropic_api_key)
59
+ apply_if_present(config, :gemini_api_key)
60
+ apply_if_present(config, :deepseek_api_key)
61
+ apply_if_present(config, :openrouter_api_key)
62
+ apply_if_present(config, :ollama_api_base)
63
+
64
+ # AWS Bedrock configuration
65
+ apply_if_present(config, :bedrock_api_key)
66
+ apply_if_present(config, :bedrock_secret_key)
67
+ apply_if_present(config, :bedrock_region)
68
+ apply_if_present(config, :bedrock_session_token)
69
+ end
70
+
71
+ def configure_general_settings(config)
72
+ config.default_model = configuration.default_model
73
+ config.log_level = configuration.debug == true ? :debug : :info
74
+ apply_if_present(config, :request_timeout)
75
+ end
76
+
77
+ def apply_if_present(config, key)
78
+ value = configuration.send(key)
79
+ config.send("#{key}=", value) if value
80
+ end
53
81
  end
54
82
 
55
83
  class Configuration
56
- attr_accessor :openai_api_key, :anthropic_api_key, :gemini_api_key, :request_timeout, :default_model, :debug
84
+ # Provider API keys and configuration
85
+ attr_accessor :openai_api_key, :openai_api_base, :openai_organization_id, :openai_project_id
86
+ attr_accessor :anthropic_api_key, :gemini_api_key, :deepseek_api_key, :openrouter_api_key, :ollama_api_base,
87
+ :bedrock_api_key, :bedrock_secret_key, :bedrock_region, :bedrock_session_token
88
+
89
+ # General configuration
90
+ attr_accessor :request_timeout, :default_model, :debug
57
91
 
58
92
  def initialize
59
93
  @default_model = "gpt-4o-mini"
@@ -64,7 +98,9 @@ module Agents
64
98
  # Check if at least one provider is configured
65
99
  # @return [Boolean] True if any provider has an API key
66
100
  def configured?
67
- @openai_api_key || @anthropic_api_key || @gemini_api_key
101
+ @openai_api_key || @anthropic_api_key || @gemini_api_key ||
102
+ @deepseek_api_key || @openrouter_api_key || @ollama_api_base ||
103
+ @bedrock_api_key
68
104
  end
69
105
  end
70
106
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ai-agents
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shivam Mishra