chatgpt-functions


Namechatgpt-functions JSON
Version 0.1.10 PyPI version JSON
download
home_pagehttps://github.com/Wellmare/chatgpt-functions
SummaryWrapper over the gpt3.5 model, capable of calling functions
upload_time2023-06-29 10:22:45
maintainer
docs_urlNone
authorWellmare
requires_python>=3.7
license
keywords chatgpt functions gpt
VCS
bugtrack_url
requirements loguru openai python-dotenv
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Example of usage:

```python
import asyncio
from chatgpt_functions import (
    ChatGPT,
    Message,
    Roles,
    ChatGptFunction,
    Parameters,
    Property,
)
from config import API_KEY

chatgpt = ChatGPT(openai_api_key=API_KEY)


async def main():
    def say_hello(args):
        print(args)

    await chatgpt.get_chatgpt_response_with_functions(
        functions=[
            ChatGptFunction(
                function=say_hello,
                parameters=Parameters(
                    properties=[
                        Property(
                            property_name="name",
                            prop_type="string",
                            description="Name who to say hello to",
                            enum=["Evan", "Micha"],
                        ),
                        Property(
                            property_name="text",
                            prop_type="string",
                            description="Greeting",
                        ),
                    ]
                ),
                function_description="Say hello to user",
            )
        ],
        messages_to_set=[Message(role=Roles.USER, content='Скажи приветик миче')]
    )


loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
loop.run_until_complete(main())
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Wellmare/chatgpt-functions",
    "name": "chatgpt-functions",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "chatgpt functions gpt",
    "author": "Wellmare",
    "author_email": "ivan.kolipov@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/b8/30/eccadfac91cbcb7876c34054d16276770c6790cb9add37c75d52f2e7e66e/chatgpt_functions-0.1.10.tar.gz",
    "platform": null,
    "description": "# Example of usage:\r\n\r\n```python\r\nimport asyncio\r\nfrom chatgpt_functions import (\r\n    ChatGPT,\r\n    Message,\r\n    Roles,\r\n    ChatGptFunction,\r\n    Parameters,\r\n    Property,\r\n)\r\nfrom config import API_KEY\r\n\r\nchatgpt = ChatGPT(openai_api_key=API_KEY)\r\n\r\n\r\nasync def main():\r\n    def say_hello(args):\r\n        print(args)\r\n\r\n    await chatgpt.get_chatgpt_response_with_functions(\r\n        functions=[\r\n            ChatGptFunction(\r\n                function=say_hello,\r\n                parameters=Parameters(\r\n                    properties=[\r\n                        Property(\r\n                            property_name=\"name\",\r\n                            prop_type=\"string\",\r\n                            description=\"Name who to say hello to\",\r\n                            enum=[\"Evan\", \"Micha\"],\r\n                        ),\r\n                        Property(\r\n                            property_name=\"text\",\r\n                            prop_type=\"string\",\r\n                            description=\"Greeting\",\r\n                        ),\r\n                    ]\r\n                ),\r\n                function_description=\"Say hello to user\",\r\n            )\r\n        ],\r\n        messages_to_set=[Message(role=Roles.USER, content='\u0420\u040e\u0420\u0454\u0420\u00b0\u0420\u00b6\u0420\u0451 \u0420\u0457\u0421\u0402\u0420\u0451\u0420\u0406\u0420\u00b5\u0421\u201a\u0420\u0451\u0420\u0454 \u0420\u0458\u0420\u0451\u0421\u2021\u0420\u00b5')]\r\n    )\r\n\r\n\r\nloop = asyncio.new_event_loop()\r\nasyncio.set_event_loop(loop)\r\nloop.run_until_complete(main())\r\n```\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Wrapper over the gpt3.5 model, capable of calling functions",
    "version": "0.1.10",
    "project_urls": {
        "Homepage": "https://github.com/Wellmare/chatgpt-functions"
    },
    "split_keywords": [
        "chatgpt",
        "functions",
        "gpt"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b479002bf979341607390e73e7cbb2ed2c9970dec3529fa20a55d8a6d905f4ad",
                "md5": "4a5a306cfa48b789fdcc70ded64b8d63",
                "sha256": "afee7d0c7f9c0d2be19789ef4650678eddd651c15d240e4e923f8b652320a355"
            },
            "downloads": -1,
            "filename": "chatgpt_functions-0.1.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4a5a306cfa48b789fdcc70ded64b8d63",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 6669,
            "upload_time": "2023-06-29T10:22:43",
            "upload_time_iso_8601": "2023-06-29T10:22:43.804732Z",
            "url": "https://files.pythonhosted.org/packages/b4/79/002bf979341607390e73e7cbb2ed2c9970dec3529fa20a55d8a6d905f4ad/chatgpt_functions-0.1.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b830eccadfac91cbcb7876c34054d16276770c6790cb9add37c75d52f2e7e66e",
                "md5": "fb352ebc0fea8bbafae84253a2594091",
                "sha256": "7aa2e3197acd4834abb75d397b9fe71046af8a2bad38794b64136c281a6f03a9"
            },
            "downloads": -1,
            "filename": "chatgpt_functions-0.1.10.tar.gz",
            "has_sig": false,
            "md5_digest": "fb352ebc0fea8bbafae84253a2594091",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 5821,
            "upload_time": "2023-06-29T10:22:45",
            "upload_time_iso_8601": "2023-06-29T10:22:45.037281Z",
            "url": "https://files.pythonhosted.org/packages/b8/30/eccadfac91cbcb7876c34054d16276770c6790cb9add37c75d52f2e7e66e/chatgpt_functions-0.1.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-29 10:22:45",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Wellmare",
    "github_project": "chatgpt-functions",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "loguru",
            "specs": [
                [
                    "==",
                    "0.7.0"
                ]
            ]
        },
        {
            "name": "openai",
            "specs": [
                [
                    "==",
                    "0.27.8"
                ]
            ]
        },
        {
            "name": "python-dotenv",
            "specs": [
                [
                    "==",
                    "1.0.0"
                ]
            ]
        }
    ],
    "lcname": "chatgpt-functions"
}
        
Elapsed time: 0.08077s