Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
iamjoel committed Sep 13, 2024
2 parents 6a91e0d + 258d39d commit 7a49f29
Show file tree
Hide file tree
Showing 273 changed files with 2,231 additions and 1,312 deletions.
12 changes: 6 additions & 6 deletions api/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def reset_email(email, new_email, email_confirm):
)
@click.confirmation_option(
prompt=click.style(
"Are you sure you want to reset encrypt key pair?" " this operation cannot be rolled back!", fg="red"
"Are you sure you want to reset encrypt key pair? this operation cannot be rolled back!", fg="red"
)
)
def reset_encrypt_key_pair():
Expand All @@ -131,7 +131,7 @@ def reset_encrypt_key_pair():

click.echo(
click.style(
"Congratulations! " "the asymmetric key pair of workspace {} has been reset.".format(tenant.id),
"Congratulations! The asymmetric key pair of workspace {} has been reset.".format(tenant.id),
fg="green",
)
)
Expand Down Expand Up @@ -275,8 +275,7 @@ def migrate_knowledge_vector_database():
for dataset in datasets:
total_count = total_count + 1
click.echo(
f"Processing the {total_count} dataset {dataset.id}. "
+ f"{create_count} created, {skipped_count} skipped."
f"Processing the {total_count} dataset {dataset.id}. {create_count} created, {skipped_count} skipped."
)
try:
click.echo("Create dataset vdb index: {}".format(dataset.id))
Expand Down Expand Up @@ -411,7 +410,8 @@ def migrate_knowledge_vector_database():
try:
click.echo(
click.style(
f"Start to created vector index with {len(documents)} documents of {segments_count} segments for dataset {dataset.id}.",
f"Start to created vector index with {len(documents)} documents of {segments_count}"
f" segments for dataset {dataset.id}.",
fg="green",
)
)
Expand Down Expand Up @@ -593,7 +593,7 @@ def create_tenant(email: str, language: Optional[str] = None, name: Optional[str

click.echo(
click.style(
"Congratulations! Account and tenant created.\n" "Account: {}\nPassword: {}".format(email, new_password),
"Congratulations! Account and tenant created.\nAccount: {}\nPassword: {}".format(email, new_password),
fg="green",
)
)
Expand Down
6 changes: 3 additions & 3 deletions api/configs/feature/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,12 @@ class EndpointConfig(BaseSettings):
)

SERVICE_API_URL: str = Field(
description="Service API Url prefix." "used to display Service API Base Url to the front-end.",
description="Service API Url prefix. used to display Service API Base Url to the front-end.",
default="",
)

APP_WEB_URL: str = Field(
description="WebApp Url prefix." "used to display WebAPP API Base Url to the front-end.",
description="WebApp Url prefix. used to display WebAPP API Base Url to the front-end.",
default="",
)

Expand Down Expand Up @@ -281,7 +281,7 @@ class LoggingConfig(BaseSettings):
"""

LOG_LEVEL: str = Field(
description="Log output level, default to INFO." "It is recommended to set it to ERROR for production.",
description="Log output level, default to INFO. It is recommended to set it to ERROR for production.",
default="INFO",
)

Expand Down
2 changes: 1 addition & 1 deletion api/configs/packaging/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class PackagingInfo(BaseSettings):

CURRENT_VERSION: str = Field(
description="Dify version",
default="0.8.0",
default="0.8.2",
)

COMMIT_SHA: str = Field(
Expand Down
24 changes: 8 additions & 16 deletions api/controllers/console/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,15 @@ def post(self):

site = app.site
if not site:
desc = args["desc"] if args["desc"] else ""
copy_right = args["copyright"] if args["copyright"] else ""
privacy_policy = args["privacy_policy"] if args["privacy_policy"] else ""
custom_disclaimer = args["custom_disclaimer"] if args["custom_disclaimer"] else ""
desc = args["desc"] or ""
copy_right = args["copyright"] or ""
privacy_policy = args["privacy_policy"] or ""
custom_disclaimer = args["custom_disclaimer"] or ""
else:
desc = site.description if site.description else args["desc"] if args["desc"] else ""
copy_right = site.copyright if site.copyright else args["copyright"] if args["copyright"] else ""
privacy_policy = (
site.privacy_policy if site.privacy_policy else args["privacy_policy"] if args["privacy_policy"] else ""
)
custom_disclaimer = (
site.custom_disclaimer
if site.custom_disclaimer
else args["custom_disclaimer"]
if args["custom_disclaimer"]
else ""
)
desc = site.description or args["desc"] or ""
copy_right = site.copyright or args["copyright"] or ""
privacy_policy = site.privacy_policy or args["privacy_policy"] or ""
custom_disclaimer = site.custom_disclaimer or args["custom_disclaimer"] or ""

recommended_app = RecommendedApp.query.filter(RecommendedApp.app_id == args["app_id"]).first()

Expand Down
8 changes: 2 additions & 6 deletions api/controllers/console/app/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,10 @@ def post(self, app_model):
and app_model.workflow.features_dict
):
text_to_speech = app_model.workflow.features_dict.get("text_to_speech")
voice = args.get("voice") if args.get("voice") else text_to_speech.get("voice")
voice = args.get("voice") or text_to_speech.get("voice")
else:
try:
voice = (
args.get("voice")
if args.get("voice")
else app_model.app_model_config.text_to_speech_dict.get("voice")
)
voice = args.get("voice") or app_model.app_model_config.text_to_speech_dict.get("voice")
except Exception:
voice = None
response = AudioService.transcript_tts(app_model=app_model, text=text, message_id=message_id, voice=voice)
Expand Down
Loading

0 comments on commit 7a49f29

Please sign in to comment.