-
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
* Refactor PromptClientInput to accept string array for prompt Updated the `PromptClientInput` method to accept a string array instead of a single string. This change ensures that multiple prompts can be handled, improving input flexibility and client communication. Additionally, modified related method calls to maintain consistency with the new input type. * Refactor PromptClientInput to support parsed result and errors 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; | ||
} | ||
} |