flowengine 0.3.0 → 0.3.1

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.
@@ -0,0 +1,25 @@
1
+ models:
2
+ version: "1.0"
3
+ date: "Wed Mar 11 02:35:39 PDT 2026"
4
+ vendors:
5
+ anthropic:
6
+ adapter: "FlowEngine::LLM::Adapters::AnthropicAdapter"
7
+ var: "ANTHROPIC_API_KEY"
8
+ top: "claude-opus-4-6"
9
+ default: "claude-sonnet-4-6"
10
+ fastest: "claude-haiku-4-5-20251001"
11
+ openai:
12
+ adapter: "FlowEngine::LLM::Adapters::OpenAIAdapter"
13
+ var: "OPENAI_API_KEY"
14
+ top: "gpt-5.4"
15
+ default: "gpt-5-mini"
16
+ fastest: "gpt-5-nano"
17
+ gemini:
18
+ adapter: "FlowEngine::LLM::Adapters::GeminiAdapter"
19
+ var: "GEMINI_API_KEY"
20
+ top: "gemini-3.1-pro-preview"
21
+ default: "gemini-2.5-flash"
22
+ fastest: "gemini-2.5-flash-lite"
23
+
24
+
25
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flowengine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Gredeskoul
@@ -23,6 +23,20 @@ dependencies:
23
23
  - - ">="
24
24
  - !ruby/object:Gem::Version
25
25
  version: '0'
26
+ - !ruby/object:Gem::Dependency
27
+ name: zeitwerk
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
26
40
  - !ruby/object:Gem::Dependency
27
41
  name: rspec
28
42
  requirement: !ruby/object:Gem::Requirement
@@ -115,22 +129,25 @@ files:
115
129
  - exe/flowengine
116
130
  - justfile
117
131
  - lib/flowengine.rb
132
+ - lib/flowengine/clarification_result.rb
118
133
  - lib/flowengine/definition.rb
119
134
  - lib/flowengine/dsl.rb
120
135
  - lib/flowengine/dsl/flow_builder.rb
121
136
  - lib/flowengine/dsl/rule_helpers.rb
122
137
  - lib/flowengine/dsl/step_builder.rb
123
138
  - lib/flowengine/engine.rb
139
+ - lib/flowengine/engine/state_serializer.rb
124
140
  - lib/flowengine/errors.rb
125
141
  - lib/flowengine/evaluator.rb
126
142
  - lib/flowengine/graph/mermaid_exporter.rb
127
143
  - lib/flowengine/introduction.rb
128
144
  - lib/flowengine/llm.rb
129
145
  - lib/flowengine/llm/adapter.rb
130
- - lib/flowengine/llm/anthropic_adapter.rb
146
+ - lib/flowengine/llm/adapters.rb
147
+ - lib/flowengine/llm/auto_client.rb
131
148
  - lib/flowengine/llm/client.rb
132
- - lib/flowengine/llm/gemini_adapter.rb
133
- - lib/flowengine/llm/openai_adapter.rb
149
+ - lib/flowengine/llm/intake_prompt_builder.rb
150
+ - lib/flowengine/llm/provider.rb
134
151
  - lib/flowengine/llm/sensitive_data_filter.rb
135
152
  - lib/flowengine/llm/system_prompt_builder.rb
136
153
  - lib/flowengine/node.rb
@@ -146,6 +163,7 @@ files:
146
163
  - lib/flowengine/validation/adapter.rb
147
164
  - lib/flowengine/validation/null_adapter.rb
148
165
  - lib/flowengine/version.rb
166
+ - resources/models.yml
149
167
  - resources/prompts/generic-dsl-intake.j2
150
168
  - sig/flowengine.rbs
151
169
  homepage: https://github.com/kigster/flowengine
