跳转至

CRUD and Updates

This page documents the write, update, delete, and asset-management APIs exposed by the current ORPC-only Search SDK.

Field names

Extra create_*() and update_*() fields are forwarded to the backend ORPC procedure through **fields. Python helpers use snake_case; namespace helpers also keep selected backend-style camelCase aliases.

Calling Styles

from aimage.search.client import SearchClient
from aimage.search.settings import SearchService

with SearchClient(service=SearchService.DEV) as client:
    client.update_clip_subtitle("clip_id", "new subtitle")
    client.kensaku.clips.updateSubtitle("clip_id", "new subtitle")
    client.rpc("kensaku/clips/updateSubtitle", {
        "clip_id": "clip_id",
        "subtitle": "new subtitle",
    })

Project Settings and Feature Flags

Purpose Python helper Namespace
Get a project get_project(project_id) client.kensaku.projects.get(project_id)
Update settings update_project_settings(project_id, agent_model=..., feature_flags=...) client.kensaku.projects.updateSettings(project_id, ...)
Set feature flags set_project_feature_flags(project_id, ...)
Alias for feature flags enable_project_features(project_id, ...)
client.set_project_feature_flags(
    "project_id",
    image_generation=True,
    translation_table=True,
    material_reading=True,
    clip_embedding_search=True,
)

project.update_settings(agent_model="gpt-4.1")
project.set_feature_flags(translation_table=True)

Feature flag mapping:

Python parameter Backend field
image_generation imageGeneration
translation_table translationTable
material_reading materialReading
clip_embedding_search clipEmbeddingSearch

Characters

Purpose Python helper Namespace
List list_characters(project_id, q=None) client.data.characters.list(project_id, q=...)
Get get_character(character_id) client.data.characters.get(character_id)
Create create_character(project_id, **fields) client.data.characters.create(project_id, **fields)
Update update_character(character_id, **fields) client.data.characters.update(character_id, **fields)
Delete delete_character(character_id) client.data.characters.delete(character_id)

Additional character-material helpers:

Purpose Python helper
Add gallery image add_character_gallery_image(character_id, file_path)
Add gallery images add_character_gallery_images(character_id, file_paths)
Remove gallery image remove_character_gallery_image(character_id, index)
Add concept art add_character_concept_art(character_id, file_path)
Add concept art batch add_character_concept_art_batch(character_id, file_paths)
Remove concept art remove_character_concept_art(character_id, index)
List settings list_character_settings(character_id)
Create setting create_character_setting(character_id, **fields)
Update setting update_character_setting(setting_id, **fields)
Delete setting delete_character_setting(setting_id)
Assign materials assign_character_materials_to_setting(character_id, setting_id, file_paths)
Unassign materials unassign_character_materials_from_settings(character_id, file_paths)
character = client.create_character(
    "project_id",
    name="Tsukasa",
    name_alias=["つかさ"],
    features=["blue eyes"],
)

client.update_character(character.id, is_pinned=True)
client.add_character_concept_art(character.id, "characters/tsukasa/concept.png")

Resources and Materials

Resource stores project-level files such as scripts, setting sheets, reference materials, OCR materials, and translation-table source files.

Purpose Python helper Namespace
List list_resources(project_id, **filters) client.data.resources.list(project_id, **filters)
Get get_resource(resource_id) client.data.resources.get(resource_id)
Create create_resource(project_id, **fields) client.data.resources.create(project_id, **fields)
Update update_resource(resource_id, **fields) client.data.resources.update(resource_id, **fields)
Delete delete_resource(resource_id) client.data.resources.delete(resource_id)
Batch upload URLs batch_presigned_resource_urls(project_id, files) raw ORPC
Folder paths resource_folder_paths(project_id) raw ORPC
Start OCR start_material_ocr(project_id, resource_id, **fields) raw ORPC
OCR progress material_ocr_progress(progress_id) raw ORPC
resource = project.create_resource(
    name="Character settings",
    file_path="materials/characters.pdf",
    file_type="resources",
    folder_path="materials",
)

client.update_resource(resource.id, description="Updated notes")
progress = client.start_material_ocr(project.id, resource.id, language="ja")

Reference Images

Purpose Python helper Namespace
List list_reference_images(project_id, page=1, size=300, **filters) client.data.referenceImages.list(project_id, **filters)
Search search_reference_images(project_id, page=1, size=40, **filters) client.data.referenceImages.search(project_id, **filters)
Tag options reference_image_tag_options(project_id, **filters) client.data.referenceImages.tag_options(project_id, **filters)
Get get_reference_image(reference_image_id) client.data.referenceImages.get(reference_image_id)
Create create_reference_image(project_id, **fields) client.data.referenceImages.create(project_id, **fields)
Update update_reference_image(reference_image_id, **fields) client.data.referenceImages.update(reference_image_id, **fields)
Delete delete_reference_image(reference_image_id) client.data.referenceImages.delete(reference_image_id)
reference = client.create_reference_image(
    project.id,
    resource_id="resource_id",
    category="background_art",
    tags=["school", "day"],
    license="licensed",
    is_searchable=True,
)

client.update_reference_image(reference.id, tags=["school", "day", "interior"])

Translation Tables

