Welcome to belso’s documentation! — belso 0.0.1 documentation

# Welcome to belso’s documentation!

belso (Better LLMs Structured Outputs) is a Python library designed to simplify working with structured outputs from various LLM providers.

## Features

- Convert between different LLM provider schema formats

- Support for nested schemas

- Validation of structured outputs

- Support for multiple providers including OpenAI, Google, Anthropic, Mistral, and more

## Installation

    pip install belso

## Quick Start

    from belso.schemas import Schema, Field
    from belso.translator import SchemaTranslator
    from belso.validator import SchemaValidator

    # Define your schema
    class UserSchema(Schema):
        name = "UserSchema"
        fields = [
            Field(name="name", type=str, description="User's name", required=True),
            Field(name="age", type=int, description="User's age", required=True)
        ]

    # Translate to OpenAI format
    openai_schema = SchemaTranslator.to_provider(UserSchema, "openai")

    # Validate data against schema
    data = {"name": "John", "age": 30}
    validated_data = SchemaValidator.validate(data, UserSchema)

## API Documentation

Contents:

- belso
  - belso package
- belso package
  - Subpackages
  - Module contents

# Indices and tables

- Index

- Module Index

- Search Page