Merge pull request #503 from iceljc/bugfix/add-system-prompt
append image analysis prompt
This commit is contained in:
commit
1b89a267ea
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
namespace BotSharp.Core.Files.Hooks;
|
||||
|
||||
public class AttachmentProcessingHook : AgentHookBase
|
||||
|
|
@ -14,6 +15,20 @@ public class AttachmentProcessingHook : AgentHookBase
|
|||
_agentSettings = settings;
|
||||
}
|
||||
|
||||
public override void OnAgentLoaded(Agent agent)
|
||||
{
|
||||
var fileService = _services.GetRequiredService<IBotSharpFileService>();
|
||||
var conv = _services.GetRequiredService<IConversationService>();
|
||||
var hasConvFiles = fileService.HasConversationUserFiles(conv.ConversationId);
|
||||
|
||||
if (hasConvFiles)
|
||||
{
|
||||
agent.Instruction += "\r\n\r\nIf user wants to describe images or pdf files, please call load_attachment.";
|
||||
}
|
||||
|
||||
base.OnAgentLoaded(agent);
|
||||
}
|
||||
|
||||
public override bool OnFunctionsLoaded(List<FunctionDef> functions)
|
||||
{
|
||||
var fileService = _services.GetRequiredService<IBotSharpFileService>();
|
||||
|
|
|
|||
Loading…
Reference in a new issue