Blocks API Reference

This page provides auto-generated API documentation from source docstrings. When reading raw markdown, refer to the quick reference below.

Quick Reference

Base Classes

ClassImportDescription
BaseBlockfrom sdg_hub import BaseBlockAbstract base class for all blocks with Pydantic validation
BlockRegistryfrom sdg_hub import BlockRegistryRegistry for block discovery and metadata

LLM Blocks

ClassImportDescription
LLMChatBlockfrom sdg_hub.core.blocks import LLMChatBlockUnified LLM chat block supporting 100+ providers via LiteLLM
PromptBuilderBlockfrom sdg_hub.core.blocks import PromptBuilderBlockFormats prompts into structured chat messages or plain text
LLMResponseExtractorBlockfrom sdg_hub.core.blocks import LLMResponseExtractorBlockExtracts specified fields from LLM response objects
LLMErrorHandlerfrom sdg_hub.core.blocks.llm.error_handler import LLMErrorHandlerCentralized error handling for LLM operations across all providers

Parsing Blocks

ClassImportDescription
TagParserBlockfrom sdg_hub.core.blocks import TagParserBlockParses text content using start/end tags
JSONParserBlockfrom sdg_hub.core.blocks import JSONParserBlockParses JSON from text and expands fields into separate columns
RegexParserBlockfrom sdg_hub.core.blocks import RegexParserBlockParses text content using regex patterns

Transform Blocks

ClassImportDescription
TextConcatBlockfrom sdg_hub.core.blocks import TextConcatBlockCombines multiple columns into a single column using a separator
DuplicateColumnsBlockfrom sdg_hub.core.blocks import DuplicateColumnsBlockDuplicates existing columns with new names according to a mapping
RenameColumnsBlockfrom sdg_hub.core.blocks import RenameColumnsBlockRenames columns in a dataset according to a mapping
MeltColumnsBlockfrom sdg_hub.core.blocks import MeltColumnsBlockTransforms wide dataset format into long format by melting columns into rows
IndexBasedMapperBlockfrom sdg_hub.core.blocks import IndexBasedMapperBlockMaps values from source columns to output based on choice columns
UniformColumnValueSetterfrom sdg_hub.core.blocks import UniformColumnValueSetterReplaces all values in a column with a summary statistic (mode, mean, median)
JSONStructureBlockfrom sdg_hub.core.blocks.transform.json_structure_block import JSONStructureBlockCombines multiple columns into a single JSON object column
RowMultiplierBlockfrom sdg_hub.core.blocks.transform.row_multiplier import RowMultiplierBlockDuplicates each row a configurable number of times
SamplerBlockfrom sdg_hub.core.blocks.transform.sampler import SamplerBlockRandomly samples n values from a list column

Filtering Blocks

ClassImportDescription
ColumnValueFilterBlockfrom sdg_hub.core.blocks import ColumnValueFilterBlockFilters datasets based on column values using comparison operations

Agent Blocks

ClassImportDescription
AgentBlockfrom sdg_hub.core.blocks import AgentBlockExecute agent frameworks (Langflow, etc.) on DataFrame rows
AgentResponseExtractorBlockfrom sdg_hub.core.blocks.agent.agent_response_extractor_block import AgentResponseExtractorBlockExtracts text content from agent framework responses

MCP Blocks

ClassImportDescription
MCPAgentBlockfrom sdg_hub.core.blocks import MCPAgentBlockLLM agent with remote MCP tools in an agentic loop

Detailed API (auto-generated)

Base Classes

::: sdg_hub.core.blocks.base.BaseBlock options: members_order: source show_source: false

::: sdg_hub.core.blocks.registry.BlockRegistry options: members_order: source show_source: false


LLM Blocks

::: sdg_hub.core.blocks.llm.llm_chat_block.LLMChatBlock options: members_order: source show_source: false

::: sdg_hub.core.blocks.llm.prompt_builder_block.PromptBuilderBlock options: members_order: source show_source: false

::: sdg_hub.core.blocks.llm.llm_response_extractor_block.LLMResponseExtractorBlock options: members_order: source show_source: false

::: sdg_hub.core.blocks.llm.error_handler.LLMErrorHandler options: members_order: source show_source: false


Parsing Blocks

::: sdg_hub.core.blocks.parsing.tag_parser_block.TagParserBlock options: members_order: source show_source: false

::: sdg_hub.core.blocks.parsing.json_parser_block.JSONParserBlock options: members_order: source show_source: false

::: sdg_hub.core.blocks.parsing.regex_parser_block.RegexParserBlock options: members_order: source show_source: false


Transform Blocks

::: sdg_hub.core.blocks.transform.text_concat.TextConcatBlock options: members_order: source show_source: false

::: sdg_hub.core.blocks.transform.duplicate_columns.DuplicateColumnsBlock options: members_order: source show_source: false

::: sdg_hub.core.blocks.transform.rename_columns.RenameColumnsBlock options: members_order: source show_source: false

::: sdg_hub.core.blocks.transform.melt_columns.MeltColumnsBlock options: members_order: source show_source: false

::: sdg_hub.core.blocks.transform.index_based_mapper.IndexBasedMapperBlock options: members_order: source show_source: false

::: sdg_hub.core.blocks.transform.uniform_col_val_setter.UniformColumnValueSetter options: members_order: source show_source: false

::: sdg_hub.core.blocks.transform.json_structure_block.JSONStructureBlock options: members_order: source show_source: false

::: sdg_hub.core.blocks.transform.row_multiplier.RowMultiplierBlock options: members_order: source show_source: false

::: sdg_hub.core.blocks.transform.sampler.SamplerBlock options: members_order: source show_source: false


Filtering Blocks

::: sdg_hub.core.blocks.filtering.column_value_filter.ColumnValueFilterBlock options: members_order: source show_source: false


Agent Blocks

::: sdg_hub.core.blocks.agent.agent_block.AgentBlock options: members_order: source show_source: false

::: sdg_hub.core.blocks.agent.agent_response_extractor_block.AgentResponseExtractorBlock options: members_order: source show_source: false


MCP Blocks

::: sdg_hub.core.blocks.mcp.mcp_agent_block.MCPAgentBlock options: members_order: source show_source: false