-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Speech and Copiliot: update titles to include language and saved run …
…name instead of input prompt
- Loading branch information
Showing
5 changed files
with
56 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
PublishedRun, | ||
PublishedRunVisibility, | ||
Workflow, | ||
SavedRun, | ||
) | ||
from celeryapp.tasks import send_integration_attempt_email | ||
from daras_ai.image_input import ( | ||
|
@@ -318,6 +319,24 @@ def related_workflows(self): | |
CompareText2ImgPage, | ||
] | ||
|
||
@classmethod | ||
def get_run_title(cls, sr: SavedRun, pr: PublishedRun) -> str: | ||
import langcodes | ||
|
||
try: | ||
lang = langcodes.Language.get( | ||
sr.state.get("user_language") or sr.state.get("asr_language") or "" | ||
).display_name() | ||
except (KeyError, langcodes.LanguageTagError): | ||
lang = None | ||
title = super().get_run_title(sr, pr) | ||
return " ".join(filter(None, [lang, title])) | ||
|
||
@classmethod | ||
def get_prompt_title(cls, state: dict) -> str | None: | ||
# don't show the input prompt in the run titles, instead show get_run_title() | ||
return None | ||
|
||
def preview_description(self, state: dict) -> str: | ||
return "Create customized chatbots from your own docs/PDF/webpages. Craft your own bot prompts using the creative GPT3, fast GPT 3.5-turbo or powerful GPT4 & optionally prevent hallucinations by constraining all answers to just your citations. Available as Facebook, Instagram, WhatsApp bots or via API. Add multi-lingual speech recognition and text-to-speech in 100+ languages and even video responses. Collect 👍🏾 👎🏽 feedback + see usage & retention graphs too! This is the workflow that powers https://Farmer.CHAT and it's yours to tweak." | ||
# return "Create an amazing, interactive AI videobot with just a GPT3 script + a video clip or photo. To host it on your own site or app, contact us at [email protected]" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters