Skip to main content

Milkey skills infrastructure SDK for connecting multi-skill AI workflows into OpenAI, Anthropic, Gemini, and other AI stacks.

Project description

milkeyskills

Milkey Skills SDK for Python helps teams connect Milkey skills infrastructure into existing AI products and agent workflows.

Use it when you want to:

  • plug Milkey skills into existing OpenAI-compatible clients
  • add reusable skill execution to Anthropic, Gemini, or other AI stacks
  • keep your model provider client while adding Milkey-managed skills as tools

Install

pip install milkeyskills

If your app already uses the OpenAI Python SDK:

pip install milkeyskills openai

Quick Start

import os

from openai import OpenAI

from milkeyskills import milkey

openai_client = OpenAI(api_key=os.environ["OPENAI_API_KEY"])

milkey_client = milkey.create_client(
    base_url=os.environ["MILKEY_BASE_URL"],
    api_key=os.environ["MILKEY_API_KEY"],
)

tools = milkey.openai.chat.tools(client=milkey_client)

messages = [
    {
        "role": "user",
        "content": "Find the best Milkey skill for PostgreSQL query optimization.",
    }
]

first = openai_client.chat.completions.create(
    model="gpt-4.1",
    messages=messages,
    tools=tools,
)

assistant = first.choices[0].message
messages.append(
    {
        "role": "assistant",
        "content": assistant.content or "",
        "tool_calls": [
            {
                "id": tool_call.id,
                "type": "function",
                "function": {
                    "name": tool_call.function.name,
                    "arguments": tool_call.function.arguments,
                },
            }
            for tool_call in assistant.tool_calls or []
        ],
    }
)

if assistant.tool_calls:
    tool_messages = milkey.openai.chat.messages(
        {
            "tool_calls": [
                {
                    "id": tool_call.id,
                    "function": {
                        "name": tool_call.function.name,
                        "arguments": tool_call.function.arguments,
                    },
                }
                for tool_call in assistant.tool_calls
            ]
        },
        milkey_client,
    )
    messages.extend(tool_messages)

    second = openai_client.chat.completions.create(
        model="gpt-4.1",
        messages=messages,
        tools=tools,
    )
    print(second.choices[0].message.content or "")
else:
    print(assistant.content or "")

For production use, keep iterating until the model stops returning tool_calls and enforce a max turn count or request timeout. See examples/openai_chat_completions.py for a bounded loop.

Async Client

from milkeyskills import milkey

async with milkey.create_async_client(
    base_url="https://api.milkey.ai",
    api_key="mk_sk_...",
) as client:
    tools = await client.list_tools()

Supported Integrations

  • OpenAI-compatible chat completions
  • OpenAI responses and realtime-style hosted tool delivery
  • Anthropic inline and hosted MCP integrations
  • Gemini function-calling integrations, Gemini Interactions hosted MCP helpers
  • Framework-agnostic inline tool helpers (milkey.inline_tools)

Provider Matrix

Provider API Variant mode="auto" Supported Modes Recommended Helper
OpenAI Chat Completions inline inline, hosted milkey.openai.chat.tools(...)
OpenAI Responses API hosted inline, hosted milkey.openai.responses.tools(...)
OpenAI Realtime hosted hosted milkey.openai.realtime.tools(...)
Anthropic Messages API hosted inline, hosted milkey.anthropic.config(...)
Gemini generateContent inline inline milkey.gemini.config(...)
Gemini Interactions API hosted hosted milkey.gemini.interactions.config(...)
Inline Custom tool loops inline inline milkey.inline_tools.tools(...)

Versioning

This package follows Semantic Versioning.

pip install --upgrade milkeyskills

Development

cd python
pip install -e ".[dev]"
pytest
ruff check src tests
mypy src

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

milkeyskills-0.1.0.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

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

milkeyskills-0.1.0-py3-none-any.whl (19.1 kB view details)

Uploaded Python 3

File details

Details for the file milkeyskills-0.1.0.tar.gz.

File metadata

  • Download URL: milkeyskills-0.1.0.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for milkeyskills-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4754a775eac2da814ef48cf2ec97bbed1d51d5709cf2890868067d7b8cbdedc8
MD5 9aa0c775e39429ac35b0de683f0f4c31
BLAKE2b-256 a051c62028129bd029e18dee1b9440287cf7067a45647d1b6077300b6bf27fb4

See more details on using hashes here.

File details

Details for the file milkeyskills-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: milkeyskills-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for milkeyskills-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6d8f0b441ec70bc74753939982b297a6f173b08a0e56a368923c084cb5c56d0a
MD5 f76a38b3b372d276e310f4b1765e29c0
BLAKE2b-256 0faf0d97d90fb9a13267ddcb258b5f3d4cc1fd0fac46afd490bf74530b6b3599

See more details on using hashes here.

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