Class MessageExtension
- Namespace
- AutoGen.DotnetInteractive.Extension
- Assembly
- AutoGen.DotnetInteractive.dll
public static class MessageExtension
- Inheritance
-
MessageExtension
- Inherited Members
Methods
ExtractCodeBlock(IMessage, string, string)
Extract a single code block from a message. If the message contains multiple code blocks, only the first one will be returned.
public static string? ExtractCodeBlock(this IMessage message, string codeBlockPrefix, string codeBlockSuffix)
Parameters
message
IMessagecodeBlockPrefix
stringcode block prefix, e.g. ```csharp
codeBlockSuffix
stringcode block suffix, e.g. ```
Returns
ExtractCodeBlocks(IMessage, string, string)
Extract all code blocks from a message.
public static IEnumerable<string> ExtractCodeBlocks(this IMessage message, string codeBlockPrefix, string codeBlockSuffix)
Parameters
message
IMessagecodeBlockPrefix
stringcode block prefix, e.g. ```csharp
codeBlockSuffix
stringcode block suffix, e.g. ```