@@ -1,40 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "ruby_llm"
4
-
5
- module FlowEngine
6
- module LLM
7
- # Anthropic adapter using the ruby_llm gem. Configures the API key
8
- # and delegates chat calls to RubyLLM's conversation interface.
9
- class AnthropicAdapter < Adapter
10
- DEFAULT_MODEL = "claude-sonnet-4-20250514"
11
-
12
- # @param api_key [String, nil] Anthropic API key; falls back to ANTHROPIC_API_KEY env var
13
- # @raise [LLMError] if no API key is available
14
- def initialize(api_key: nil)
15
- super()
16
- @api_key = api_key || ENV.fetch("ANTHROPIC_API_KEY", nil)
17
- raise LLMError, "Anthropic API key not provided and ANTHROPIC_API_KEY not set" unless @api_key
18
- end
19
-
20
- # @param system_prompt [String] system instructions
21
- # @param user_prompt [String] user's text
22
- # @param model [String] Anthropic model identifier
23
- # @return [String] response content from the LLM
24
- def chat(system_prompt:, user_prompt:, model: DEFAULT_MODEL)
25
- configure_ruby_llm!
26
- conversation = RubyLLM.chat(model: model)
27
- response = conversation.with_instructions(system_prompt).ask(user_prompt)
28
- response.content
29
- end
30
-
31
- private
32
-
33
- def configure_ruby_llm!
34
- RubyLLM.configure do |config|
35
- config.anthropic_api_key = @api_key
36
- end
37
- end
38
- end
39
- end
40
- end
@@ -1,40 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "ruby_llm"
4
-
5
- module FlowEngine
6
- module LLM
7
- # Google Gemini adapter using the ruby_llm gem. Configures the API key
8
- # and delegates chat calls to RubyLLM's conversation interface.
9
- class GeminiAdapter < Adapter
10
- DEFAULT_MODEL = "gemini-2.0-flash"
11
-
12
- # @param api_key [String, nil] Gemini API key; falls back to GEMINI_API_KEY env var
13
- # @raise [LLMError] if no API key is available
14
- def initialize(api_key: nil)
15
- super()
16
- @api_key = api_key || ENV.fetch("GEMINI_API_KEY", nil)
17
- raise LLMError, "Gemini API key not provided and GEMINI_API_KEY not set" unless @api_key
18
- end
19
-
20
- # @param system_prompt [String] system instructions
21
- # @param user_prompt [String] user's text
22
- # @param model [String] Gemini model identifier
23
- # @return [String] response content from the LLM
24
- def chat(system_prompt:, user_prompt:, model: DEFAULT_MODEL)
25
- configure_ruby_llm!
26
- conversation = RubyLLM.chat(model: model)
27
- response = conversation.with_instructions(system_prompt).ask(user_prompt)
28
- response.content
29
- end
30
-
31
- private
32
-
33
- def configure_ruby_llm!
34
- RubyLLM.configure do |config|
35
- config.gemini_api_key = @api_key
36
- end
37
- end
38
- end
39
- end
40
- end
@@ -1,38 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "ruby_llm"
4
-
5
- module FlowEngine
6
- module LLM
7
- # OpenAI adapter using the ruby_llm gem. Configures the API key
8
- # and delegates chat calls to RubyLLM's conversation interface.
9
- class OpenAIAdapter < Adapter
10
- # @param api_key [String, nil] OpenAI API key; falls back to OPENAI_API_KEY env var
11
- # @raise [LLMError] if no API key is available
12
- def initialize(api_key: nil)
13
- super()
14
- @api_key = api_key || ENV.fetch("OPENAI_API_KEY", nil)
15
- raise LLMError, "OpenAI API key not provided and OPENAI_API_KEY not set" unless @api_key
16
- end
17
-
18
- # @param system_prompt [String] system instructions
19
- # @param user_prompt [String] user's text
20
- # @param model [String] OpenAI model identifier
21
- # @return [String] response content from the LLM
22
- def chat(system_prompt:, user_prompt:, model: "gpt-4o-mini")
23
- configure_ruby_llm!
24
- conversation = RubyLLM.chat(model: model)
25
- response = conversation.with_instructions(system_prompt).ask(user_prompt)
26
- response.content
27
- end
28
-
29
- private
30
-
31
- def configure_ruby_llm!
32
- RubyLLM.configure do |config|
33
- config.openai_api_key = @api_key
34
- end
35
- end
36
- end
37
- end
38
- end