-
-
Notifications
You must be signed in to change notification settings - Fork 634
Test/realtime chat #1034
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test/realtime chat #1034
Changes from 20 commits
7959fbf
de12724
01175d1
44357bf
8de7e69
2e45a66
13ed40b
50eeb13
4d9ce27
d05fa40
97f6dd7
9febf00
5fe29f6
c1004df
8b46e26
bd4f375
f35bf4d
a26f918
d703477
ed39786
1762675
c6f66b8
4b53875
684805c
9debbf7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,7 @@ public enum AgentField | |
| Instruction, | ||
| Function, | ||
| Template, | ||
| Link, | ||
| Response, | ||
| Sample, | ||
| LlmConfig, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,6 +46,12 @@ public class Agent | |
| [JsonIgnore] | ||
| public List<AgentTemplate> Templates { get; set; } = new(); | ||
|
|
||
| /// <summary> | ||
| /// Links that can be filled into parent prompt | ||
| /// </summary> | ||
| [JsonIgnore] | ||
| public List<AgentLink> Links { get; set; } = new(); | ||
|
|
||
| /// <summary> | ||
| /// Agent tasks | ||
| /// </summary> | ||
|
|
@@ -168,6 +174,8 @@ public static Agent Clone(Agent agent) | |
| Functions = agent.Functions, | ||
| Responses = agent.Responses, | ||
| Samples = agent.Samples, | ||
| Templates = agent.Templates, | ||
| Links = agent.Links, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed |
||
| Utilities = agent.Utilities, | ||
| McpTools = agent.McpTools, | ||
| Knowledges = agent.Knowledges, | ||
|
|
@@ -204,6 +212,12 @@ public Agent SetTemplates(List<AgentTemplate> templates) | |
| return this; | ||
| } | ||
|
|
||
| public Agent SetLinks(List<AgentLink> links) | ||
| { | ||
| Links = links ?? []; | ||
| return this; | ||
| } | ||
|
|
||
| public Agent SetTasks(List<AgentTask> tasks) | ||
| { | ||
| Tasks = tasks ?? []; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| namespace BotSharp.Abstraction.Agents.Models; | ||
|
|
||
| public class AgentLink : AgentPromptBase | ||
| { | ||
| public AgentLink() : base() | ||
| { | ||
| } | ||
|
|
||
| public AgentLink(string name, string content) : base(name, content) | ||
| { | ||
| } | ||
|
|
||
| public override string ToString() | ||
| { | ||
| return base.ToString(); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| namespace BotSharp.Abstraction.Agents.Models; | ||
|
|
||
| public class AgentPromptBase | ||
| { | ||
| public string Name { get; set; } | ||
| public string Content { get; set; } | ||
|
|
||
| public AgentPromptBase() | ||
|
Check warning on line 8 in src/Infrastructure/BotSharp.Abstraction/Agents/Models/AgentPromptBase.cs
|
||
| { | ||
|
|
||
| } | ||
|
|
||
| public AgentPromptBase(string name, string content) | ||
| { | ||
| Name = name; | ||
| Content = content; | ||
| } | ||
|
|
||
| public override string ToString() | ||
| { | ||
| return Name; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,17 @@ | ||
| namespace BotSharp.Abstraction.Agents.Models; | ||
|
|
||
| public class AgentTemplate | ||
| public class AgentTemplate : AgentPromptBase | ||
| { | ||
| public string Name { get; set; } | ||
| public string Content { get; set; } | ||
|
|
||
| public AgentTemplate() | ||
| public AgentTemplate() : base() | ||
| { | ||
|
|
||
| } | ||
|
|
||
| public AgentTemplate(string name, string content) | ||
| public AgentTemplate(string name, string content) : base(name, content) | ||
| { | ||
| Name = name; | ||
| Content = content; | ||
| } | ||
|
|
||
| public override string ToString() | ||
| { | ||
| return Name; | ||
| return base.ToString(); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| namespace BotSharp.Abstraction.VectorStorage.Models; | ||
|
|
||
| public class VectorCollectionDetails | ||
| { | ||
| [JsonPropertyName("status")] | ||
| public string Status { get; set; } | ||
|
|
||
| [JsonPropertyName("optimizer_status")] | ||
| public string OptimizerStatus { get; set; } | ||
|
|
||
| [JsonPropertyName("segments_count")] | ||
| public ulong SegmentsCount { get; set; } | ||
|
|
||
| [JsonPropertyName("vectors_count")] | ||
| public ulong VectorsCount { get; set; } | ||
|
|
||
| [JsonPropertyName("indexed_vectors_count")] | ||
| public ulong IndexedVectorsCount { get; set; } | ||
|
|
||
| [JsonPropertyName("points_count")] | ||
| public ulong PointsCount { get; set; } | ||
|
|
||
| [JsonPropertyName("inner_config")] | ||
| public VectorCollectionDetailConfig? InnerConfig { get; set; } | ||
|
|
||
| [JsonPropertyName("basic_info")] | ||
| public VectorCollectionConfig? BasicInfo { get; set; } | ||
| } | ||
|
|
||
| public class VectorCollectionDetailConfig | ||
| { | ||
| public VectorCollectionDetailConfigParam? Param { get; set; } | ||
| } | ||
|
|
||
| public class VectorCollectionDetailConfigParam | ||
| { | ||
| [JsonPropertyName("shard_number")] | ||
| public uint? ShardNumber { get; set; } | ||
|
|
||
| [JsonPropertyName("sharding_method")] | ||
| public string? ShardingMethod { get; set; } | ||
|
|
||
| [JsonPropertyName("replication_factor")] | ||
| public uint? ReplicationFactor { get; set; } | ||
|
|
||
| [JsonPropertyName("write_consistency_factor")] | ||
| public uint? WriteConsistencyFactor { get; set; } | ||
|
|
||
| [JsonPropertyName("read_fan_out_factor")] | ||
| public uint? ReadFanOutFactor { get; set; } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| namespace BotSharp.Core.Realtime.Models.Chat; | ||
|
|
||
| public class ChatSessionUpdate | ||
| { | ||
| public string RawResponse { get; set; } | ||
|
|
||
| public ChatSessionUpdate() | ||
| { | ||
|
|
||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| namespace BotSharp.Core.Realtime.Models.Options; | ||
|
|
||
| public class ChatSessionOptions | ||
| { | ||
| public int? BufferSize { get; set; } | ||
| public JsonSerializerOptions? JsonOptions { get; set; } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not necessary to use a dedicated fields to store the linked templates.
They can be stored in
Templatesfields.