instruct/agentId interface add logId response
This commit is contained in:
parent
e1dc28beef
commit
5783d28100
|
|
@ -9,4 +9,5 @@ public class InstructResponseModel
|
|||
public string UserMessage { get; set; } = default!;
|
||||
public string? SystemInstruction { get; set; }
|
||||
public string CompletionText { get; set; } = default!;
|
||||
public string LogId { get; set; } = default!;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,4 +10,7 @@ public class InstructResult : ITrackableMessage
|
|||
[JsonPropertyName("template")]
|
||||
public string? Template { get; set; }
|
||||
public Dictionary<string, string>? States { get; set; } = new();
|
||||
|
||||
[JsonPropertyName("log_id")]
|
||||
public string LogId { get; set; } = default!;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -128,12 +128,14 @@ public partial class InstructService
|
|||
response.Text = result;
|
||||
}
|
||||
|
||||
response.LogId = Guid.NewGuid().ToString();
|
||||
// After completion hooks
|
||||
foreach (var hook in hooks)
|
||||
{
|
||||
await hook.AfterCompletion(agent, response);
|
||||
await hook.OnResponseGenerated(new InstructResponseModel
|
||||
{
|
||||
LogId = response.LogId,
|
||||
AgentId = agentId,
|
||||
Provider = provider,
|
||||
Model = model,
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ public class InstructionLogHook : InstructHookBase
|
|||
{
|
||||
new InstructionLogModel
|
||||
{
|
||||
Id = response.LogId,
|
||||
AgentId = response.AgentId,
|
||||
Provider = response.Provider,
|
||||
Model = response.Model,
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ public class InstructionLogDocument : MongoBase
|
|||
{
|
||||
return new InstructionLogDocument
|
||||
{
|
||||
Id = log.Id,
|
||||
AgentId = log.AgentId,
|
||||
Provider = log.Provider,
|
||||
Model = log.Model,
|
||||
|
|
|
|||
Loading…
Reference in a new issue