Merge pull request #931 from iceljc/master

get template name from state
This commit is contained in:
iceljc 2025-03-11 10:23:03 -05:00 committed by GitHub
commit 4b867909a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -32,6 +32,8 @@ public class InstructionLogHook : InstructHookBase
var state = _services.GetRequiredService<IConversationStateService>();
var user = db.GetUserById(_user.Id);
var templateName = response.TemplateName ?? state.GetState("instruct_template_name") ?? null;
db.SaveInstructionLogs(new List<InstructionLogModel>
{
new InstructionLogModel
@ -39,7 +41,7 @@ public class InstructionLogHook : InstructHookBase
AgentId = response.AgentId,
Provider = response.Provider,
Model = response.Model,
TemplateName = response.TemplateName,
TemplateName = !string.IsNullOrWhiteSpace(templateName) ? templateName : null,
UserMessage = response.UserMessage,
SystemInstruction = response.SystemInstruction,
CompletionText = response.CompletionText,