Stevenic / agentm-py

A library of "Micro Agents" that make it easy to add reliable intelligence to any application.
MIT License
8 stars 3 forks source link

OpenAI Integration for AgentM Python #26

Closed debuggerone closed 2 months ago

debuggerone commented 2 months ago

Overview

This issue focuses on integrating OpenAI's API with the Python version of the AgentM library. This includes setting up the API client, configuring models, handling tokenization, and managing model-specific functionalities like completions and structured outputs.

Tasks

Subtasks Overview

  1. API Client Setup:

    • Set up and configure the OpenAI Python client, including environment management for API keys and secrets.
    • Store configuration details in a .settings/config.py file for easy access and modification.
  2. Model Handling:

    • Develop Python functions for managing OpenAI model interactions, including completions and error handling.
    • Implement logic to handle API rate limits and errors effectively.
  3. Tokenizer Support:

    • Port tokenizer configurations and functions to Python, ensuring they work seamlessly with Python libraries.
    • Validate that token counts are accurate and aligned with OpenAI’s token limits for various models.