Class: ActiveAgent::Providers::Common::Responses::Prompt
- Defined in:
- lib/active_agent/providers/common/responses/prompt.rb
Overview
Response model for prompt/completion responses
This class represents responses from conversational/completion endpoints. It includes the generated messages, the original context, raw API data, and usage statistics.
Example
response = PromptResponse.new(
context: context_hash,
messages: [],
raw_response: { "usage" => { "prompt_tokens" => 10 } }
)
response. #=> <Message>
response.prompt_tokens #=> 10
response.usage #=> { "prompt_tokens" => 10, ... }
Instance Attribute Summary
Attributes inherited from Base
#context, #raw_request, #raw_response, #usages
Instance Method Summary collapse
-
#message ⇒ Object
The most recent message in the conversational stack.
Methods inherited from Base
#finish_reason, #id, #initialize, #instructions, #model, #success?, #usage
Methods inherited from BaseModel
#<=>, #==, attribute, #deep_compact, #deep_dup, delegate_attributes, drop_attributes, inherited, #initialize, #inspect, keys, #merge!, required_attributes, #serialize, #to_h, #to_hash
Constructor Details
This class inherits a constructor from ActiveAgent::Providers::Common::Responses::Base
Instance Method Details
#message ⇒ Object
The most recent message in the conversational stack
35 36 37 |
# File 'lib/active_agent/providers/common/responses/prompt.rb', line 35 def .last end |