Skip to main content

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

  1. 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
  1. 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


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)

Uploaded Source

Built Distribution

openai_agent-0.1.0-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

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

Hashes for openai_agent-0.1.0.tar.gz
Algorithm Hash digest
SHA256 198fdb8dbabc1f3372664d304e52742b0c94fef7f1c90635d2974b545ef24bfe
MD5 d424f938e3e4261918b1c8d2c8543c9a
BLAKE2b-256 7524d3db469192545493d1c17067dba9f8b3d2701cea134c11e7459449bc40fc

See more details on using hashes here.

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

Hashes for openai_agent-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 32b220ae7971aa03a9b68ca8197912268d91d064a07c04e1a9c38e8e0de2493e
MD5 e947bb477248a036accd7b100c004d96
BLAKE2b-256 931e325268ad6b96642f07aa26c14a90cbfda3f968069ef9f4fce20d5cb90ee7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page