require 'boxcars'
true
geeknees
July 16, 2023
https://github.com/BoxcarsAI/boxcars
# showcase Google Serp search
s = Boxcars::GoogleSearch.new
s.run "what temperature is it in Phoenix?"
Question: what temperature is it in Phoenix?
Answer: 10 Day Weather-Phoenix, AZ. As of 4:13 am MST. Today. 81°/60°. 1%. Thu 25 | Day. 81°. 1%. SW 14 mph. Plenty of sunshine. High 81F. Winds SW at 10 to 20 mph.
"10 Day Weather-Phoenix, AZ. As of 4:13 am MST. Today. 81°/60°. 1%. Thu 25 | Day. 81°. 1%. SW 14 mph. Plenty of sunshine. High 81F. Winds SW at 10 to 20 mph."
require 'active_support'
engine = Boxcars::Openai.new(max_tokens: 256)
calc = Boxcars::Calculator.new(engine: engine)
puts calc.run "what is pi to the forth power divided by 22.1?"
> Entering Calculator#run
what is pi to the forth power divided by 22.1?
RubyREPL: puts((Math::PI**4) / 22.1)
Answer: 4.407651178009159
{"status":"ok","answer":"4.407651178009159","explanation":"Answer: 4.407651178009159","code":"puts((Math::PI**4) / 22.1)"}
< Exiting Calculator#run
4.407651178009159
It is necessary to add gem ‘activesupport’ to call blank?.