I am building a bot that takes inputs from users and performs action. Now I want it to differentiate between commands that contain single task and multiple tasks.
How can I make this a reality? Should I utilize prompting but there are infinite types of commands and infinite ways they can be represented, I doubt if an LLM will be able to comprehend it across all commands.
Or should I train a model or fine-tune an LLM to comprehend it but yet again the dataset would be too big and there will be infinite ways a single command can be represented.
What do you guys suggest I do?
I tried prompting GPT-3.5 with the following:
Carefully, analyze the request for multiple tasks and generate JSON output for all requests in below format:
When there are multiple tasks:
{{ 'task': the task, 'type': 'multiple_task' }}
When there is a single task:
{{'task': the task, 'type': 'single_task'}}
### Example Analysis:
For the request: "how many executions happen with success and fail so far"
This is considered a multiple task because it is asking for two distinct counts:
1. The count of successful executions.
2. The count of failed executions.
Therefore, the JSON output for this request should indicate multiple tasks.
Example JSON output for this request:
{
"requests": {{
'task': 'how many execution happen with success and fail so far',
'type': 'multiple_task'
}}
}
Now do the same for the following user request.
User request:
It gives some correct responses but when I send :
When a New google calendar event is created, post a message to general channel in slack plus sync it to Salesforce leads
It gives me:
{
"requests": [
{
"task": "When a New google calendar event is created, post a message to general channel in slack",
"type": "single_task"
},
{
"task": "sync it to Salesforce leads",
"type": "single_task"
}
]
}