forked from SciSharp/BotSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCrontabItem.cs
More file actions
49 lines (36 loc) · 1.37 KB
/
CrontabItem.cs
File metadata and controls
49 lines (36 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
namespace BotSharp.Abstraction.Crontab.Models;
public class CrontabItem : ScheduleTaskArgs
{
[JsonPropertyName("user_id")]
public string UserId { get; set; } = null!;
[JsonPropertyName("agent_id")]
public string AgentId { get; set; } = null!;
[JsonPropertyName("conversation_id")]
public string ConversationId { get; set; } = null!;
[JsonPropertyName("execution_result")]
public string ExecutionResult { get; set; } = null!;
[JsonPropertyName("execution_count")]
public int ExecutionCount { get; set; }
[JsonPropertyName("max_execution_count")]
public int MaxExecutionCount { get; set; }
[JsonPropertyName("expire_seconds")]
public int ExpireSeconds { get; set; } = 60;
[JsonPropertyName("last_execution_time")]
public DateTime? LastExecutionTime { get; set; }
[JsonPropertyName("created_time")]
public DateTime CreatedTime { get; set; } = DateTime.UtcNow;
[JsonPropertyName("trigger_type")]
public CronTabItemTriggerType TriggerType { get; set; } = CronTabItemTriggerType.BackgroundWatcher;
[JsonPropertyName("reentry_protection")]
public bool ReentryProtection { get; set; }
public override string ToString()
{
return $"{Title}: {Description} [AgentId: {AgentId}, UserId: {UserId}]";
}
}
public enum CronTabItemTriggerType
{
BackgroundWatcher,
OpenAPI,
MessageQueue
}