Skip to main content

Decart plugin for Vision Agents

Project description

Decart Plugin for Vision Agents

Decart integration for Vision Agents framework, enabling real-time video restyling capabilities.

It enables features such as:

  • Real-time video transformation using generative AI models
  • Dynamic style changing via prompts
  • Seamless integration with Vision Agents video pipeline

Installation

uv add "vision-agents[decart]"
# or directly
uv add vision-agents-plugins-decart

Usage

This example shows how to use the RestylingProcessor to transform a user's video feed in real-time.

from vision_agents.core import User, Agent
from vision_agents.plugins import getstream, gemini, decart

processor = decart.RestylingProcessor(
    initial_prompt="Studio Ghibli animation style",
    model="lucy_2_rt",
)

agent = Agent(
    edge=getstream.Edge(),
    agent_user=User(name="Styled AI"),
    instructions="Be helpful",
    llm=gemini.Realtime(),
    processors=[processor],
)

Dynamic Prompt Updates

You can register a function to update the style prompt dynamically based on the conversation:

@llm.register_function(
    description="Change the video style prompt"
)
async def change_style(prompt: str) -> str:
    await processor.update_prompt(prompt)
    return f"Style changed to: {prompt}"

Reference Images ("costumes")

For models like Lucy that accept a reference image, pass it at construction time and/or swap it atomically with a prompt via update_state:

processor = decart.RestylingProcessor(
    model="lucy_2_rt",
    initial_prompt="A person wearing a superhero costume",
    initial_image="./costumes/superhero.png",  # your own reference image
)

# Later — atomically change prompt + reference image
await processor.update_state(
    prompt="A person wearing a wizard robe",
    image="./costumes/wizard.png",
)

# Image-only update
await processor.update_state(image=b"<raw image bytes>")

initial_image and update_state(image=...) accept bytes, a local file path, an http(s) URL, a data: URI, or a raw base64 string.

Configuration

The plugin requires a Decart API key. You can provide it in two ways:

  1. Set the environment variable DECART_API_KEY
  2. Pass it directly to the constructor: RestylingProcessor(api_key="...")

Links

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

vision_agents_plugins_decart-0.5.2.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

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

vision_agents_plugins_decart-0.5.2-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file vision_agents_plugins_decart-0.5.2.tar.gz.

File metadata

  • Download URL: vision_agents_plugins_decart-0.5.2.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for vision_agents_plugins_decart-0.5.2.tar.gz
Algorithm Hash digest
SHA256 1cd28a0d745fdc92d926365b4b0e7f6d9869c20a73d4c6758959581fc3fb6ac9
MD5 c5a0a3aacc83b8bd8628f2258e4e9afb
BLAKE2b-256 584d3520e59c9bc5065c2f4db8dbd7c0793f4b6e8a529ccb0d0dd62b0bec60dc

See more details on using hashes here.

File details

Details for the file vision_agents_plugins_decart-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: vision_agents_plugins_decart-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for vision_agents_plugins_decart-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f849b4aba2cf9b7d95b8e3b2f40b879bd2c355df12afdd9f44a1f9b7bb6cf48d
MD5 9454dc3dd09506479739e1deda1efa19
BLAKE2b-256 e74e60e6aaf83db01572fffdc4bc05e8ddeb6245b19eaa60a16a688e70041d04

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