set_ai_source
AI SOURCE (CSV-joined enrichment) — store per-product values that YOU (the client's own model) extracted, as a new 'AI source' attribute — so a feed rule can read the attribute directly without matching free text with contains/conditions. Use this to store values your own model extracted per product. Typical flow: call preview_products to read products, derive ONE value per product with your own reasoning (e.g. the color, gender, or material from the title/description), then call this with values as a JSON OBJECT (not an array) mapping each product's id (the id field from preview_products) to the extracted value. code is the new attribute name (e.g. "ai_color"); once applied it becomes the source attribute custom_ (visible in list_source_attributes). Send large catalogs in BATCHES: first batch mode:"replace", following batches mode:"append". This only STORES the values; after the LAST batch call run_ai_source_import so they land on products (an ASYNCHRONOUS import). VERIFY before using it: poll get_import_status until the newest additional_source run in recentRuns has running:false and status 'ok', and the code appears in list_source_attributes; only THEN attach the attribute to a feed with map_feed_attribute. If that run errors, run_ai_source_import retries without re-sending the values. handle overrides the product key to join on (default header.id, which matches the preview_products id). project_id is OPTIONAL (inferred for a single-project customer). If this feature is not included in this Koongo account, the call is refused with error 'addon_required' (HTTP 403); tell the user it is not available for this account and do not retry. Returns {status:'written', code, url, valueCount, applied:false}. The default mode replace OVERWRITES every stored value of the source.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"code": "<code>",
"values": "<values>"
},
"name": "set_ai_source"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| mode | No | ||
| handle | No | ||
| values | Yes | ||
| project_id | No |