Class: Foobara::Ai::AnswerBot::DomainMappers::ServiceToChatCompletionCommand
- Inherits:
-
DomainMapper
- Object
- DomainMapper
- Foobara::Ai::AnswerBot::DomainMappers::ServiceToChatCompletionCommand
- Defined in:
- foobara-ai-1.0.4/src/foobara/ai/answer_bot/domain_mappers/service_to_command.rb
Constant Summary
Constants included from TruncatedInspect
Instance Method Summary collapse
Methods inherited from DomainMapper
applicable?, applicable_score, #execute, foobara_on_register, from, #from, from_type, install!, map, map!, matches?, to, to_type
Methods included from TruncatedInspect
Methods included from Concern
foobara_class_methods_module_for, foobara_concern?, included
Instance Method Details
#map ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'src/foobara/ai/answer_bot/domain_mappers/service_to_command.rb', line 12 def map case service when Types::ServiceEnum::OPEN_AI Ai::OpenAiApi::CreateChatCompletion when Types::ServiceEnum::ANTHROPIC Ai::AnthropicApi::CreateMessage when Types::ServiceEnum::OLLAMA Ai::OllamaApi::GenerateChatCompletion else # :nocov: raise "Unknown service: #{service}" # :nocov: end end |