Microsoft Agent Framework extensions for mainstream open-source LLMs
Project description
agent-framework-ep
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
- Compatible with Microsoft Agent Framework's OpenAIChatClient
-
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agent_framework_ep-0.1.5.tar.gz.
File metadata
- Download URL: agent_framework_ep-0.1.5.tar.gz
- Upload date:
- Size: 41.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9b8aed926280536a2090dab7e94ee8a8892e4522a2d939c1756e492d613674f
|
|
| MD5 |
426c4be4fbc74caf78b44bfa13cfdfb4
|
|
| BLAKE2b-256 |
271448ddb6f844d9f29a00ec95cb139d1327f4c5ebf3afdc0b429ecf90d0aab2
|
File details
Details for the file agent_framework_ep-0.1.5-py3-none-any.whl.
File metadata
- Download URL: agent_framework_ep-0.1.5-py3-none-any.whl
- Upload date:
- Size: 26.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1892ab3742266c6c29eb16c14c9b65d8decb3f9538accb8eec8c5a949dc0e71
|
|
| MD5 |
24e39567f4e525c1ca4ba39893375f2a
|
|
| BLAKE2b-256 |
355dff7d9c12ccc3142cd5990da52f48ff54413ed8556a7ece4553343e79e8d9
|