Purpose Python helper Namespace
List tables list_translation_tables(project_id, page=1, size=300, **filters) client.data.translationTables.list(project_id, **filters)
Get table get_translation_table(table_id) client.data.translationTables.get(table_id)
Create table create_translation_table(project_id, **fields) client.data.translationTables.create(project_id, **fields)
Update table update_translation_table(table_id, **fields) client.data.translationTables.update(table_id, **fields)
Delete table delete_translation_table(table_id) client.data.translationTables.delete(table_id)
List entries list_translation_table_entries(table_id, page=1, size=300, **filters) client.data.translationTables.entries.list(table_id, **filters)
Create entry create_translation_table_entry(table_id, raw_values, **fields) client.data.translationTables.entries.create(table_id, raw_values, **fields)
Update entry update_translation_table_entry(entry_id, **fields) client.data.translationTables.entries.update(entry_id, **fields)
Delete entry delete_translation_table_entry(entry_id) client.data.translationTables.entries.delete(entry_id)
table = project.create_translation_table(
    name="Character names",
    columns=[
        {"key": "ja", "label": "日本語", "index": 0},
        {"key": "en", "label": "English", "index": 1},
        {"key": "zh", "label": "中文", "index": 2},
    ],
)

entry = client.create_translation_table_entry(
    table.id,
    raw_values={"ja": "司", "en": "Tsukasa", "zh": "司"},
)
client.update_translation_table_entry(
    entry.id,
    raw_values={"ja": "司", "en": "Tsukasa", "zh": "司"},
)

Manga and Novels

Purpose Manga helper Novel helper
List list_mangas(project_id, **filters) list_novels(project_id, **filters)
Get get_manga(meta_id) get_novel(meta_id)
Create create_manga(project_id, **fields) create_novel(project_id, **fields)
Update update_manga(meta_id, **fields) update_novel(meta_id, **fields)
Delete delete_manga(meta_id) delete_novel(meta_id)
Processing get_manga_processing(processing_id) / find_manga_processing_by_meta(meta_id) get_novel_processing(processing_id) / find_novel_processing_by_meta(meta_id)
client.query_novels(project.id, "confession scene", k=5)
client.get_novel_segment_context(project.id, "segment_id", context_radius=2)

Clip Metadata, Tags, Characters, and Subtitles

Purpose Python helper Namespace
Get get_clip(clip_id) client.kensaku.clips.get(clip_id)
Get detail get_clip_detail(clip_id) client.kensaku.clips.getDetail(clip_id)
Episode clips list_episode_clips(project_id, episode_number, ...) client.kensaku.clips.episodeClips(project_id, episode_number, ...)
Update clip update_clip(clip_id, **fields) client.kensaku.clips.update(clip_id, **fields)
Update tags update_clip_tags(clip_id, tags, **fields) client.kensaku.clips.updateTags(clip_id, tags)
Update characters update_clip_characters(clip_id, character_ids) client.kensaku.clips.updateCharacters(clip_id, character_ids)
Update subtitle update_clip_subtitle(clip_id, subtitle) client.kensaku.clips.updateSubtitle(clip_id, subtitle)
clip = client.get_clip_detail("clip_id")
clip.update_subtitle("I remember this place.")
clip.update_characters(["character_id"])
clip.update_tags({"dialog_sentiment": "POSITIVE"})
clip.update(metadata={"notes": "checked by editor"})

Agent and Conversation Branches

Purpose Python helper Namespace
Read project context agent_read_project_context(project_id) client.agent.read.projectContext(project_id)
Read tag options agent_read_tag_options(project_id) client.agent.read.tagOptions(project_id)
Read characters agent_read_characters(project_id) client.agent.read.characters(project_id)
Read conversation history agent_read_conversation_history(conversation_id, **fields) client.agent.read.conversationHistory(conversation_id, **fields)
Search clips agent_search_clips(project_id, query, **fields) client.agent.read.searchClips(project_id, query, **fields)
Search novels agent_search_novels(project_id, query, **fields) client.agent.read.searchNovels(project_id, query, **fields)
Hydrate clips agent_hydrate_clips(clip_ids) client.agent.read.hydrateClips(clip_ids)
Visual asset preview agent_visual_asset_preview(project_id, visual_asset_id) client.agent.read.visualAssetPreview(project_id, visual_asset_id)
Save generated image agent_save_generated_image(project_id, visual_asset_id, **fields) client.agent.write.saveGeneratedImage(project_id, visual_asset_id, **fields)
Create conversation create_conversation(project_id, title="新対話") client.kensaku.chatbot.conversations.create(project_id, title)
Add message add_conversation_message(conversation_id, message, **fields) client.kensaku.chatbot.conversations.addMessage(conversation_id, message, **fields)
Edit message edit_conversation_message(conversation_id, message_id, content, **fields) client.kensaku.chatbot.conversations.editMessage(conversation_id, message_id, content, **fields)
Switch branch switch_conversation_branch(conversation_id, message_id=None, branch_id=None) client.kensaku.chatbot.conversations.switchBranch(...)
conversation = client.create_conversation(project.id, title="Scene search")
message = client.add_conversation_message(conversation["id"], "Find school hallway cuts")
client.switch_conversation_branch(conversation["id"], message_id=message["id"])