Allow automation as an output mode supported by custom agents

This commit is contained in:
Debanjum Singh Solanky 2024-10-17 11:56:43 -07:00
parent c5e19b37ef
commit 884fe42602
3 changed files with 27 additions and 1 deletions

View file

@ -0,0 +1,24 @@
# Generated by Django 5.0.8 on 2024-10-17 18:13
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("database", "0067_alter_agent_style_icon"),
]
operations = [
migrations.AlterField(
model_name="agent",
name="output_modes",
field=django.contrib.postgres.fields.ArrayField(
base_field=models.CharField(
choices=[("text", "Text"), ("image", "Image"), ("automation", "Automation")], max_length=200
),
default=list,
size=None,
),
),
]

View file

@ -174,6 +174,7 @@ class Agent(BaseModel):
# These map to various ConversationCommand types
TEXT = "text"
IMAGE = "image"
AUTOMATION = "automation"
creator = models.ForeignKey(
KhojUser, on_delete=models.CASCADE, default=None, null=True, blank=True

View file

@ -347,12 +347,13 @@ tool_descriptions_for_llm = {
mode_descriptions_for_llm = {
ConversationCommand.Image: "Use this if the user is requesting you to generate a picture based on their description.",
ConversationCommand.Automation: "Use this if the user is requesting a response at a scheduled date or time.",
ConversationCommand.Automation: "Use this if you are confident the user is requesting a response at a scheduled date, time and frequency",
ConversationCommand.Text: "Use this if the other response modes don't seem to fit the query.",
}
mode_descriptions_for_agent = {
ConversationCommand.Image: "Agent can generate image in response.",
ConversationCommand.Automation: "Agent can schedule a task to run at a scheduled date, time and frequency in response.",
ConversationCommand.Text: "Agent can generate text in response.",
}