Easy-to-use OpenAI Agent with support for the latest Function call feature.
Project description
OpenAI Agent
Easy-to-use OpenAI Agent with support for the latest Function call feature.
Usage
- Create your own functions using comprehensive documentation comments and type annotations.
def add(a: int, b: int):
"""Add two numbers.
:param a: First number.
:param b: Second number.
"""
return a + b
- Load the functions as function objects.
from openai_agent.completions import get_function_completion
from openai_agent.functions import Function
from openai_agent.messages import UserMessage
response = get_function_completion(
messages=[UserMessage(content="Calculate 2 + 2")],
functions=[Function.load_from_func(add)],
)
print(response.content)
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
openai_agent-0.1.0.tar.gz
(15.0 kB
view details)
Built Distribution
File details
Details for the file openai_agent-0.1.0.tar.gz
.
File metadata
- Download URL: openai_agent-0.1.0.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.0 CPython/3.11.3 Darwin/22.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 198fdb8dbabc1f3372664d304e52742b0c94fef7f1c90635d2974b545ef24bfe |
|
MD5 | d424f938e3e4261918b1c8d2c8543c9a |
|
BLAKE2b-256 | 7524d3db469192545493d1c17067dba9f8b3d2701cea134c11e7459449bc40fc |
File details
Details for the file openai_agent-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: openai_agent-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.0 CPython/3.11.3 Darwin/22.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32b220ae7971aa03a9b68ca8197912268d91d064a07c04e1a9c38e8e0de2493e |
|
MD5 | e947bb477248a036accd7b100c004d96 |
|
BLAKE2b-256 | 931e325268ad6b96642f07aa26c14a90cbfda3f968069ef9f4fce20d5cb90ee7 |