Class: OllamaAgent::Providers::Base::Response

Inherits:
Data
  • Object
show all
Defined in:
lib/ollama_agent/providers/base.rb

Overview

Unified response wrapper returned by all providers.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



28
29
30
# File 'lib/ollama_agent/providers/base.rb', line 28

def message
  @message
end

#modelObject (readonly)

Returns the value of attribute model

Returns:

  • (Object)

    the current value of model



28
29
30
# File 'lib/ollama_agent/providers/base.rb', line 28

def model
  @model
end

#providerObject (readonly)

Returns the value of attribute provider

Returns:

  • (Object)

    the current value of provider



28
29
30
# File 'lib/ollama_agent/providers/base.rb', line 28

def provider
  @provider
end

#usageObject (readonly)

Returns the value of attribute usage

Returns:

  • (Object)

    the current value of usage



28
29
30
# File 'lib/ollama_agent/providers/base.rb', line 28

def usage
  @usage
end

Instance Method Details

#contentObject



37
38
39
# File 'lib/ollama_agent/providers/base.rb', line 37

def content
  message&.fetch(:content, nil)
end

#tool_callsObject



33
34
35
# File 'lib/ollama_agent/providers/base.rb', line 33

def tool_calls
  message&.fetch(:tool_calls, nil) || []
end

#total_tokensObject



29
30
31
# File 'lib/ollama_agent/providers/base.rb', line 29

def total_tokens
  usage&.fetch(:total_tokens, 0) || 0
end