mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-03-29 19:31:38 +00:00
22 lines
552 B
C#
22 lines
552 B
C#
|
|
using System.Collections.Generic;
|
||
|
|
|
||
|
|
namespace AIStudio.Tools.PluginSystem.Assistants.DataModel;
|
||
|
|
|
||
|
|
internal static class AssistantComponentPropHelper
|
||
|
|
{
|
||
|
|
public static string ReadString(Dictionary<string, object> props, string key)
|
||
|
|
{
|
||
|
|
if (props.TryGetValue(key, out var value))
|
||
|
|
{
|
||
|
|
return value?.ToString() ?? string.Empty;
|
||
|
|
}
|
||
|
|
|
||
|
|
return string.Empty;
|
||
|
|
}
|
||
|
|
|
||
|
|
public static void WriteString(Dictionary<string, object> props, string key, string value)
|
||
|
|
{
|
||
|
|
props[key] = value ?? string.Empty;
|
||
|
|
}
|
||
|
|
}
|