Skip to content

Commit

Permalink
Fix/prompt studio bug fixes (#44)
Browse files Browse the repository at this point in the history
* Set default value for enforce type

* Implemented validation in add llm profile form

* Models changes in prompt studio core

* Bug fixes in prompt edit card

* Bug fixes and UI improvements in prompt studio
  • Loading branch information
tahierhussain authored Mar 2, 2024
1 parent 38682d7 commit 0cabd50
Show file tree
Hide file tree
Showing 17 changed files with 466 additions and 204 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Generated by Django 4.2.1 on 2024-02-29 10:30

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("prompt_studio", "0004_alter_toolstudioprompt_prompt"),
]

operations = [
migrations.AlterField(
model_name="toolstudioprompt",
name="enforce_type",
field=models.TextField(
blank=True,
choices=[
("Text", "Response sent as Text"),
("number", "Response sent as number"),
("email", "Response sent as email"),
("date", "Response sent as date"),
("boolean", "Response sent as boolean"),
("json", "Response sent as json"),
],
db_comment="Field to store the type in which the response to be returned.",
default="Text",
),
),
]
1 change: 1 addition & 0 deletions backend/prompt_studio/prompt_studio/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class Mode(models.TextChoices):
db_comment="Field to store the type in \
which the response to be returned.",
choices=EnforceType.choices,
default=EnforceType.TEXT,
)
prompt = models.TextField(
blank=True, db_comment="Field to store the prompt", unique=False
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Generated by Django 4.2.1 on 2024-03-02 07:30

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("prompt_studio_core", "0005_alter_customtool_default_profile_and_more"),
]

operations = [
migrations.AlterField(
model_name="customtool",
name="summarize_as_source",
field=models.BooleanField(
db_comment="Flag to use summarized content as source", default=False
),
),
migrations.AlterField(
model_name="customtool",
name="summarize_context",
field=models.BooleanField(
db_comment="Flag to summarize content", default=False
),
),
]
4 changes: 2 additions & 2 deletions backend/prompt_studio/prompt_studio_core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ class CustomTool(BaseModel):
db_comment="LLM Profile used for summarize",
)
summarize_context = models.BooleanField(
default=True, db_comment="Flag to summarize content"
default=False, db_comment="Flag to summarize content"
)
summarize_as_source = models.BooleanField(
default=True, db_comment="Flag to use summarized content as source"
default=False, db_comment="Flag to use summarized content as source"
)
summarize_prompt = models.TextField(
blank=True,
Expand Down
Loading

0 comments on commit 0cabd50

Please sign in to comment.