Class: Antigravity::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/antigravity/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/antigravity/config.rb', line 13

def initialize
  @api_key = ENV["GEMINI_API_KEY"]
  @default_model = ENV["GEMINI_MODEL"] || ENV["ANTIGRAVITY_MODEL"] || "gemini-3.6-flash"
  @harness_path = ENV["ANTIGRAVITY_HARNESS_PATH"] || File.expand_path("~/.antigravity/bin/localharness")
  @log_level = :info

  # Timeouts: aggressive for dev, relax via ENV for production
  @timeout_llm       = (ENV["ANTIGRAVITY_TIMEOUT_LLM"]       || 40).to_i
  @timeout_ws        = (ENV["ANTIGRAVITY_TIMEOUT_WS"]        || 3).to_i
  @timeout_handshake = (ENV["ANTIGRAVITY_TIMEOUT_HANDSHAKE"] || 5).to_i
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



5
6
7
# File 'lib/antigravity/config.rb', line 5

def api_key
  @api_key
end

#default_modelObject

Returns the value of attribute default_model.



5
6
7
# File 'lib/antigravity/config.rb', line 5

def default_model
  @default_model
end

#harness_pathObject

Returns the value of attribute harness_path.



5
6
7
# File 'lib/antigravity/config.rb', line 5

def harness_path
  @harness_path
end

#log_levelObject

Returns the value of attribute log_level.



5
6
7
# File 'lib/antigravity/config.rb', line 5

def log_level
  @log_level
end

#timeout_handshakeObject

Timeouts (seconds) — aggressive for dev, override via ENV for prod. ANTIGRAVITY_TIMEOUT_LLM — per-message wait for LLM response (default: 20s) ANTIGRAVITY_TIMEOUT_WS — WebSocket connect/handshake (default: 3s) ANTIGRAVITY_TIMEOUT_HANDSHAKE — stdio binary handshake (default: 5s)



11
12
13
# File 'lib/antigravity/config.rb', line 11

def timeout_handshake
  @timeout_handshake
end

#timeout_llmObject

Timeouts (seconds) — aggressive for dev, override via ENV for prod. ANTIGRAVITY_TIMEOUT_LLM — per-message wait for LLM response (default: 20s) ANTIGRAVITY_TIMEOUT_WS — WebSocket connect/handshake (default: 3s) ANTIGRAVITY_TIMEOUT_HANDSHAKE — stdio binary handshake (default: 5s)



11
12
13
# File 'lib/antigravity/config.rb', line 11

def timeout_llm
  @timeout_llm
end

#timeout_wsObject

Timeouts (seconds) — aggressive for dev, override via ENV for prod. ANTIGRAVITY_TIMEOUT_LLM — per-message wait for LLM response (default: 20s) ANTIGRAVITY_TIMEOUT_WS — WebSocket connect/handshake (default: 3s) ANTIGRAVITY_TIMEOUT_HANDSHAKE — stdio binary handshake (default: 5s)



11
12
13
# File 'lib/antigravity/config.rb', line 11

def timeout_ws
  @timeout_ws
end

Instance Method Details

#api_key?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/antigravity/config.rb', line 25

def api_key?
  !@api_key.nil? && !@api_key.empty?
end