Table of Contents

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 IMessage
codeBlockPrefix string

code block prefix, e.g. ```csharp

codeBlockSuffix string

code block suffix, e.g. ```

Returns

string

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 IMessage
codeBlockPrefix string

code block prefix, e.g. ```csharp

codeBlockSuffix string

code block suffix, e.g. ```

Returns

IEnumerable<string>