Skip to main content

MinAgent

Agent is a wrapper on top of OpenAI chat completion and assistant API. It handles tool_call, file_search within the class

Features

Implemented

  • Chat Completion API
  • Assistant API

And tools

  • Function call (Parallel execution)
  • File search

Usage

pip install minagent

Create an Agent

from openai import OpenAI
from minagent import Agent

openai_client = OpenAI(
    api_key="00000"
)

def current_utc_datetime(**args) -> str:
    from datetime import datetime, timezone
    return datetime.now(timezone.utc).isoformat()

clock = Agent(
    openai_client,
    name='clock',
    model='gpt-4o',
    instructions=['You are a time aware assistant.',],

    # optional: only add below if using assistant api
    openai_asst_id='asst_0000'

    # optional: tool for file_search, and function
    tools=[
        {
            'type': 'file_search',
        }, {
            'type': 'function',
            'function': {"name": 'current_utc_datetime'},
        },
    ],
    tool_functions={'current_utc_datetime': current_utc_datetime},
    tool_resources={'file_search': {'vector_store_ids': ['vs_0000']}},
)

Use of Chat completion API

response = clock.chat_completion(
    user='john',
    messages=[
        { 'role': 'user', 'content': 'what time is it now?' },
    ],
)

Use of Assistant API

thread = openai_client.beta.threads.create()
response = clock.ask_assistant(
    user='john',
    asst_thread_id=thread.id,
    message=[
        { 'role': 'user', 'content': 'what time is it now?' },
    ]
)

Future

  • Support for Response API
  • Add test cases
  • Release pipeline

Metadata

Release files for minagent 0.1.1

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

Source distribution (sdist)

Source distribution for minagent 0.1.1
File Size Uploaded
minagent-0.1.1.tar.gz 5.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for minagent 0.1.1
File Interpreter ABI Platform
minagent-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 11.8 kB

Release files / minagent-0.1.1.tar.gz

Download URL minagent-0.1.1.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
63ee42519f3d08d92f57175badcbb3970a5c34eea03bfbb50ade4974a1cceda9
BLAKE2b-256 checksum
How to use checksums
d084feeb053494ce6204ef8a572969c4b9cf9f07563b8c167e7b1e73f002faf3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release files / minagent-0.1.1-py3-none-any.whl

Download URL minagent-0.1.1-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
87d5136a51a4b39e78ce584557429282414af2b686818183bfab254354079c9d
BLAKE2b-256 checksum
How to use checksums
fcc7f805a45098cf927849058cbcc71e38afbdd4289014e005a9d19cdab5502e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

0.0.1

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