diff --git a/flexus_client_kit/ckit_integrations_db.py b/flexus_client_kit/ckit_integrations_db.py index ee572049..8a346ad3 100644 --- a/flexus_client_kit/ckit_integrations_db.py +++ b/flexus_client_kit/ckit_integrations_db.py @@ -64,6 +64,18 @@ async def _init_widget(rcx, setup): integr_prompt=fi_widget.PRINT_WIDGET_PROMPT, )) + elif name == "ask_questions": + from flexus_client_kit.integrations import fi_question + async def _init_question(rcx, setup): + return None + result.append(IntegrationRecord( + integr_name=name, + integr_tools=[fi_question.ASK_QUESTIONS_TOOL], + integr_init=_init_question, + integr_setup_handlers=lambda obj, rcx: [rcx.on_tool_call("ask_questions")(fi_question.handle_ask_questions)], + integr_prompt=fi_question.ASK_QUESTIONS_PROMPT, + )) + elif name == "gmail": from flexus_client_kit.integrations import fi_gmail async def _init_gmail(rcx, setup): diff --git a/flexus_client_kit/integrations/fi_question.py b/flexus_client_kit/integrations/fi_question.py index 36cadc89..4f43d104 100644 --- a/flexus_client_kit/integrations/fi_question.py +++ b/flexus_client_kit/integrations/fi_question.py @@ -2,6 +2,23 @@ from flexus_client_kit import ckit_cloudtool +ASK_QUESTIONS_PROMPT = """ +## Asking Questions + +When asking the user to choose from options, use `ask_questions` instead of numbered lists. This renders interactive UI. + +All questions appear together with a single "Send" button. +Do not call multiple `ask_questions` and try not to mix with other actions and tools. + +Bad usage (don't do this): +- Single yes/no question like "Does this match what you want?" + +Good usage: +- Initial requirements gathering (multiple questions at once) +- Collecting several configuration options together +""" + + ASK_QUESTIONS_TOOL = ckit_cloudtool.CloudTool( strict=False, name="ask_questions", diff --git a/flexus_simple_bots/karen/karen_bot.py b/flexus_simple_bots/karen/karen_bot.py index 6b59a534..442a5b6c 100644 --- a/flexus_simple_bots/karen/karen_bot.py +++ b/flexus_simple_bots/karen/karen_bot.py @@ -62,6 +62,7 @@ "skills", "flexus_policy_document", "print_widget", + "ask_questions", "erp[meta, data, crud, csv_import]", "crm[manage_contact, manage_deal, log_activity, verify_email]", "magic_desk", diff --git a/flexus_simple_bots/karen/karen_install.py b/flexus_simple_bots/karen/karen_install.py index 36dcf903..62b1c7b2 100644 --- a/flexus_simple_bots/karen/karen_install.py +++ b/flexus_simple_bots/karen/karen_install.py @@ -21,7 +21,7 @@ TOOLS_DEFAULT = { "flexus_policy_document", "mongo_store", "flexus_fetch_skill", "print_widget", - "crm_automation", "flexus_schedule", + "ask_questions", "crm_automation", "flexus_schedule", "shopify", "shopify_cart", "erp_table_meta", "erp_table_data", "erp_table_crud", "erp_csv_import", "repo_reader", "support_collection_status", "explore_a_question", @@ -33,7 +33,7 @@ TOOLS_SUPPORT_AND_SALES = { "flexus_policy_document", "mongo_store", "flexus_fetch_skill", - "product_catalog", "shopify_cart", + "ask_questions", "product_catalog", "shopify_cart", "manage_crm_contact", "manage_crm_deal", "log_crm_activity", "verify_email", "email_reply", "magic_desk", "slack", "telegram", "discord", diff --git a/flexus_simple_bots/karen/karen_prompts.py b/flexus_simple_bots/karen/karen_prompts.py index 8eaa6915..d5752959 100644 --- a/flexus_simple_bots/karen/karen_prompts.py +++ b/flexus_simple_bots/karen/karen_prompts.py @@ -131,6 +131,11 @@ * Populated by External Data Source (such as web crawler, unstructured ingest) * Searchable by calling flexus_vector_search() that gives you snippets as search results, you normally follow up with a flexus_read_original() call to read more text around the snippet + + +## Gathering Requirements + +When you need to gather requirements or improve the knowledge base, fetch the `collect-support-knowledge-base` skill. """ # The user asks how to populate it, fetch the `setting-up-external-knowledge-base` skill for guidance.