Skip to main content

Microsoft Agent Framework extensions for mainstream open-source LLMs

Project description

agent-framework-ep

CI

Microsoft Agent Framework extensions for mainstream open-source LLMs, including structured output support for GLM, Kimi, Qwen, and DeepSeek, along with reasoning_content support. Plus a local containerized code interpreter environment. 'ep' stands for enterprise-level applications.

Features

  • OpenAI-like Client Extensions (openai_like)

    • Structured output parsing with JSON fallback (dirtyjson, json-repair)
    • Reasoning content support for DeepSeek-R1 style models
    • Uses Chat Completions API, compatible with domestic LLMs (DeepSeek, Kimi, Qwen)
    • Requires: agent-framework>=1.0.0rc6 and agent-framework-openai>=1.0.0rc6
  • Code Executor (code_executor)

    • Docker-based code execution environment
    • Supports Python, bash, and shell scripts
    • Timeout and cancellation support
    • Isolated execution for security
  • Dynamic Skills Provider (skills_provider)

    • Async skill updates before each agent run
    • Extendable skills from external sources

Installation

pip install agent-framework-ep

Or with uv:

uv add agent-framework-ep

Prerequisites

  • Python 3.12+
  • Docker (for code execution features)

Quick Start

OpenAI-like Client with Structured Output

from pydantic import BaseModel
from agent_framework import Agent
from agent_framework_ep import OpenAILikeChatClient

class Response(BaseModel):
    answer: str
    confidence: float

# Create client with structured output support
client = OpenAILikeChatClient(
    model="deepseek-chat",
    api_key="your-api-key"
)

# Use with Agent framework
agent = Agent(client=client)
response = await agent.run(
    "What is the capital of France?",
    response_format=Response
)
print(response)  # Parsed Response object

Code Execution

import asyncio
import os
from agent_framework_ep import DockerCommandLineCodeExecutor
from agent_framework_ep import OpenAILikeChatClient, CodeExecutionTool

chat_client = OpenAILikeChatClient(
    model_id="kimi/kimi-k2.5",
)

code_executor = DockerCommandLineCodeExecutor(
    image="python-code-sandbox",
    work_dir="some_of_your_working_directory",
    delete_tmp_files=True,
    environment={
        "TAVILY_API_KEY": os.environ.get("TAVILY_API_KEY"),
    }
)

code_tool = CodeExecutionTool(code_executor).execute_code

agent = chat_client.as_agent(
    name="SkillsAssistant",
    instructions="You're a helpful assistant.",
    tools=[code_tool],
)

Dynamic Skills Provider

from agent_framework_ep import UpdatableSkillsProvider
from agent_framework import Skill

async def fetch_dynamic_skills():
    # Fetch skills from external source
    return [
        Skill(name="web-search", description="Search the web", content="..."),
    ]

provider = UpdatableSkillsProvider(
    skill_paths="./skills",
    skills_updater=fetch_dynamic_skills
)

Development

# Clone the repository
git clone https://github.com/qianpeng/agent-framework-ep.git
cd agent-framework-ep

# Install dependencies
uv sync

# Run tests
uv run pytest

# Run tests with Docker (requires Docker)
uv run pytest -m docker

# Lint and format
uv run ruff check --fix .
uv run ruff format .

# Type check
uv run mypy src/agent_framework_ep

License

MIT License - see LICENSE for details.

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

agent_framework_ep-0.1.8.tar.gz (71.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_framework_ep-0.1.8-py3-none-any.whl (27.8 kB view details)

Uploaded Python 3

File details

Details for the file agent_framework_ep-0.1.8.tar.gz.

File metadata

  • Download URL: agent_framework_ep-0.1.8.tar.gz
  • Upload date:
  • Size: 71.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for agent_framework_ep-0.1.8.tar.gz
Algorithm Hash digest
SHA256 335e6aa4ffc765fd898b31ab0cd4d565a8ff74610c4f0c2295b7818cef45810b
MD5 150d9dddce42d3dafea089e977079bb6
BLAKE2b-256 dd6cafe93c90e3085536aadafbd32c95541bbfaaa94c70fbc82de2ba2fc1e6d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for agent_framework_ep-0.1.8.tar.gz:

Publisher: release.yml on qtalen/agent-framework-ep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agent_framework_ep-0.1.8-py3-none-any.whl.

File metadata

File hashes

Hashes for agent_framework_ep-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 23cdf4df4dafa7c9ccfa295dc1acbe366ae2b4971724c39450bdcdc61d6b4317
MD5 1d04f1eb5ffe335cd7aedf24cdaba758
BLAKE2b-256 f8ff0185429d60e52b8d33f58ca0ba5186b31fd0d559b20983bbc9cdf5cfab27

See more details on using hashes here.

Provenance

The following attestation bundles were made for agent_framework_ep-0.1.8-py3-none-any.whl:

Publisher: release.yml on qtalen/agent-framework-ep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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