Feature/python api image discovery (#34)
* Expose chat.analyzeMediaImage in Python API for batch image metadata generation * Fix updateMedia losing linkedPostIds by reading existing sidecar before overwriting * Also preserve author from sidecar when DB value is null (data drift) * Extend MetadataDiffEngine to cover media, scripts, and templates * Redesign MetadataDiffPanel: item-first view with field pills, filtering, and per-item multi-field diffs * Fix task:progress startsWith crash (taskId not id) and nested button violation in field pills * Populate field diffs for file-missing items and show fileMissing badge in UI * feat: extended meta diff * feat: meta diff als reconstructs orphans * chore: updated documentation --------- Co-authored-by: hugo <hugoms@me.com>
This commit is contained in:
50
API.md
50
API.md
@@ -1,6 +1,6 @@
|
||||
# API Documentation
|
||||
|
||||
Contract version: 1.10.0
|
||||
Contract version: 1.11.0
|
||||
|
||||
This reference documents all Python runtime API calls available through `bds_api` in embedded Pyodide.
|
||||
|
||||
@@ -3462,8 +3462,42 @@ result = await bds.tags.sync_from_posts()
|
||||
|
||||
**Module APIs**
|
||||
|
||||
- [chat.analyzeMediaImage](#chatanalyzemediaimage)
|
||||
- [chat.detectPostLanguage](#chatdetectpostlanguage)
|
||||
|
||||
### chat.analyzeMediaImage
|
||||
|
||||
Analyze an image and generate title, alt text, and caption using AI.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- mediaId (str, required)
|
||||
- language (str, optional)
|
||||
|
||||
**Response specification**
|
||||
|
||||
- Return type: `ImageAnalysisResult`
|
||||
- Data structures: `ImageAnalysisResult`
|
||||
|
||||
**Example call**
|
||||
|
||||
```python
|
||||
from bds_api import bds
|
||||
result = await bds.chat.analyze_media_image(media_id='media-1')
|
||||
```
|
||||
|
||||
**Example response**
|
||||
|
||||
```python
|
||||
{
|
||||
'success': False,
|
||||
'title': 'value',
|
||||
'alt': 'value',
|
||||
'caption': 'value',
|
||||
'error': 'value'
|
||||
}
|
||||
```
|
||||
|
||||
### chat.detectPostLanguage
|
||||
|
||||
Detect the language of a post from its title and content.
|
||||
@@ -4065,6 +4099,20 @@ Aggregate result from uploading the rendered site.
|
||||
|
||||
[↑ Back to Table of contents](#table-of-contents)
|
||||
|
||||
### ImageAnalysisResult
|
||||
|
||||
Result from AI image analysis containing generated title, alt text, and caption.
|
||||
|
||||
**Fields**
|
||||
|
||||
- success (`boolean`, required): Whether the analysis succeeded.
|
||||
- title (`string`, optional): Generated image title (3-8 words).
|
||||
- alt (`string`, optional): Generated alt text (5-12 words).
|
||||
- caption (`string`, optional): Generated blog caption (5-20 words).
|
||||
- error (`string`, optional): Error message when analysis failed.
|
||||
|
||||
[↑ Back to Table of contents](#table-of-contents)
|
||||
|
||||
---
|
||||
|
||||
Generated from contract at 2026-02-27T00:00:00.000Z.
|
||||
|
||||
Reference in New Issue
Block a user