forked from radanskoric/coding_agent
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.rb
More file actions
executable file
·38 lines (31 loc) · 1.09 KB
/
Copy pathrun.rb
File metadata and controls
executable file
·38 lines (31 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env ruby
# Load the gems and environment variables from .env file.
Dir.chdir(__dir__) do
require "bundler/setup"
require "dotenv/load"
end
require "ruby_llm"
require_relative "src/agent"
# Enable debug logging
# RubyLLM.logger.level = Logger::DEBUG
# Print available models
# begin
# puts "Checking available models..."
# uri = URI.parse("http://localhost:4000/v1/models")
# request = Net::HTTP::Get.new(uri)
# request["Authorization"] = "Bearer #{ENV.fetch('LOCAL_API_KEY')}"
# response = Net::HTTP.start(uri.hostname, uri.port) { |http| http.request(request) }
# puts "Models response: #{response.body}"
# rescue => e
# puts "Error checking models: #{e.message}"
# end
RubyLLM.configure do |config|
config.openai_api_key = ENV.fetch("LOCAL_API_KEY", nil)
config.openai_api_base = "http://localhost:4000"
# Add any other configuration options here
end
# Let's inspect the RubyLLM configuration
# puts "RubyLLM configuration:"
# puts "API Key: #{ENV.fetch('LOCAL_API_KEY', nil)[0..5]}..." if ENV.fetch('LOCAL_API_KEY', nil)
# puts "API Base: http://localhost:4000"
Agent.new.run