diff --git a/bots/migrations/0113_botintegration_input_placeholder.py b/bots/migrations/0113_botintegration_input_placeholder.py new file mode 100644 index 000000000..ec6e52e68 --- /dev/null +++ b/bots/migrations/0113_botintegration_input_placeholder.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.3 on 2025-11-13 11:01 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("bots", "0112_alter_botintegration_slack_read_receipt_msg"), + ] + + operations = [ + migrations.AddField( + model_name="botintegration", + name="input_placeholder", + field=models.TextField(blank=True, default=""), + ), + ] diff --git a/bots/models/bot_integration.py b/bots/models/bot_integration.py index ae4807e0f..9b2e8e438 100644 --- a/bots/models/bot_integration.py +++ b/bots/models/bot_integration.py @@ -167,6 +167,7 @@ class BotIntegration(models.Model): ) by_line = models.TextField(blank=True, default="") + input_placeholder = models.TextField(blank=True, default="") descripton = models.TextField(blank=True, default="") conversation_starters = models.JSONField(default=list, blank=True) photo_url = CustomURLField(default="", blank=True) @@ -599,6 +600,7 @@ def get_web_widget_branding(self) -> dict: conversationStarters=self.conversation_starters, photoUrl=self.photo_url, websiteUrl=self.website_url, + inputPlaceholderText=self.input_placeholder, ) def translate(self, text: str) -> str: diff --git a/daras_ai_v2/bot_integration_widgets.py b/daras_ai_v2/bot_integration_widgets.py index 776eff93a..6bff37f29 100644 --- a/daras_ai_v2/bot_integration_widgets.py +++ b/daras_ai_v2/bot_integration_widgets.py @@ -428,6 +428,11 @@ def web_widget_config(bi: BotIntegration, user: AppUser | None, hostname: str | key=f"_bi_website_url_{bi.id}", value=bi.website_url, ) + bi.input_placeholder = gui.text_input( + "###### Message box placeholder", + key=f"_bi_input_placeholder_{bi.id}", + value=bi.input_placeholder, + ) gui.write("###### Conversation Starters") bi.conversation_starters = list(