Merge pull request #135 from hchen2020/master
Define new InstructMessageModel.
This commit is contained in:
commit
33955865d9
|
|
@ -59,6 +59,21 @@ public partial class ConversationService
|
|||
}, onMessageReceived);
|
||||
return;
|
||||
}
|
||||
else if (fn.StopCompletion)
|
||||
{
|
||||
var message = new RoleDialogModel(AgentRole.Assistant, fn.Content)
|
||||
{
|
||||
CurrentAgentId = fn.CurrentAgentId,
|
||||
Channel = fn.Channel,
|
||||
ExecutionData = fn.ExecutionData,
|
||||
ExecutionResult = fn.ExecutionResult
|
||||
};
|
||||
|
||||
await HandleAssistantMessage(message, onMessageReceived);
|
||||
|
||||
_storage.Append(_conversationId, agent.Id, message);
|
||||
return;
|
||||
}
|
||||
|
||||
fn.Content = fn.FunctionArgs.Replace("\r", " ").Replace("\n", " ").Trim() + " => " + fn.ExecutionResult;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ using BotSharp.Abstraction.Conversations.Models;
|
|||
using BotSharp.Abstraction.Instructs;
|
||||
using BotSharp.Abstraction.Instructs.Models;
|
||||
using BotSharp.OpenAPI.ViewModels.Conversations;
|
||||
using BotSharp.OpenAPI.ViewModels.Instructs;
|
||||
|
||||
namespace BotSharp.OpenAPI.Controllers;
|
||||
|
||||
|
|
@ -23,7 +24,7 @@ public class InstructModeController : ControllerBase, IApiAdapter
|
|||
|
||||
[HttpPost("/instruct/{agentId}")]
|
||||
public async Task<InstructResult> NewConversation([FromRoute] string agentId,
|
||||
[FromBody] NewMessageModel input)
|
||||
[FromBody] InstructMessageModel input)
|
||||
{
|
||||
var response = new InstructResult();
|
||||
var instructor = _services.GetRequiredService<IInstructService>();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
using BotSharp.OpenAPI.ViewModels.Conversations;
|
||||
|
||||
namespace BotSharp.OpenAPI.ViewModels.Instructs;
|
||||
|
||||
public class InstructMessageModel : NewMessageModel
|
||||
{
|
||||
public string? TemplateName { get; set; }
|
||||
}
|
||||
Loading…
Reference in a new issue