-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Fix issue with resource reference types"
This reverts commit 0bcaa4b.
- Loading branch information
1 parent
0bcaa4b
commit 832a7f6
Showing
11 changed files
with
298 additions
and
650 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
namespace FoundationaLLM.Agent.Models.Resources | ||
{ | ||
/// <summary> | ||
/// Models the content of the agent reference store managed by the FoundationaLLM.Agent resource provider. | ||
/// </summary> | ||
public class AgentReferenceStore | ||
{ | ||
/// <summary> | ||
/// The list of all agents registered in the system. | ||
/// </summary> | ||
public required List<AgentReference> AgentReferences { get; set; } | ||
|
||
/// <summary> | ||
/// Creates a string-based dictionary of <see cref="AgentReference"/> values from the current object. | ||
/// </summary> | ||
/// <returns>The string-based dictionary of <see cref="AgentReference"/> values from the current object.</returns> | ||
public Dictionary<string, AgentReference> ToDictionary() => | ||
AgentReferences.ToDictionary<AgentReference, string>(ar => ar.Name); | ||
|
||
/// <summary> | ||
/// Creates a new instance of the <see cref="AgentReferenceStore"/> from a dictionary. | ||
/// </summary> | ||
/// <param name="dictionary">A string-based dictionary of <see cref="AgentReference"/> values.</param> | ||
/// <returns>The <see cref="AgentReferenceStore"/> object created from the dictionary.</returns> | ||
public static AgentReferenceStore FromDictionary(Dictionary<string, AgentReference> dictionary) => | ||
new() | ||
{ | ||
AgentReferences = [.. dictionary.Values] | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
namespace FoundationaLLM.DataSource.Models | ||
{ | ||
/// <summary> | ||
/// Models the content of the data source reference store managed by the FoundationaLLM.DataSource resource provider. | ||
/// </summary> | ||
public class DataSourceReferenceStore | ||
{ | ||
/// <summary> | ||
/// The list of all data sources registered in the system. | ||
/// </summary> | ||
public required List<DataSourceReference> DataSourceReferences { get; set; } | ||
/// <summary> | ||
/// The name of the default data source. | ||
/// </summary> | ||
public string? DefaultDataSourceName { get; set; } | ||
|
||
/// <summary> | ||
/// Creates a string-based dictionary of <see cref="DataSourceReference"/> values from the current object. | ||
/// </summary> | ||
/// <returns>The string-based dictionary of <see cref="DataSourceReference"/> values from the current object.</returns> | ||
public Dictionary<string, DataSourceReference> ToDictionary() => | ||
DataSourceReferences.ToDictionary<DataSourceReference, string>(ar => ar.Name); | ||
|
||
/// <summary> | ||
/// Creates a new instance of the <see cref="DataSourceReferenceStore"/> from a dictionary. | ||
/// </summary> | ||
/// <param name="dictionary">A string-based dictionary of <see cref="DataSourceReference"/> values.</param> | ||
/// <returns>The <see cref="DataSourceReferenceStore"/> object created from the dictionary.</returns> | ||
public static DataSourceReferenceStore FromDictionary(Dictionary<string, DataSourceReference> dictionary) => | ||
new() | ||
{ | ||
DataSourceReferences = [.. dictionary.Values] | ||
}; | ||
} | ||
} |
Oops, something went wrong.