Table of Contents

Class MarkdownCodeExtractorExtension

Namespace
GenerativeAI
Assembly
GenerativeAI.dll

Provides extension methods for extracting structured data, such as code blocks and JSON blocks, from markdown strings.

public static class MarkdownCodeExtractorExtension
Inheritance
MarkdownCodeExtractorExtension
Inherited Members

Methods

ExtractCodeBlocks(string)

Extracts code blocks from a given markdown string and returns them as a list of CodeBlock objects.

public static List<CodeBlock> ExtractCodeBlocks(this string markdown)

Parameters

markdown string

The markdown string from which to extract code blocks.

Returns

List<CodeBlock>

A list of CodeBlock objects representing the code blocks found in the markdown.

ExtractJsonBlocks(string)

Extracts JSON objects and arrays from a given markdown string and returns them as a list of JsonBlock objects.

public static List<JsonBlock> ExtractJsonBlocks(this string markdown)

Parameters

markdown string

The markdown string from which to extract JSON blocks.

Returns

List<JsonBlock>

A list of JsonBlock objects representing the JSON blocks (objects or arrays) found in the markdown.