Simple interface for creating and managing LLM chains
Project description
LLM Blocks
LLM Blocks is a Python library that provides a simple interface for creating and managing Language Model (LLM) chains. It is designed to make it easy to interact with OpenAI's GPT-3 API.
📚 Table of Contents
🎯 Why Use LLM Blocks
LLM Blocks makes it easy to create and manage LLM chains. It provides a simple, intuitive interface for interacting with OpenAI's GPT-3 API. With LLM Blocks, you can focus on building your application without worrying about the intricacies of the API.
🏗️ Repo Structure
llm_blocks
├── .gitignore
├── llm_blocks
│ ├── __init__.py
│ └── blocks.py
├── requirements.txt
├── setup.py
└── turbo_docs.toml
📦 Installation
To install LLM Blocks, you can use pip:
pip install llm-blocks
🚀 Usage
LLM Blocks provides three main classes: Block
, TemplateBlock
, and ChatBlock
. These classes are the recommended interfaces for calling OpenAI APIs.
Here is an example of how to use them:
from llm_blocks import Block, TemplateBlock, ChatBlock
template = "Hello, {name}! How are you?"
# Create a Block
block = Block()
response = block("Hello, world!")
# Create a TemplateBlock
template_block = TemplateBlock(template)
response = template_block("AI Friend")
# template_block(name="AI Friend") also valid
# Create a ChatBlock
chat_block = ChatBlock(template)
response = chat_block("AI Friend")
response = chat_block("What is the meaning of life?")
🤝 Contributing
Contributions are welcome! Please feel free to submit a pull request.
📧 Contact
If you have any questions or feedback, please feel free to contact the author at voynow99@gmail.com.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for llm_blocks-0.3.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a9eba1f5ecff37969f92311d222f5d86c45e0aa29b356e4577f36dd94b38a04 |
|
MD5 | 5d8e1720f16cf7e82c29b919b4b10abf |
|
BLAKE2b-256 | a1d0a71865d77243d1171296e17a02a1e0a2a5a74d9d2a95d8a1ba4e52248401 |