use crate::engine::SymbolicAnswer;
use crate::event_log::EventLog;
use crate::solver_handler_docs::try_docs_method_explanation;
use crate::solver_handler_how::{try_how_it_works, try_how_to_procedure};
use crate::solver_handler_units::try_incompatible_units;
use crate::solver_handlers::{
try_algorithm, try_arithmetic, try_brainstorming_request, try_calendar_reasoning,
try_capabilities, try_clarification, try_compound_interest, try_concept_lookup,
try_conversation_memory, try_conversation_topic_request, try_coreference_request,
try_definition_merge, try_execution_failure, try_fact_lookup, try_http_fetch, try_ill_formed,
try_javascript_execution, try_meta_explanation, try_network_query, try_numeric_list,
try_opinion_question, try_program_synthesis, try_proof_request, try_punctuation_only_prompt,
try_research_comparison_table, try_roleplay_request, try_shell_refusal,
try_software_project_followup, try_software_project_request, try_source_conflict,
try_source_refresh, try_summarization_request, try_text_manipulation, try_translation,
try_url_navigate, try_web_search, try_who_is_question, try_write_script,
};
use crate::solver_handlers_policy::{try_kupi_slona, try_physical_action_question};
pub type SpecializedHandler = fn(&str, &str, &mut EventLog) -> Option<SymbolicAnswer>;
fn handle_arithmetic(
prompt: &str,
_normalized: &str,
log: &mut EventLog,
) -> Option<SymbolicAnswer> {
try_arithmetic(prompt, log)
}
fn handle_javascript_execution(
prompt: &str,
_normalized: &str,
log: &mut EventLog,
) -> Option<SymbolicAnswer> {
try_javascript_execution(prompt, log)
}
fn handle_concept_lookup(
prompt: &str,
_normalized: &str,
log: &mut EventLog,
) -> Option<SymbolicAnswer> {
try_concept_lookup(prompt, log)
}
pub const SPECIALIZED_HANDLERS: &[(&str, SpecializedHandler)] = &[
("http_fetch", try_http_fetch),
("url_navigate", try_url_navigate),
("web_search", try_web_search),
("research_comparison_table", try_research_comparison_table),
("docs_method_explanation", try_docs_method_explanation),
("procedural_how_to", try_how_to_procedure),
("conversation_memory", try_conversation_memory),
("software_project_followup", try_software_project_followup),
("summarization", try_summarization_request),
("text_manipulation", try_text_manipulation),
("brainstorming", try_brainstorming_request),
("conversation_topic", try_conversation_topic_request),
("fact_lookup", try_fact_lookup),
("coreference", try_coreference_request),
("roleplay", try_roleplay_request),
("translation", try_translation),
("capabilities", try_capabilities),
("calendar_reasoning", try_calendar_reasoning),
("compound_interest", try_compound_interest),
("numeric_list", try_numeric_list),
("arithmetic", handle_arithmetic),
("javascript_execution", handle_javascript_execution),
("definition_merge", try_definition_merge),
("concept_lookup", handle_concept_lookup),
("who_is", try_who_is_question),
("how_it_works", try_how_it_works),
("meta_explanation", try_meta_explanation),
("network_query", try_network_query),
("execution_failure", try_execution_failure),
("write_script", try_write_script),
("program_synthesis", try_program_synthesis),
("software_project", try_software_project_request),
("algorithm", try_algorithm),
("source_refresh", try_source_refresh),
("source_conflict", try_source_conflict),
("clarification", try_clarification),
("punctuation_only_prompt", try_punctuation_only_prompt),
("ill_formed", try_ill_formed),
("physical_action_question", try_physical_action_question),
("kupi_slona", try_kupi_slona),
("shell_refusal", try_shell_refusal),
("proof_request", try_proof_request),
("opinion_question", try_opinion_question),
("incompatible_units", try_incompatible_units),
];