Skip to main content

Example of usage:

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())

Metadata

Release files for chatgpt-functions 0.1.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for chatgpt-functions 0.1.10
File Size Uploaded
chatgpt_functions-0.1.10.tar.gz 5.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for chatgpt-functions 0.1.10
File Interpreter ABI Platform
chatgpt_functions-0.1.10-py3-none-any.whl Python 3 none any Details

Total release size: 12.5 kB

Release files / chatgpt_functions-0.1.10.tar.gz

Download URL chatgpt_functions-0.1.10.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7aa2e3197acd4834abb75d397b9fe71046af8a2bad38794b64136c281a6f03a9
BLAKE2b-256 checksum
How to use checksums
b830eccadfac91cbcb7876c34054d16276770c6790cb9add37c75d52f2e7e66e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.4

Release files / chatgpt_functions-0.1.10-py3-none-any.whl

Download URL chatgpt_functions-0.1.10-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
afee7d0c7f9c0d2be19789ef4650678eddd651c15d240e4e923f8b652320a355
BLAKE2b-256 checksum
How to use checksums
b479002bf979341607390e73e7cbb2ed2c9970dec3529fa20a55d8a6d905f4ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.4

Release history Release notifications | RSS feed

This release

0.1.10 This release

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page