gradeNot graded
open_image_from_urlAction
現在の版が expectedRevision と一致する場合だけ、12 MiB以下のPNG、JPEG、WebPを、HTTPS URL(クロスオリジンの場合は配信元のCORS許可が必要)または同一オリジンのloopback HTTP URLから開きます。成功時は既存アノテーションと作図中の図形を消去します。
View tool JSON
{
"name": "open_image_from_url",
"kind": "act",
"impl": "imperative",
"description": "現在の版が expectedRevision と一致する場合だけ、12 MiB以下のPNG、JPEG、WebPを、HTTPS URL(クロスオリジンの場合は配信元のCORS許可が必要)または同一オリジンのloopback HTTP URLから開きます。成功時は既存アノテーションと作図中の図形を消去します。",
"inputSchema": {
"type": "object",
"additionalProperties": false,
"required": [
"expectedRevision",
"url"
],
"properties": {
"expectedRevision": {
"type": "integer",
"minimum": 0
},
"url": {
"type": "string",
"minLength": 1
}
}
},
"page": "/annoforge/"
}open_image_from_data_urlAction
現在の版が expectedRevision と一致する場合だけ、呼び出し側から渡された12 MiB以下のPNG、JPEG、WebPのbase64 Data URLを開きます。会話の添付ファイルを直接読み取る機能ではありません。成功時は既存アノテーションと作図中の図形を消去します。
View tool JSON
{
"name": "open_image_from_data_url",
"kind": "act",
"impl": "imperative",
"description": "現在の版が expectedRevision と一致する場合だけ、呼び出し側から渡された12 MiB以下のPNG、JPEG、WebPのbase64 Data URLを開きます。会話の添付ファイルを直接読み取る機能ではありません。成功時は既存アノテーションと作図中の図形を消去します。",
"inputSchema": {
"type": "object",
"additionalProperties": false,
"required": [
"expectedRevision",
"dataUrl"
],
"properties": {
"expectedRevision": {
"type": "integer",
"minimum": 0
},
"dataUrl": {
"type": "string",
"minLength": 1,
"maxLength": 12582912,
"pattern": "^data:image/(png|jpeg|webp);base64,"
}
}
},
"page": "/annoforge/"
}get_annotationsAnswer
現在の AnnoForge ページにある全アノテーションを、元画像座標の draw 配列として読み取ります。画像データとファイル名は返しません。
View tool JSON
{
"name": "get_annotations",
"kind": "answer",
"impl": "imperative",
"description": "現在の AnnoForge ページにある全アノテーションを、元画像座標の draw 配列として読み取ります。画像データとファイル名は返しません。",
"inputSchema": {
"type": "object",
"properties": {},
"additionalProperties": false
},
"page": "/annoforge/"
}get_image_previewAnswer
元画像の範囲に確定済みアノテーションを重ね、縦横比を維持したPNG Data URLとして返します。最大辺は既定1024px、指定可能範囲は64pxから2048pxで、元画像より拡大しません。表示のパン、ズーム、選択状態は結果へ影響しません。
View tool JSON
{
"name": "get_image_preview",
"kind": "answer",
"impl": "imperative",
"description": "元画像の範囲に確定済みアノテーションを重ね、縦横比を維持したPNG Data URLとして返します。最大辺は既定1024px、指定可能範囲は64pxから2048pxで、元画像より拡大しません。表示のパン、ズーム、選択状態は結果へ影響しません。",
"inputSchema": {
"type": "object",
"additionalProperties": false,
"properties": {
"maxDimension": {
"type": "integer",
"minimum": 64,
"maximum": 2048,
"default": 1024
}
}
},
"page": "/annoforge/"
}replace_annotationsAction
現在の版が expectedRevision と一致する場合だけ、全アノテーションを整数ピクセル座標の AnnoForge draw 配列で置き換えます。空配列は全消去です。全項目の検証後にだけ変更します。
View tool JSON
{
"name": "replace_annotations",
"kind": "act",
"impl": "imperative",
"description": "現在の版が expectedRevision と一致する場合だけ、全アノテーションを整数ピクセル座標の AnnoForge draw 配列で置き換えます。空配列は全消去です。全項目の検証後にだけ変更します。",
"inputSchema": {
"type": "object",
"additionalProperties": false,
"required": [
"expectedRevision",
"draw"
],
"properties": {
"expectedRevision": {
"type": "integer",
"minimum": 0
},
"draw": {
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"additionalProperties": false,
"required": [
"shape",
"x",
"y",
"width",
"height",
"color",
"thickness"
],
"properties": {
"shape": {
"const": "rectangle"
},
"x": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"y": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"width": {
"type": "integer",
"minimum": 5,
"maximum": 9007199254740991
},
"height": {
"type": "integer",
"minimum": 5,
"maximum": 9007199254740991
},
"color": {
"type": "string",
"pattern": "^#?[0-9A-Fa-f]{6}$"
},
"thickness": {
"type": "number",
"exclusiveMinimum": 0
}
}
},
{
"type": "object",
"additionalProperties": false,
"required": [
"shape",
"x1",
"y1",
"x2",
"y2",
"color",
"thickness"
],
"properties": {
"shape": {
"const": "line"
},
"x1": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"y1": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"x2": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"y2": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"color": {
"type": "string",
"pattern": "^#?[0-9A-Fa-f]{6}$"
},
"thickness": {
"type": "number",
"exclusiveMinimum": 0
}
}
},
{
"type": "object",
"additionalProperties": false,
"required": [
"shape",
"points",
"color",
"thickness"
],
"properties": {
"shape": {
"const": "polygon"
},
"points": {
"type": "array",
"minItems": 6,
"items": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"color": {
"type": "string",
"pattern": "^#?[0-9A-Fa-f]{6}$"
},
"thickness": {
"type": "number",
"exclusiveMinimum": 0
}
}
},
{
"type": "object",
"additionalProperties": false,
"required": [
"shape",
"points",
"color",
"thickness"
],
"properties": {
"shape": {
"const": "parallelogram"
},
"points": {
"type": "array",
"minItems": 8,
"maxItems": 8,
"items": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"color": {
"type": "string",
"pattern": "^#?[0-9A-Fa-f]{6}$"
},
"thickness": {
"type": "number",
"exclusiveMinimum": 0
}
}
},
{
"type": "object",
"additionalProperties": false,
"required": [
"shape",
"x",
"y",
"radius",
"color",
"thickness"
],
"properties": {
"shape": {
"const": "circle"
},
"x": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"y": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"radius": {
"type": "integer",
"minimum": 3,
"maximum": 9007199254740991
},
"color": {
"type": "string",
"pattern": "^#?[0-9A-Fa-f]{6}$"
},
"thickness": {
"type": "number",
"exclusiveMinimum": 0
}
}
}
]
}
}
}
},
"page": "/annoforge/"
}start_annotations_json_downloadAction
ブラウザーのダウンロード一覧でJSONを受け取るための保存要求です。expectedRevisionが現在の版と一致し、注釈がある場合に現在のdrawをJSONとして生成します。結果は要求送信までを示します。会話でPNG・JSONの実ファイルを受け取る用途にはprepare_annotation_exportを使用できます。
View tool JSON
{
"name": "start_annotations_json_download",
"kind": "act",
"impl": "imperative",
"description": "ブラウザーのダウンロード一覧でJSONを受け取るための保存要求です。expectedRevisionが現在の版と一致し、注釈がある場合に現在のdrawをJSONとして生成します。結果は要求送信までを示します。会話でPNG・JSONの実ファイルを受け取る用途にはprepare_annotation_exportを使用できます。",
"inputSchema": {
"type": "object",
"additionalProperties": false,
"required": [
"expectedRevision"
],
"properties": {
"expectedRevision": {
"type": "integer",
"minimum": 0
}
}
},
"page": "/annoforge/"
}export_annotated_imageAction
PNG単体をData URLで取得するか、ブラウザーのダウンロード一覧へ保存要求する用途です。expectedRevisionが現在の版と一致する場合に元画像寸法で生成し、表示のパン・ズーム・選択状態は含めません。data_urlの結果は文字列、downloadの結果は要求送信の通知です。会話でPNG・JSONの実ファイルを受け取る用途にはprepare_annotation_exportを使用できます。
View tool JSON
{
"name": "export_annotated_image",
"kind": "act",
"impl": "imperative",
"description": "PNG単体をData URLで取得するか、ブラウザーのダウンロード一覧へ保存要求する用途です。expectedRevisionが現在の版と一致する場合に元画像寸法で生成し、表示のパン・ズーム・選択状態は含めません。data_urlの結果は文字列、downloadの結果は要求送信の通知です。会話でPNG・JSONの実ファイルを受け取る用途にはprepare_annotation_exportを使用できます。",
"inputSchema": {
"type": "object",
"additionalProperties": false,
"required": [
"expectedRevision",
"delivery"
],
"properties": {
"expectedRevision": {
"type": "integer",
"minimum": 0
},
"delivery": {
"type": "string",
"enum": [
"data_url",
"download"
]
}
}
},
"page": "/annoforge/"
}prepare_annotation_exportAction
会話へ渡す元画像寸法PNGと完全な注釈JSONの実ファイルを準備します。同じexpectedRevisionの2ファイルのexportId・名前・バイト数・SHA-256を返します。read_annotation_exportの戻り値を同じJavaScript実行環境で復号・ファイル保存し、検証した絶対パスを最終回答の画像とファイルリンクに使えます。ブラウザーダウンロードは使いません。準備済み出力は1組で、新しい準備・画像や注釈の編集・release_annotation_export・ページ終了で無効になります。
View tool JSON
{
"name": "prepare_annotation_export",
"kind": "act",
"impl": "imperative",
"description": "会話へ渡す元画像寸法PNGと完全な注釈JSONの実ファイルを準備します。同じexpectedRevisionの2ファイルのexportId・名前・バイト数・SHA-256を返します。read_annotation_exportの戻り値を同じJavaScript実行環境で復号・ファイル保存し、検証した絶対パスを最終回答の画像とファイルリンクに使えます。ブラウザーダウンロードは使いません。準備済み出力は1組で、新しい準備・画像や注釈の編集・release_annotation_export・ページ終了で無効になります。",
"inputSchema": {
"type": "object",
"additionalProperties": false,
"required": [
"expectedRevision"
],
"properties": {
"expectedRevision": {
"type": "integer",
"minimum": 0
}
}
},
"page": "/annoforge/"
}read_annotation_exportAnswer
prepare_annotation_exportで準備したPNGまたはJSONの実バイト列を、指定範囲のbase64として返します。offsetからnextOffsetまでの各範囲を呼出しコード内で復号して順番に保存でき、eofが末尾を示します。保存したファイルのバイト数・SHA-256を準備結果と照合します。base64はモデルによる転記ではなくプログラムで扱うデータです。
View tool JSON
{
"name": "read_annotation_export",
"kind": "answer",
"impl": "imperative",
"description": "prepare_annotation_exportで準備したPNGまたはJSONの実バイト列を、指定範囲のbase64として返します。offsetからnextOffsetまでの各範囲を呼出しコード内で復号して順番に保存でき、eofが末尾を示します。保存したファイルのバイト数・SHA-256を準備結果と照合します。base64はモデルによる転記ではなくプログラムで扱うデータです。",
"inputSchema": {
"type": "object",
"additionalProperties": false,
"required": [
"exportId",
"format",
"offset",
"maxBytes"
],
"properties": {
"exportId": {
"type": "string",
"minLength": 1
},
"format": {
"type": "string",
"enum": [
"png",
"json"
]
},
"offset": {
"type": "integer",
"minimum": 0
},
"maxBytes": {
"type": "integer",
"minimum": 1,
"maximum": 1048576,
"default": 262144
}
}
},
"page": "/annoforge/"
}release_annotation_exportAction
指定したexportIdが現在の準備済み出力と一致する場合だけメモリーから解放します。画像と注釈、取得済みファイルは変更しません。既に解放済みの場合はreleased:falseを返します。
View tool JSON
{
"name": "release_annotation_export",
"kind": "act",
"impl": "imperative",
"description": "指定したexportIdが現在の準備済み出力と一致する場合だけメモリーから解放します。画像と注釈、取得済みファイルは変更しません。既に解放済みの場合はreleased:falseを返します。",
"inputSchema": {
"type": "object",
"additionalProperties": false,
"required": [
"exportId"
],
"properties": {
"exportId": {
"type": "string",
"minLength": 1
}
}
},
"page": "/annoforge/"
}