Class: LanggraphPlatform::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/langgraph_platform/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key: nil, base_url: nil) ⇒ Configuration

Returns a new instance of Configuration.



5
6
7
8
9
10
11
# File 'lib/langgraph_platform/configuration.rb', line 5

def initialize(api_key: nil, base_url: nil)
  @api_key = api_key || ENV.fetch('LANGGRAPH_API_KEY', nil)
  @base_url = base_url || ENV['LANGGRAPH_BASE_URL'] || 'https://api.langchain.com'
  @timeout = 30
  @retries = 3
  @user_agent = "langgraph-platform-ruby/#{VERSION}"
end

Instance Attribute Details

#api_key ⇒ Object

Returns the value of attribute api_key.



3
4
5
# File 'lib/langgraph_platform/configuration.rb', line 3

def api_key
  @api_key
end

#base_url ⇒ Object

Returns the value of attribute base_url.



3
4
5
# File 'lib/langgraph_platform/configuration.rb', line 3

def base_url
  @base_url
end

#retries ⇒ Object

Returns the value of attribute retries.



3
4
5
# File 'lib/langgraph_platform/configuration.rb', line 3

def retries
  @retries
end

#timeout ⇒ Object

Returns the value of attribute timeout.



3
4
5
# File 'lib/langgraph_platform/configuration.rb', line 3

def timeout
  @timeout
end

#user_agent ⇒ Object

Returns the value of attribute user_agent.



3
4
5
# File 'lib/langgraph_platform/configuration.rb', line 3

def user_agent
  @user_agent
end

Instance Method Details

#valid? ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/langgraph_platform/configuration.rb', line 13

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