promptl-ai


Namepromptl-ai JSON
Version 0.1.0b1 PyPI version JSON
download
home_pageNone
SummaryPromptL bindings for Python
upload_time2025-01-22 16:33:57
maintainerNone
docs_urlNone
authorNone
requires_python<3.13,>=3.9
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PromptL

```sh
pip install promptl-ai
```

Requires Python `3.9` or higher.

## What is PromptL?

[PromptL](https://promptl.ai/) offers a common, easy-to-use syntax for defining dynamic prompts for LLMs. It is a simple, yet powerful language that allows you to define prompts in a human-readable format, while still being able to leverage the full power of LLMs.

> This repository contains the Python bindings for PromptL. Go to the main [repository](https://github.com/latitude-dev/promptl) to learn more.

## Usage

```python
from promptl_ai import Promptl

promptl = Promptl()

prompt = """
<step>
    First, think step by step about how to answer the user's question.
    <user>
        Taking into account this context: {{context}}
        I have the following question: {{question}}
    </user>
</step>
<step>
    Finally, answer the user's question succinctly yet complete.
</step>
"""

chain = promptl.chains.create(
    prompt=prompt,
    parameters={
        "context": "PromptL is a templating language specifically designed for LLM prompting.",
        "question": "What is PromptL?",
    },
)
conversation = chain.step()
conversation = chain.step("Reasoning...")  # LLM response
conversation = chain.step("Answer...")  # LLM response

print(conversation.messages)
```

Find more [examples](examples).

## Development

Requires uv `0.5.10` or higher.

- Install dependencies: `uv venv && uv sync --all-extras --all-groups`
- Add [dev] dependencies: `uv add [--dev] <package>`
- Run linter: `uv run scripts/lint.py`
- Run formatter: `uv run scripts/format.py`
- Run tests: `uv run scripts/test.py`
- Build package: `uv build`
- Publish package: `uv publish`

## License

The PromptL bindings are licensed under the [MIT License](https://opensource.org/licenses/MIT) - read the [LICENSE](LICENSE) file for details.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "promptl-ai",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.13,>=3.9",
    "maintainer_email": "Latitude Data SL <hello@latitude.so>",
    "keywords": null,
    "author": null,
    "author_email": "Latitude Data SL <hello@latitude.so>",
    "download_url": "https://files.pythonhosted.org/packages/75/92/9731f131373b5fa63a7f9908aab0b19e65dcd00a1dda4777e415f274b085/promptl_ai-0.1.0b1.tar.gz",
    "platform": null,
    "description": "# PromptL\n\n```sh\npip install promptl-ai\n```\n\nRequires Python `3.9` or higher.\n\n## What is PromptL?\n\n[PromptL](https://promptl.ai/) offers a common, easy-to-use syntax for defining dynamic prompts for LLMs. It is a simple, yet powerful language that allows you to define prompts in a human-readable format, while still being able to leverage the full power of LLMs.\n\n> This repository contains the Python bindings for PromptL. Go to the main [repository](https://github.com/latitude-dev/promptl) to learn more.\n\n## Usage\n\n```python\nfrom promptl_ai import Promptl\n\npromptl = Promptl()\n\nprompt = \"\"\"\n<step>\n    First, think step by step about how to answer the user's question.\n    <user>\n        Taking into account this context: {{context}}\n        I have the following question: {{question}}\n    </user>\n</step>\n<step>\n    Finally, answer the user's question succinctly yet complete.\n</step>\n\"\"\"\n\nchain = promptl.chains.create(\n    prompt=prompt,\n    parameters={\n        \"context\": \"PromptL is a templating language specifically designed for LLM prompting.\",\n        \"question\": \"What is PromptL?\",\n    },\n)\nconversation = chain.step()\nconversation = chain.step(\"Reasoning...\")  # LLM response\nconversation = chain.step(\"Answer...\")  # LLM response\n\nprint(conversation.messages)\n```\n\nFind more [examples](examples).\n\n## Development\n\nRequires uv `0.5.10` or higher.\n\n- Install dependencies: `uv venv && uv sync --all-extras --all-groups`\n- Add [dev] dependencies: `uv add [--dev] <package>`\n- Run linter: `uv run scripts/lint.py`\n- Run formatter: `uv run scripts/format.py`\n- Run tests: `uv run scripts/test.py`\n- Build package: `uv build`\n- Publish package: `uv publish`\n\n## License\n\nThe PromptL bindings are licensed under the [MIT License](https://opensource.org/licenses/MIT) - read the [LICENSE](LICENSE) file for details.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "PromptL bindings for Python",
    "version": "0.1.0b1",
    "project_urls": {
        "documentation": "https://docs.latitude.so/promptl",
        "homepage": "https://github.com/latitude-dev/promptl-py#readme",
        "repository": "https://github.com/latitude-dev/promptl-py"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "51edb3baa40257769b4f6cbffe4f65a88cfa79a4507908bed409ccffed560a7b",
                "md5": "36a1a16cc00478e9d56746a43c9a48da",
                "sha256": "ca30156635b85a18470bb0369ed436f7c6f248e780a883f3469c7388bb097f25"
            },
            "downloads": -1,
            "filename": "promptl_ai-0.1.0b1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "36a1a16cc00478e9d56746a43c9a48da",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.13,>=3.9",
            "size": 964276,
            "upload_time": "2025-01-22T16:33:54",
            "upload_time_iso_8601": "2025-01-22T16:33:54.825050Z",
            "url": "https://files.pythonhosted.org/packages/51/ed/b3baa40257769b4f6cbffe4f65a88cfa79a4507908bed409ccffed560a7b/promptl_ai-0.1.0b1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "75929731f131373b5fa63a7f9908aab0b19e65dcd00a1dda4777e415f274b085",
                "md5": "34da25dc3ab7f105e3951d1198e0feb8",
                "sha256": "5594961f0fd390a2028ae618b385a3441518fffc6d78943d14d892bf19ec8f1d"
            },
            "downloads": -1,
            "filename": "promptl_ai-0.1.0b1.tar.gz",
            "has_sig": false,
            "md5_digest": "34da25dc3ab7f105e3951d1198e0feb8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.13,>=3.9",
            "size": 977158,
            "upload_time": "2025-01-22T16:33:57",
            "upload_time_iso_8601": "2025-01-22T16:33:57.874908Z",
            "url": "https://files.pythonhosted.org/packages/75/92/9731f131373b5fa63a7f9908aab0b19e65dcd00a1dda4777e415f274b085/promptl_ai-0.1.0b1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-22 16:33:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "latitude-dev",
    "github_project": "promptl-py#readme",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "promptl-ai"
}
        
Elapsed time: 0.43718s