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
Sourcelibtv-labs/libtv-skills
Added on
NPX Install
npx skill4agent add libtv-labs/libtv-skills libtv-skillTags
Translated version includes tags in frontmatterSKILL.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
- Create Session / Send Message - Create a new session or send a message to an existing session (e.g., "Generate an anime video")
- Query Session Progress - Pull the message list of a session based on sessionId, used for polling image/video generation results
- 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: or , default .
OPENAPI_IM_BASEIM_BASE_URLhttps://im.liblib.tvNo 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.py2. 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_UUID3. 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.pyOutput 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 is passed)
--project-idFor Final User Display (OpenClaw)
- Video URL: From the content of assistant messages in returned by
messagesor the video/image URL in the result, i.e., the "returned result".query_session - Project URL: Use the returned by
projectUrl, or concatenate it manually ascreate_session+https://www.liblib.tv/canvas?projectId=. When querying progress withprojectUuid,--project-id PROJECT_UUIDwill directly returnquery_sessionfor easy display together.projectUrl
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 is passed when creating a session, only a session is created/bound, and SendMessage will not be called
message - Use for incremental pull when querying sessions, which is convenient for polling new messages (including assistant replies and image/video generation results)
--after-seq - The project canvas URL is fixed as: + projectUuid
https://www.liblib.tv/canvas?projectId= - After switching projects, the Redis cache will be updated, and the new projectUuid will be used for the next create_session