Class: Foobara::Ai::AnswerBot::DomainMappers::AnthropicApi::QuestionToCreateMessage
- Inherits:
-
DomainMapper
- Object
- DomainMapper
- Foobara::Ai::AnswerBot::DomainMappers::AnthropicApi::QuestionToCreateMessage
show all
- Defined in:
- foobara-ai-1.0.4/src/foobara/ai/answer_bot/domain_mappers/anthropic_api/question_to_create_message.rb
Constant Summary
TruncatedInspect::MAX_LENGTH
Instance Method Summary
collapse
applicable?, applicable_score, #execute, foobara_on_register, from, #from, from_type, install!, map, map!, matches?, to, to_type
#inspect, truncating
Methods included from Concern
foobara_class_methods_module_for, foobara_concern?, included
Instance Method Details
#instructions ⇒ Object
41
42
43
|
# File 'src/foobara/ai/answer_bot/domain_mappers/anthropic_api/question_to_create_message.rb', line 41
def instructions
from[:instructions]
end
|
#map ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'src/foobara/ai/answer_bot/domain_mappers/anthropic_api/question_to_create_message.rb', line 17
def map
{
system: instructions,
messages: [
{
role: "user",
content: question
}
]
}.tap do |inputs|
if model
inputs[:model] = model
end
end
end
|
#model ⇒ Object
37
38
39
|
# File 'src/foobara/ai/answer_bot/domain_mappers/anthropic_api/question_to_create_message.rb', line 37
def model
from[:model]
end
|
#question ⇒ Object
33
34
35
|
# File 'src/foobara/ai/answer_bot/domain_mappers/anthropic_api/question_to_create_message.rb', line 33
def question
from[:question]
end
|