-
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
Updated PromptClientInput to handle parsed input results and return error messages instead of raw strings. Introduced ParsedInputResult<TResult> class to encapsulate parsing results and errors, enhancing client validation and feedback mechanism.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace SharedLibraryCore.Helpers; | ||
|
||
public class ParsedInputResult<TResult> | ||
{ | ||
public TResult? Result { get; set; } | ||
Check warning on line 7 in SharedLibraryCore/Helpers/ParsedInputResult.cs GitHub Actions / build_pack
Check warning on line 7 in SharedLibraryCore/Helpers/ParsedInputResult.cs GitHub Actions / build_pack
Check warning on line 7 in SharedLibraryCore/Helpers/ParsedInputResult.cs GitHub Actions / build
Check warning on line 7 in SharedLibraryCore/Helpers/ParsedInputResult.cs GitHub Actions / build
|
||
public string? RawInput { get; set; } | ||
Check warning on line 8 in SharedLibraryCore/Helpers/ParsedInputResult.cs GitHub Actions / build_pack
Check warning on line 8 in SharedLibraryCore/Helpers/ParsedInputResult.cs GitHub Actions / build_pack
Check warning on line 8 in SharedLibraryCore/Helpers/ParsedInputResult.cs GitHub Actions / build
Check warning on line 8 in SharedLibraryCore/Helpers/ParsedInputResult.cs GitHub Actions / build
|
||
public List<string> ErrorMessages { get; set; } = []; | ||
|
||
public ParsedInputResult<TResult> WithError(string errorMessage) | ||
{ | ||
ErrorMessages.Add(errorMessage); | ||
return this; | ||
} | ||
} |