concinno-skills-media
Media + smart-home agent skills for Concinno — OpenAI image generation, Replicate any-model dispatch, and Home Assistant state + service control via REST.
Status
MVP (0.1.0) — four tools, three upstream services. Fifth sub-package in
the concinno-skills-* ecosystem (after -google, -chat, -content,
-video), built to the same entry-points + Tool-protocol pattern.
Tools
| Tool | Action(s) | Upstream | Paid | Concurrency-safe |
|---|---|---|---|---|
ImageGenerate |
create |
OpenAI images.generate (dall-e-3 / gpt-image-1) |
Yes | False |
ReplicateRun |
run |
replicate.Client.run (any model) |
Yes | False |
HomeAssistantState |
get / set |
HA REST /api/states/<entity_id> |
No | False |
HomeAssistantService |
call |
HA REST /api/services/<domain>/<service> |
No | False |
Install
pip install concinno-skills-media
Deps pulled transitively: openai>=1.50, replicate>=1.0, httpx>=0.27,
concinno>=2.15.1.
Credentials
All four tools read via concinno.core.credentials.CredentialStore
(four-source precedence: runtime override > env var > ~/.concinno/credentials.json
None). Keys:
| Key | Env alias | Required by |
|---|---|---|
openai_api_key |
CONCINNO_CRED_OPENAI_API_KEY |
ImageGenerate |
replicate_api_token |
CONCINNO_CRED_REPLICATE_API_TOKEN |
ReplicateRun |
homeassistant_url |
CONCINNO_CRED_HOMEASSISTANT_URL |
HomeAssistantState, HomeAssistantService |
homeassistant_token |
CONCINNO_CRED_HOMEASSISTANT_TOKEN |
HomeAssistantState, HomeAssistantService |
~/.concinno/credentials.json example
{
"openai_api_key": "sk-...",
"replicate_api_token": "r8_...",
"homeassistant_url": "http://ha.local:8123",
"homeassistant_token": "eyJhbGci..."
}
The HA token is a Long-Lived Access Token minted from your HA profile → Security page.
Cost warnings
ImageGenerate and ReplicateRun hit paid APIs. Every call logs a
logger.warning line so CostTracker (if running in the host) can
reconcile against billing:
- DALL-E 3: ~$0.04/image standard, ~$0.08 hd (1024² / 1792×1024)
gpt-image-1: see OpenAI pricing- Replicate: see the per-model pricing card on replicate.com
No local free-tier fallback is provided — use
concinno-skills-content's
KeywordExtract (local KeyBERT) if you want a free alternative for the
text side.
Usage via Concinno ToolRegistry
When the consumer sets CONCINNO_LOAD_PLUGINS=1, the default registry
auto-mounts all four tools:
import os
os.environ["CONCINNO_LOAD_PLUGINS"] = "1"
from concinno.tools.registry import get_default_registry
reg = get_default_registry()
names = set(reg.list_deferred())
assert {"ImageGenerate", "ReplicateRun",
"HomeAssistantState", "HomeAssistantService"} <= names
img = reg.get("ImageGenerate")
out = img.call(
action="create",
prompt="a cozy cat on a windowsill, sunset",
model="dall-e-3",
size="1024x1024",
quality="standard",
n=1,
)
print(out["urls"][0])
Direct Python usage
from concinno_skills_media import (
ImageGenerate, ReplicateRun,
HomeAssistantState, HomeAssistantService,
)
# 1) Generate an image via DALL-E 3.
img = ImageGenerate().call(
action="create",
prompt="a 1990s anime cityscape at night",
model="dall-e-3",
size="1792x1024",
quality="hd",
)
if img["ok"]:
print(img["urls"][0])
# 2) Any Replicate model (Flux, SDXL, Wan, music, video, voice...)
flux = ReplicateRun().call(
action="run",
model="black-forest-labs/flux-schnell",
input={"prompt": "an iguana on the beach, photorealistic"},
)
print(flux["output"]) # single URL or list of URLs depending on model
# 3) Home Assistant — read a light's state.
st = HomeAssistantState().call(
action="get", entity_id="light.living_room"
)
print(st["state"], st["attributes"])
# 4) Home Assistant — turn that light on.
svc = HomeAssistantService().call(
action="call",
domain="light",
service="turn_on",
target={"entity_id": "light.living_room"},
data={"brightness": 200, "color_name": "warm_white"},
)
print(svc["ok"], len(svc["changed"]))
All tools return either a structured {"ok": True, ...} dict or
{"ok": False, "error": "..."} — never raise. Matches the rest of the
Concinno tool ecosystem.
Safety notes
HomeAssistantService dangerous calls
Certain HA services mutate the installation itself or destroy history:
homeassistant.restart— drops the HA process mid-workhomeassistant.stop— shuts HA down entirelyrecorder.purge/recorder.purge_entities— drops historical data
The tool warns via logger.warning when these are invoked but does
not block them — this is a power-user tool. If you want hard blocks,
wrap in a custom guard / PreToolUse hook at the Concinno layer.
ImageGenerate safety rails
ncapped to 4 regardless of model (OpenAI itself caps DALL-E 3 at 1).size/qualityvalidated against the published per-model enum; invalid values return{"ok": False, "error": ...}before any HTTP.- Prompt capped at 4000 chars (DALL-E 3 limit —
gpt-image-1accepts much longer, but we keep the guard symmetric).
License
Apache-2.0. See LICENSE in the Concinno monorepo.
Metadata
Release files for concinno-skills-media 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| concinno_skills_media-0.1.0.tar.gz | 43.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| concinno_skills_media-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 63.7 kB
Release files / concinno_skills_media-0.1.0.tar.gz
| Download URL | concinno_skills_media-0.1.0.tar.gz |
|---|---|
| Size | 43.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aa14a9828d90f4cd0bc73ccc2c34017e7d6eb689c7b906803ad741bcf467aac8
|
|
BLAKE2b-256 checksum How to use checksums |
f211f61a316d0961aefb5cd3bba69bfe738b069bd00f19b2972c1938cf05f9da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Release files / concinno_skills_media-0.1.0-py3-none-any.whl
| Download URL | concinno_skills_media-0.1.0-py3-none-any.whl |
|---|---|
| Size | 20.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
098414860b4af5fb8029458aecb73603cdf119c7c74b53846e7c890d1ec5a8a8
|
|
BLAKE2b-256 checksum How to use checksums |
69bc92c2bffb3bf767057006f5c97c91a3cd3c963f9a87910540a71423516160
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|