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 +4 -4
- data/lib/active_agent/generation_provider/ollama_provider.rb +16 -0
- data/lib/active_agent/generation_provider/open_ai_provider.rb +2 -4
- data/lib/active_agent/generation_provider/open_router_provider.rb +15 -0
- data/lib/active_agent/version.rb +1 -1
- data/lib/generators/active_agent/templates/agent.html.erb +1 -1
- data/lib/generators/active_agent/templates/agent.text.erb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 065b41c8228d87f1c49d6099813e4d67fc8c853f2985bcdff01e8af23d0561d3
|
4
|
+
data.tar.gz: 820580bb35c3596adfdaee4edb9dc7f54044328f32d92a767d6134a3460875f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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] = {
|
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"], {
|
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
|
data/lib/active_agent/version.rb
CHANGED
@@ -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.
|
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-
|
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
|