Boxcars

ruby
ai
code
llm
Author

geeknees

Published

July 16, 2023

https://github.com/BoxcarsAI/boxcars

require 'boxcars'
true
# 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(256)
calc = Boxcars::Calculator.new(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?.

https://github.com/BoxcarsAI/boxcars/blob/c92c1f29aac6485903731ad8d8a2cbbb1c2a7b24/lib/boxcars/ruby_repl.rb#L22