libtv-skill

Original🇨🇳 Chinese
Translated
4 scriptsChecked / no sensitive code detected

Agent-IM Conversation Skill - Create sessions, send messages such as image/video generation requests via OpenAPI, and query session progress. This skill is activated when users need to generate images/videos or query current session messages.

6installs
Added on

NPX Install

npx skill4agent add libtv-labs/libtv-skills libtv-skill

SKILL.md Content (Chinese)

View Translation Comparison →

Agent-IM Conversation (Image/Video Generation)

Create sessions, send messages (such as image/video generation requests) via Agent-IM's OpenAPI, and query session message progress.

Features

  1. Create Session / Send Message - Create a new session or send a message to an existing session (e.g., "Generate an anime video")
  2. Query Session Progress - Pull the message list of a session based on sessionId, used for polling image/video generation results
  3. Switch Project - Switch the project bound to the current accessKey to a new project, and subsequent create_session will use the new projectUuid

Prerequisites

bash
export LIBTV_ACCESS_KEY="your-access-key"
Optional:
OPENAPI_IM_BASE
or
IM_BASE_URL
, default
https://im.liblib.tv
.
No additional dependencies required, only uses Python standard libraries.

Usage

1. Create Session / Send Message

bash
# Create a new session and send "Generate an anime video"
python3 {baseDir}/scripts/create_session.py "Generate an anime video"

# Send a message to an existing session
python3 {baseDir}/scripts/create_session.py "Generate another landscape image" --session-id SESSION_ID

# Only create/bind a session without sending a message
python3 {baseDir}/scripts/create_session.py

2. Query Session Progress

bash
# Query session message list
python3 {baseDir}/scripts/query_session.py SESSION_ID

# Incremental pull (only returns messages with seq greater than N)
python3 {baseDir}/scripts/query_session.py SESSION_ID --after-seq 5

# Attach project URL (pass the projectUuid returned by create_session, projectUrl will be included in the result)
python3 {baseDir}/scripts/query_session.py SESSION_ID --project-id PROJECT_UUID

3. Switch Project

bash
# Switch the project bound to the current accessKey (new projectUuid will be used for subsequent create_session)
python3 {baseDir}/scripts/change_project.py

Output Format

create_session returns:
json
{
  "projectUuid": "aa3ba04c5044477cb7a00a9e5bf3b4d0",
  "sessionId": "90f05e0c-...",
  "projectUrl": "https://www.liblib.tv/canvas?projectId=aa3ba04c5044477cb7a00a9e5bf3b4d0"
}
query_session returns:
json
{
  "messages": [
    {"id": "msg-xxx", "role": "user", "content": "Generate an anime video"},
    {"id": "msg-yyy", "role": "assistant", "content": "..."}
  ],
  "projectUrl": "https://www.liblib.tv/canvas?projectId=..."
}
("projectUrl" only exists when
--project-id
is passed)

For Final User Display (OpenClaw)

  • Video URL: From the content of assistant messages in
    messages
    returned by
    query_session
    or the video/image URL in the result, i.e., the "returned result".
  • Project URL: Use the
    projectUrl
    returned by
    create_session
    , or concatenate it manually as
    https://www.liblib.tv/canvas?projectId=
    +
    projectUuid
    . When querying progress with
    --project-id PROJECT_UUID
    ,
    query_session
    will directly return
    projectUrl
    for easy display together.
It is recommended to provide both: Video/Image Result Link + Project Canvas Link (projectUrl) when the task is completed or when the user inquires about progress.

Notes

  • Authentication method: Request header
    Authorization: Bearer <LIBTV_ACCESS_KEY>
  • If no
    message
    is passed when creating a session, only a session is created/bound, and SendMessage will not be called
  • Use
    --after-seq
    for incremental pull when querying sessions, which is convenient for polling new messages (including assistant replies and image/video generation results)
  • The project canvas URL is fixed as:
    https://www.liblib.tv/canvas?projectId=
    + projectUuid
  • After switching projects, the Redis cache will be updated, and the new projectUuid will be used for the next create_session