Wrapper over the gpt3.5 model, capable of calling functions
Project description
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())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for chatgpt_functions-0.1.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 872d70fc87c4e8bc682233a5dc1079bb3dd070fef5d517c147c25da563015b10 |
|
MD5 | ba6c8203edb7b3048e9903d65d6a9328 |
|
BLAKE2b-256 | 3e8f1f241f8e18ef786500852509c09afa33df5336f2d15fd3d20304b68f02ca |