ruby_bots 0.0.25 → 0.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7500351293df6637a79657ff218f06faa376a9a35104e11cf8d7f232af2de1d0
4
- data.tar.gz: 1fbcb4915525bc159649c098ae66c02cdb41a1ae15941e709d5073327026559a
3
+ metadata.gz: 661bc338ef1cc7a60d6a4b3076c194faaf1c71d21db937d1de05fbfcaa9bc899
4
+ data.tar.gz: b721ca417c4bf4762b1462b2f1672452a7e27ee46b1fec3b35ec369167de7e5d
5
5
  SHA512:
6
- metadata.gz: b76904f26db1b284a6ebc7cd262dcc9d86276afaead350bff6f61964b633d05314f857f3128996b8395fc7cd2df04eab796af9fd81cfef0a43008625d86f89e7
7
- data.tar.gz: e685e6fa6df00ceb1c89bceeadf15a2ca06f8ebac02b1b5f7941fbedfbedf98ca5ad0093c300707d25a5fef26203fcc990ccc9339817b9ee260d56bdb80e8790
6
+ metadata.gz: cf2275c793c811c194e4c25e5497ba16a8eb54898b487e53159f966352ea71041d3324717b2f99b4fd1611c1244ed5344422fe15779a8317759b3142ba8097cf
7
+ data.tar.gz: 5532942135eea17d71566e52609f30327da76de6a1be7e3a1e108d7cab31e9576d452edda5ff92c6c829fb25bc87dcddf7f5eb57c5c1c1eeee8b0617d0afcbb6
@@ -0,0 +1,11 @@
1
+ module RubyBots
2
+ module Streamable
3
+ def response(input)
4
+ run_input_validations(input)
5
+
6
+ raise RubyBots::InvalidInputError, { errors: @errors } if @errors.any?
7
+
8
+ run(input)
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module RubyBots
2
- VERSION = '0.0.25'.freeze
2
+ VERSION = '0.1.1'.freeze
3
3
  end
data/lib/ruby_bots.rb CHANGED
@@ -50,4 +50,5 @@ require_relative 'ruby_bots/bots/pipeline_bot'
50
50
  require_relative 'ruby_bots/bots/router_bot'
51
51
  require_relative 'ruby_bots/bots/openai_react_bot'
52
52
 
53
+ require_relative 'ruby_bots/streamable'
53
54
  require_relative 'ruby_bots/version'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_bots
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.25
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Paulson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-19 00:00:00.000000000 Z
11
+ date: 2023-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debug
@@ -94,9 +94,9 @@ files:
94
94
  - lib/ruby_bots/bots/openai_react_bot.rb
95
95
  - lib/ruby_bots/bots/pipeline_bot.rb
96
96
  - lib/ruby_bots/bots/router_bot.rb
97
+ - lib/ruby_bots/streamable.rb
97
98
  - lib/ruby_bots/tool.rb
98
99
  - lib/ruby_bots/tools/openai_tool.rb
99
- - lib/ruby_bots/tools/wolfram_tool.rb
100
100
  - lib/ruby_bots/version.rb
101
101
  homepage: https://github.com/aha-app/ruby_bots
102
102
  licenses:
@@ -1,25 +0,0 @@
1
- require 'cgi'
2
- require 'uri'
3
- require 'net/http'
4
-
5
- module RubyBots
6
- # This tool provides an interface to get responses from the Wolfram Alpha API.
7
- # This tool requires an App ID key from Wolfram Alpha.
8
- # add it to your environment variables as WOLFRAM_APP_ID
9
- # it is currently alpha and not fully working or tested.
10
- class WolframTool < Tool
11
- DEFAULT_DESCRIPTION = 'This tool will use the Wolfram Alpha API to answer questions.'.freeze
12
-
13
- def initialize(name: 'Wolfram tool', description: DEFAULT_DESCRIPTION)
14
- super(name:, description:)
15
- end
16
-
17
- private
18
-
19
- def run(input)
20
- uri = URI("http://api.wolframalpha.com/v1/simple?appid=#{ENV['WOLFRAM_APPID']}&i=#{CGI.escape(input)}")
21
- resp = Net::HTTP.get_response(uri)
22
- resp.body
23
- end
24
- end
25
- end