Skip to main content

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)

Metadata

Release files for openai-agent 0.1.0

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

Source distribution (sdist)

Source distribution for openai-agent 0.1.0
File Size Uploaded
openai_agent-0.1.0.tar.gz 15.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for openai-agent 0.1.0
File Interpreter ABI Platform
openai_agent-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 31.0 kB

Release files / openai_agent-0.1.0.tar.gz

Download URL openai_agent-0.1.0.tar.gz
Size 15.0 kB
Tags Source
SHA-256 checksum
How to use checksums
198fdb8dbabc1f3372664d304e52742b0c94fef7f1c90635d2974b545ef24bfe
BLAKE2b-256 checksum
How to use checksums
7524d3db469192545493d1c17067dba9f8b3d2701cea134c11e7459449bc40fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.0 CPython/3.11.3 Darwin/22.5.0

Release files / openai_agent-0.1.0-py3-none-any.whl

Download URL openai_agent-0.1.0-py3-none-any.whl
Size 16.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
32b220ae7971aa03a9b68ca8197912268d91d064a07c04e1a9c38e8e0de2493e
BLAKE2b-256 checksum
How to use checksums
931e325268ad6b96642f07aa26c14a90cbfda3f968069ef9f4fce20d5cb90ee7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.0 CPython/3.11.3 Darwin/22.5.0

Release history Release notifications | RSS feed

This release

0.1.0 This release

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