Skip to main content

No project description provided

Project description

🦁 Lion Framework

A powerful Python framework for structured AI conversations and operations

Python 3.11+ PyPI version

🌟 Features

  • 🎯 Dynamic structured output at runtime
  • 🔄 Easy composition of multi-step processes
  • 🤖 Support for any model via litellm
  • 🏗️ Built-in conversation management
  • 🧩 Extensible architecture
  • 🔍 Type-safe with Pydantic models

🚀 Quick Install

pip install lion-os

💡 Usage Examples

1️⃣ Simple Communication

from lion import iModel, Branch

# Initialize model and branch
imodel = iModel(
    model="openai/gpt-4o",
    api_key="OPENAI_API_KEY",
    temperature=0.2,
)
branch = Branch(imodel=imodel)

# Basic communication
result = await branch.communicate(
    instruction="Give me ideas for FastAPI interview questions",
    context="We're hiring senior engineers"
)

2️⃣ Structured Output with Pydantic

from pydantic import BaseModel

class CodingQuestion(BaseModel):
    question: str
    evaluation_criteria: str

# Get structured responses
questions = await branch.operate(
    instruction="Generate FastAPI coding questions",
    context="Technical interview context",
    operative_model=CodingQuestion
)

3️⃣ Advanced Operations (Brainstorming)

from lion.operations import brainstorm

result = await brainstorm(
    instruct={
        "instruction": "Design API endpoints for a todo app",
        "context": "Building a modern task management system"
    },
    imodel=imodel,
    num_instruct=3,
    operative_model=CodingQuestion,
    auto_run=True
)

🎯 Key Components

Component Description
Branch Main conversation controller
MessageManager Handles message flow and history
ToolManager Manages function execution and tools
Operative Structures operations and responses

Requirements

python 3.11+ required

⭐ Star History

Star History Chart

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lion_os-0.1.2.tar.gz (126.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lion_os-0.1.2-py3-none-any.whl (162.7 kB view details)

Uploaded Python 3

File details

Details for the file lion_os-0.1.2.tar.gz.

File metadata

  • Download URL: lion_os-0.1.2.tar.gz
  • Upload date:
  • Size: 126.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.7 Linux/6.5.0-1025-azure

File hashes

Hashes for lion_os-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8de4bf95846bb9766d0c391be2176da121d39e7e7f1de41a2a2450ca9d3a9294
MD5 975f85f5d35288bc595bdbc65bf3a2d3
BLAKE2b-256 5166771c16a03912f7c42059ee0269d60e7c44928b899a1bde4c7de613971aab

See more details on using hashes here.

File details

Details for the file lion_os-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: lion_os-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 162.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.7 Linux/6.5.0-1025-azure

File hashes

Hashes for lion_os-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5aed619d1e792734c5c2dd02d95c64f10b79eb3fdb46525808ed4d074ba9f0d3
MD5 55d7d66f3df10b5cf50d2e440d25329a
BLAKE2b-256 c80764799c3edeaba165dc0bea178ed2bca174958cb4820c0b87ea48ab6adaec

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page