activeagent 0.3.2 → 0.3.3

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: b5296fe177a73f49b3514b6d82ad8dc45efdf5455b50aed3fb411103551fb308
4
- data.tar.gz: 889c307af88851d5bb8022f4701af49a96a9701f862cecf1b01bfd625f2568d2
3
+ metadata.gz: 065b41c8228d87f1c49d6099813e4d67fc8c853f2985bcdff01e8af23d0561d3
4
+ data.tar.gz: 820580bb35c3596adfdaee4edb9dc7f54044328f32d92a767d6134a3460875f2
5
5
  SHA512:
6
- metadata.gz: '0806180976fb672856ce7396c813659d7ee1edf9e3393e9dbba970b724daa343c0da0397b3edfed9aae6d60b08ee1ac2dd744933b4e177d0c829a3c26e6c63ce'
7
- data.tar.gz: d59653e4a7e97488b864bcdc0b93558b07920f6ea069ef16070dba7dfe0c36e5876de928008f7b02d848bbb5d2f86d7bf025c52d33be8090f08f1da5fc8c6e9e
6
+ metadata.gz: 46752438d8e2ec5772e6c6a134906410de7363c366c187ce771bc6f13c7c748d23975ea7716e98ff22a76e8bfa46be43513cc6ce97cf504788ea612ac68caaeb
7
+ data.tar.gz: 1e8f480da2ac8107114ee9503aa9db582cbd7719e1ceceb809a741a8b0a81b67a038c46ecb75bff31e5ef9b77ce3197c6cc8bfbcb19c9c3779e097d8b3d53411
@@ -0,0 +1,16 @@
1
+ require "openai"
2
+ require_relative "open_ai_provider"
3
+
4
+ module ActiveAgent
5
+ module GenerationProvider
6
+ class OllamaProvider < OpenAIProvider
7
+ def initialize(config)
8
+ @config = config
9
+ @api_key = config["api_key"]
10
+ @model_name = config["model"]
11
+ @host = config["host"] || "http://localhost:11434"
12
+ @client = OpenAI::Client.new(uri_base: @host, access_token: @api_key, log_errors: true)
13
+ end
14
+ end
15
+ end
16
+ end
@@ -1,5 +1,3 @@
1
- # lib/active_agent/generation_provider/open_ai_provider.rb
2
-
3
1
  require "openai"
4
2
  require "active_agent/action_prompt/action"
5
3
  require_relative "base"
@@ -78,7 +76,7 @@ module ActiveAgent
78
76
  }.compact
79
77
 
80
78
  if message.content_type == "image_url"
81
- provider_message[:image_url] = { url: message.content }
79
+ provider_message[:image_url] = {url: message.content}
82
80
  end
83
81
  provider_message
84
82
  end
@@ -110,7 +108,7 @@ module ActiveAgent
110
108
 
111
109
  tool_calls.map do |tool_call|
112
110
  next if tool_call["function"].nil? || tool_call["function"]["name"].blank?
113
- args = tool_call["function"]["arguments"].blank? ? nil : JSON.parse(tool_call["function"]["arguments"], { symbolize_names: true })
111
+ args = tool_call["function"]["arguments"].blank? ? nil : JSON.parse(tool_call["function"]["arguments"], {symbolize_names: true})
114
112
 
115
113
  ActiveAgent::ActionPrompt::Action.new(
116
114
  id: tool_call["id"],
@@ -0,0 +1,15 @@
1
+ require "openai"
2
+ require_relative "open_ai_provider"
3
+
4
+ module ActiveAgent
5
+ module GenerationProvider
6
+ class OpenRouterProvider < OpenAIProvider
7
+ def initialize(config)
8
+ @config = config
9
+ @api_key = config["api_key"]
10
+ @model_name = config["model"]
11
+ @client = OpenAI::Client.new(uri_base: "https://openrouter.ai/api/v1", access_token: @api_key, log_errors: true)
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,3 +1,3 @@
1
1
  module ActiveAgent
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
@@ -1 +1 @@
1
- <%= yield %>
1
+ <%= yield if block_given? %>
@@ -1 +1 @@
1
- <%= yield %>
1
+ <%= yield if block_given? %>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeagent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Bowen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-04-15 00:00:00.000000000 Z
11
+ date: 2025-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -157,7 +157,9 @@ files:
157
157
  - lib/active_agent/generation_provider/README.md
158
158
  - lib/active_agent/generation_provider/anthropic_provider.rb
159
159
  - lib/active_agent/generation_provider/base.rb
160
+ - lib/active_agent/generation_provider/ollama_provider.rb
160
161
  - lib/active_agent/generation_provider/open_ai_provider.rb
162
+ - lib/active_agent/generation_provider/open_router_provider.rb
161
163
  - lib/active_agent/generation_provider/response.rb
162
164
  - lib/active_agent/inline_preview_interceptor.rb
163
165
  - lib/active_agent/log_subscriber.rb