Metadata-Version: 2.1
Name: promptdesk
Version: 0.2.2
Summary: PromptDesk python SDK.
Home-page: https://promptdesk.ai/
License: AGPLv3
Author: PromptDesk
Author-email: feedback@promptdesk.ai
Requires-Python: >=3.8,<4.0
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: cachetools (>=5.3.2,<6.0.0)
Requires-Dist: python-dotenv (>=1.0.0,<2.0.0)
Requires-Dist: requests (>=2.31.0,<3.0.0)
Project-URL: Documentation, https://promptdesk.ai/docs
Project-URL: Repository, https://github.com/promptdesk/promptdesk-py
Description-Content-Type: text/markdown

![Alt Text](./readme_images/github_banner.png)
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
[![Docker](https://badgen.net/badge/icon/docker?icon=docker&label)](https://hub.docker.com/r/promptdesk/promptdesk)
[![PyPI version](https://badge.fury.io/py/promptdesk.svg)](https://badge.fury.io/py/promptdesk)

## What is PromptDesk?

PromptDesk is 100% free and open-source tool designed to facilitate the creation, organization, integration, and evaluation of prompts, prompt-based applications and Large Language Models (LLMs).

![Alt Text](./readme_images/flowchart_banner_py.jpeg)

### PrompDesk Manager

The PromptDesk GUI is an OpenAI playground clone that makes it easy to build and organize prompt-based applications.
- Workspace: Build and test completion, code and chat prompts with variables.
- Prompts: Create and organize prompts.
- Models: Create, edit, test and add unlimited LLM models.
- Logs: View, analyze and export prompt calls.
- Settings: Configure variables and API keys.

### PromptDesk Python SDK

The PrompDesk Python PIP Package is an ultra-lightweight library to call and process prompts remotely or locally.
- Generate: Call prompts remotely or locally.
- JSON: Convert prompts to JSON format.
- Variables: Add variables to prompts.
- Data validation: Validate prompt data.

We recommend starting with the [Quickstart](https://promptdesk.ai/docs/quickstart) guide. You can also jump straight to the [Build Prompts](https://promptdesk.ai/docs/building-prompts/) or start integrating prompts in python with [Integrate Prompts](https://promptdesk.ai/docs/python-sdk/) guides.

## Quickstart

### Install PromptDesk

To install PromptDesk, use pip:

```python
pip install promptdesk
```

### Usage

You can call the prompt you build in the application by using the generate method.

```python
from promptdesk import PromptDesk

pd = PromptDesk(
    #defaults to os.environ.get("PROMPTDESK_API_KEY")
    api_key = "YOUR_PROMPTDESK_API_KEY"
)

story = pd.generate("short-story", {
    "setting": "dark and stormy night",
    "character": "lonely farmer",
    "plot": "visited by a stranger"
})

print(story)
```

You can find your API key in the application under Organization Information > API Key.

### Troubleshooting

#### Testing the Service

You can test the service endpoint by pinging it:

```python
print(pd.ping())
```

A successful ping will return "pong".

#### Prompt name

The prompt name you use in the generate method must match the name of the prompt you created in the application.

#### Logs

You can view the logs of your prompt calls in the application. If you are having trouble, check the logs to see if there are any errors.

## Important Links

For more information about PromptDesk, please refer to the following resources:

- [Documentation](https://promptdesk.ai/docs/)
- [Application GitHub Repository](https://github.com/promptdesk/promptdesk)
- [Python GitHub Repository](https://github.com/promptdesk/promptdesk-py)
- [PyPI Package](https://pypi.org/project/promptdesk/)
- [Docker Hub](https://hub.docker.com/r/promptdesk/promptdesk/)
- [Official Website](https://promptdesk.ai/)
