Ir a la documentación
Abrir panel
En esta página

Referencias con nombre

Las etiquetas de referencia se vinculan a los ID de tus recursos. Consulta las capacidades del modelo elegido y conserva las etiquetas, el orden y la configuración al cotizar y enviar.

Vínculos de referencia#

Sustituye los ID de modelo, los campos de referencia y las revisiones del ejemplo por los valores actuales del catálogo. La compatibilidad depende del modelo y del flujo.

Cotizar con referencias#

curl -X POST 'https://platform.tongai.io/v1/tools/tong_generation_quote/operations' \  -H "Authorization: Bearer $TONG_API_KEY" \  -H "Content-Type: application/json" \  -H "Idempotency-Key: 45be69f1-c266-4a09-a82c-bf3c6303eb03" \  -d '{  "input": {    "body": {      "operation": "IMAGE_EDIT",      "model": "MODEL_ID_FROM_DISCOVERY",      "inputAssetIds": [        "aaaaaaaaaaaaaaaaaaaaaaaa",        "bbbbbbbbbbbbbbbbbbbbbbbb"      ],      "referenceRequest": {        "prompt": "Keep the subject in @Image1 and use the setting in @Image2.",        "assetIds": [          "aaaaaaaaaaaaaaaaaaaaaaaa",          "bbbbbbbbbbbbbbbbbbbbbbbb"        ],        "direction": {          "version": 1,          "capabilityRevision": "REVISION_FROM_MODEL_CONFIGURATION",          "references": [            {              "id": "subject",              "assetId": "aaaaaaaaaaaaaaaaaaaaaaaa",              "field": "images",              "label": "Image1"            },            {              "id": "setting",              "assetId": "bbbbbbbbbbbbbbbbbbbbbbbb",              "field": "images",              "label": "Image2"            }          ]        }      }    }  }}'
Configuración
curl --version

Enviar con referencias#

curl -X POST 'https://platform.tongai.io/v1/tools/tong_generation_submit/operations' \  -H "Authorization: Bearer $TONG_API_KEY" \  -H "Content-Type: application/json" \  -H "Idempotency-Key: 45be69f1-c266-4a09-a82c-bf3c6303eb03" \  -d '{  "input": {    "params": {      "id": "cccccccccccccccccccccccc"    },    "body": {      "operation": "IMAGE_EDIT",      "quoteId": "QUOTE_SUBMIT_VALUE",      "prompt": "Keep the subject in @Image1 and use the setting in @Image2.",      "inputAssetIds": [        "aaaaaaaaaaaaaaaaaaaaaaaa",        "bbbbbbbbbbbbbbbbbbbbbbbb"      ],      "parameters": {        "imageModel": "MODEL_ID_FROM_DISCOVERY",        "referenceDirection": {          "version": 1,          "capabilityRevision": "REVISION_FROM_MODEL_CONFIGURATION",          "references": [            {              "id": "subject",              "assetId": "aaaaaaaaaaaaaaaaaaaaaaaa",              "field": "images",              "label": "Image1"            },            {              "id": "setting",              "assetId": "bbbbbbbbbbbbbbbbbbbbbbbb",              "field": "images",              "label": "Image2"            }          ]        }      }    }  }}'
Configuración
curl --version

Referencias de Assistant#

curl -X POST 'https://platform.tongai.io/v1/tools/tong_assistant_start/operations' \  -H "Authorization: Bearer $TONG_API_KEY" \  -H "Content-Type: application/json" \  -H "Idempotency-Key: 45be69f1-c266-4a09-a82c-bf3c6303eb03" \  -d '{  "input": {    "message": "Animate @Image1 and preserve the subject in @Image2.",    "attachments": [      "aaaaaaaaaaaaaaaaaaaaaaaa",      "bbbbbbbbbbbbbbbbbbbbbbbb"    ],    "reference_bindings": [      {        "label": "Image1",        "assetId": "aaaaaaaaaaaaaaaaaaaaaaaa"      },      {        "label": "Image2",        "assetId": "bbbbbbbbbbbbbbbbbbbbbbbb"      }    ],    "mode": "guided"  }}'
Configuración
curl --version