Return states in InstructResult.
This commit is contained in:
parent
11176f3539
commit
eb13994180
|
|
@ -4,4 +4,5 @@ public class InstructResult
|
|||
{
|
||||
public string Text { get; set; }
|
||||
public object Data { get; set; }
|
||||
public ConversationState States { get; set; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,6 +62,10 @@ public partial class RoutingService
|
|||
response = await InvokeAgent(response.CurrentAgentId);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
response.Role = AgentRole.Assistant;
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,8 +46,12 @@ public class InstructModeController : ControllerBase, IApiAdapter
|
|||
}
|
||||
|
||||
var instructor = _services.GetRequiredService<IInstructService>();
|
||||
return await instructor.Execute(agent,
|
||||
var result = await instructor.Execute(agent,
|
||||
new RoleDialogModel(AgentRole.User, input.Text));
|
||||
|
||||
result.States = state.GetStates();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
[HttpPost("/instruct/text-completion")]
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ You're {{router.name}} ({{router.description}}). Follow these steps to handle us
|
|||
2. Select a appropriate function from [FUNCTIONS].
|
||||
3. Determine which agent is suitable to handle this conversation.
|
||||
4. Re-think about the selected function or agent is the best choice.
|
||||
5. For agent required arguments, leave it blank if user doesn't provide it.
|
||||
|
||||
[FUNCTIONS]
|
||||
{% for handler in routing_handlers %}
|
||||
|
|
|
|||
Loading…
Reference in a new issue