Skip to main content

Promptia is a Python library designed to streamline the management and generation of prompts for Large Language Models (LLMs).

Project description

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.

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

promptia-0.4.0.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

promptia-0.4.0-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file promptia-0.4.0.tar.gz.

File metadata

  • Download URL: promptia-0.4.0.tar.gz
  • Upload date:
  • Size: 17.3 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

Hashes for promptia-0.4.0.tar.gz
Algorithm Hash digest
SHA256 46539bb94eb041cbfb9dc4ef68b4fd648631bacab8afc974f0e4729e1f8983e3
MD5 2a7a5a9fcdf0074c227fa25f80567584
BLAKE2b-256 38746f0b926ee7af34a8a007fbd251c58ccdf8b19bd0444c3955fb33a2d99e0d

See more details on using hashes here.

File details

Details for the file promptia-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: promptia-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 13.4 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

Hashes for promptia-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c87a423200b7070ef76f6f4afaf7d22182ac24d0afaec55ab0139682c872ef64
MD5 ba2bdc71ae1bf2792a0a773b2b6bfac5
BLAKE2b-256 65e7b0a70466bf4a9ec422f571d49a1bd8e20b11d1747cec740f0cbf902acce8

See more details on using hashes here.

Supported by

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