prompt-as


Nameprompt-as JSON
Version 0.2.0 PyPI version JSON
download
home_pagehttps://github.com/Upsonic/prompt-as-function
SummaryGPT
upload_time2024-08-06 12:20:24
maintainerNone
docs_urlNone
authorUpsonic
requires_python>=3.9
licenseMIT
keywords
VCS
bugtrack_url
requirements crewai crewai_tools upsonic
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Prompt as Function
**"Don't write any code, just tell what to do!"**

This is a significant milestone for Large Language Models (LLMs) and the coding process. The `prompt-as` library serves as a foundation for using prompts to perform tasks in Python. We are currently developing this mindset for several features in our products. With our open-source initiative <3, you can use it just like we do.


```console
pip install prompt-as
```


```python
from prompt_as import prompt_as_config, pf 

prompt_as_config.OPENAI_API_KEY = "sk-**"

@pf
def sleep(second:str) -> bool:
    """
    Sleeps for the given seconds and returns True.
    """


```

[Example @pf Functions](https://github.com/Upsonic/prompt-as-function/blob/master/examples.md)



# Testing and Settings

<details>
<h1>Model Settings</h1>
You can change the OpenAI model that have been used for `prompt-as`.

```python
from prompt_as import prompt_as_config, pf


prompt_as_config.OPENAI_MODEL = "gpt-4-turbo"
# Model Setting

prompt_as_config.OPENAI_API_KEY = "sk-**"

@pf
def sleep(second:str) -> bool:
    """
    Sleeps for the given seconds and returns True.
    """



```


<h1>Testing</h1>

If you want to test this library on a large scale, you can use our test system as well.

```python

from prompt_as import prompt_as_config, pf

prompt_as_config.OPENAI_API_KEY = "sk-**"

@pf
def sleep(second:str) -> bool:
    """
    Sleeps for the given seconds and returns True.
    """



# Testing

from prompt_as import Prompt_As_Test_System


Prompt_As_Test_System(sleep_time, [(["2"], {})], [True], [False]).run_test()
# (function_name, test_args_and_kwargs, expected_outputs, bad_outputs)

```

</details>
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Upsonic/prompt-as-function",
    "name": "prompt-as",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "Upsonic",
    "author_email": "onur@upsonic.co",
    "download_url": "https://files.pythonhosted.org/packages/01/1a/9220ea4ca4f8f2bbf312d43b6bbfd994bd744fa0d92f98683eacbb123afb/prompt_as-0.2.0.tar.gz",
    "platform": null,
    "description": "# Prompt as Function\n**\"Don't write any code, just tell what to do!\"**\n\nThis is a significant milestone for Large Language Models (LLMs) and the coding process. The `prompt-as` library serves as a foundation for using prompts to perform tasks in Python. We are currently developing this mindset for several features in our products. With our open-source initiative <3, you can use it just like we do.\n\n\n```console\npip install prompt-as\n```\n\n\n```python\nfrom prompt_as import prompt_as_config, pf \n\nprompt_as_config.OPENAI_API_KEY = \"sk-**\"\n\n@pf\ndef sleep(second:str) -> bool:\n    \"\"\"\n    Sleeps for the given seconds and returns True.\n    \"\"\"\n\n\n```\n\n[Example @pf Functions](https://github.com/Upsonic/prompt-as-function/blob/master/examples.md)\n\n\n\n# Testing and Settings\n\n<details>\n<h1>Model Settings</h1>\nYou can change the OpenAI model that have been used for `prompt-as`.\n\n```python\nfrom prompt_as import prompt_as_config, pf\n\n\nprompt_as_config.OPENAI_MODEL = \"gpt-4-turbo\"\n# Model Setting\n\nprompt_as_config.OPENAI_API_KEY = \"sk-**\"\n\n@pf\ndef sleep(second:str) -> bool:\n    \"\"\"\n    Sleeps for the given seconds and returns True.\n    \"\"\"\n\n\n\n```\n\n\n<h1>Testing</h1>\n\nIf you want to test this library on a large scale, you can use our test system as well.\n\n```python\n\nfrom prompt_as import prompt_as_config, pf\n\nprompt_as_config.OPENAI_API_KEY = \"sk-**\"\n\n@pf\ndef sleep(second:str) -> bool:\n    \"\"\"\n    Sleeps for the given seconds and returns True.\n    \"\"\"\n\n\n\n# Testing\n\nfrom prompt_as import Prompt_As_Test_System\n\n\nPrompt_As_Test_System(sleep_time, [([\"2\"], {})], [True], [False]).run_test()\n# (function_name, test_args_and_kwargs, expected_outputs, bad_outputs)\n\n```\n\n</details>",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "GPT",
    "version": "0.2.0",
    "project_urls": {
        "Homepage": "https://github.com/Upsonic/prompt-as-function"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "011a9220ea4ca4f8f2bbf312d43b6bbfd994bd744fa0d92f98683eacbb123afb",
                "md5": "4f59c528415b79dd7d2d391815b0e7c0",
                "sha256": "2ab92a8cd5da8cbe06e8106e34c227d1bc3b330dd9e197918c82d0963d6e2c59"
            },
            "downloads": -1,
            "filename": "prompt_as-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "4f59c528415b79dd7d2d391815b0e7c0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 7098,
            "upload_time": "2024-08-06T12:20:24",
            "upload_time_iso_8601": "2024-08-06T12:20:24.771098Z",
            "url": "https://files.pythonhosted.org/packages/01/1a/9220ea4ca4f8f2bbf312d43b6bbfd994bd744fa0d92f98683eacbb123afb/prompt_as-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-06 12:20:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Upsonic",
    "github_project": "prompt-as-function",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "crewai",
            "specs": [
                [
                    "==",
                    "0.41.1"
                ]
            ]
        },
        {
            "name": "crewai_tools",
            "specs": [
                [
                    "==",
                    "0.4.26"
                ]
            ]
        },
        {
            "name": "upsonic",
            "specs": [
                [
                    "==",
                    "0.28.4"
                ]
            ]
        }
    ],
    "lcname": "prompt-as"
}
        
Elapsed time: 4.46552s