Promptia
Promptia is a Python library designed to streamline the management and generation of prompts for Large Language Models (LLMs).
Features
- Manage prompt templates for various LLMs and APIs
- Convert abstract templates to specific API formats
- Support for function calling with detailed configurations
- Version control for templates
- Dynamic information embedding using Retrieval-Augmented Generation (RAG)
- Modular design for flexibility and extensibility
Installation
pip install promptia[openai]
Quick Start
from promptia import Promptia
from promptia import PromptTemplate
from promptia import Message
from promptia.llm.openai import OpenAIGPT4oMini
template = PromptTemplate(
name='greeting',
description='greeting template',
system="Your name is {{name}}. You have wandered into {{place}}. Please act.",
messages=[
Message(role='user', content='Who are you?'),
],
parameters={
'name': 'string',
'place': 'string'
},
function_calling_config=None
)
tia = Promptia()
prompt = tia.build(template, {"name": "Alice", "place": "Wonderland"})
llm = OpenAIGPT4oMini()
result = llm.call_llm(prompt)
print(result)
Contributing
We welcome contributions! Please see our Contributing Guidelines for more details.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
promptia-0.5.1.tar.gz
(8.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
promptia-0.5.1-py3-none-any.whl
(13.3 kB
view details)
File details
Details for the file promptia-0.5.1.tar.gz.
File metadata
- Download URL: promptia-0.5.1.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
poetry/1.8.3 CPython/3.10.12 Linux/5.15.136-tegra
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e0d9509e10896e5b6e01f28acd25e7b04ee3ff3e926084ab067fc09c86b7f26
|
|
| MD5 |
5d6deced6b5c51bae92712f35651666c
|
|
| BLAKE2b-256 |
20cdac24410d5afd9ead6721532ccdfe5057978de0644543256d0b15b4ac6646
|
File details
Details for the file promptia-0.5.1-py3-none-any.whl.
File metadata
- Download URL: promptia-0.5.1-py3-none-any.whl
- Upload date:
- Size: 13.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
poetry/1.8.3 CPython/3.10.12 Linux/5.15.136-tegra
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
054fbfaa272f4b6bd6ea7a75feb304f4f06911963bc6f90b1bfa6cc0bcf6fe17
|
|
| MD5 |
2514bd33b36f0fd3704e1943b3fc4829
|
|
| BLAKE2b-256 |
753a014bf5e3baad533ccac78d9270a35844907a3f79347b6a2f935b8539cb2a
|