diff --git a/MEMORY_TEMPLATE_UPDATE.md b/MEMORY_TEMPLATE_UPDATE.md new file mode 100644 index 0000000..97080c4 --- /dev/null +++ b/MEMORY_TEMPLATE_UPDATE.md @@ -0,0 +1,330 @@ +# Template Update Process - Quick Reference + +## Overview + +The n8n-mcp project maintains a database of workflow templates from n8n.io. This guide explains how to update the template database incrementally without rebuilding from scratch. + +## Current Database State + +As of the last update: +- **2,598 templates** in database +- Templates from the last 12 months +- Latest template: September 12, 2025 + +## Quick Commands + +### Incremental Update (Recommended) +```bash +# Build if needed +npm run build + +# Fetch only NEW templates (5-10 minutes) +npm run fetch:templates:update +``` + +### Full Rebuild (Rare) +```bash +# Rebuild entire database from scratch (30-40 minutes) +npm run fetch:templates +``` + +## How It Works + +### Incremental Update Mode (`--update`) + +The incremental update is **smart and efficient**: + +1. **Loads existing template IDs** from database (~2,598 templates) +2. **Fetches template list** from n8n.io API (all templates from last 12 months) +3. **Filters** to find only NEW templates not in database +4. **Fetches details** for new templates only (saves time and API calls) +5. **Saves** new templates to database (existing ones untouched) +6. **Rebuilds FTS5** search index for new templates + +### Key Benefits + +✅ **Non-destructive**: All existing templates preserved +✅ **Fast**: Only fetches new templates (5-10 min vs 30-40 min) +✅ **API friendly**: Reduces load on n8n.io API +✅ **Safe**: Preserves AI-generated metadata +✅ **Smart**: Automatically skips duplicates + +## Performance Comparison + +| Mode | Templates Fetched | Time | Use Case | +|------|------------------|------|----------| +| **Update** | Only new (~50-200) | 5-10 min | Regular updates | +| **Rebuild** | All (~8000+) | 30-40 min | Initial setup or corruption | + +## Command Options + +### Basic Update +```bash +npm run fetch:templates:update +``` + +### Full Rebuild +```bash +npm run fetch:templates +``` + +### With Metadata Generation +```bash +# Update templates and generate AI metadata +npm run fetch:templates -- --update --generate-metadata + +# Or just generate metadata for existing templates +npm run fetch:templates -- --metadata-only +``` + +### Help +```bash +npm run fetch:templates -- --help +``` + +## Update Frequency + +Recommended update schedule: +- **Weekly**: Run incremental update to get latest templates +- **Monthly**: Review database statistics +- **As needed**: Rebuild only if database corruption suspected + +## Template Filtering + +The fetcher automatically filters templates: +- ✅ **Includes**: Templates from last 12 months +- ✅ **Includes**: Templates with >10 views +- ❌ **Excludes**: Templates with ≤10 views (too niche) +- ❌ **Excludes**: Templates older than 12 months + +## Workflow + +### Regular Update Workflow + +```bash +# 1. Check current state +sqlite3 data/nodes.db "SELECT COUNT(*) FROM templates" + +# 2. Build project (if code changed) +npm run build + +# 3. Run incremental update +npm run fetch:templates:update + +# 4. Verify new templates added +sqlite3 data/nodes.db "SELECT COUNT(*) FROM templates" +``` + +### After n8n Dependency Update + +When you update n8n dependencies, templates remain compatible: +```bash +# 1. Update n8n (from MEMORY_N8N_UPDATE.md) +npm run update:all + +# 2. Fetch new templates incrementally +npm run fetch:templates:update + +# 3. Check how many templates were added +sqlite3 data/nodes.db "SELECT COUNT(*) FROM templates" + +# 4. Generate AI metadata for new templates (optional, requires OPENAI_API_KEY) +npm run fetch:templates -- --metadata-only +``` + +Templates are independent of n8n version - they're just workflow JSON data. + +**Note**: New templates fetched via `--update` mode will NOT have AI-generated metadata by default. You need to run `--metadata-only` separately to generate metadata for templates that don't have it yet. + +## Troubleshooting + +### No New Templates Found + +This is normal! It means: +- All recent templates are already in your database +- n8n.io hasn't published many new templates recently +- Your database is up to date + +```bash +📊 Update mode: 0 new templates to fetch (skipping 2598 existing) +✅ All templates already have metadata +``` + +### API Rate Limiting + +If you hit rate limits: +- The fetcher includes built-in delays (150ms between requests) +- Wait a few minutes and try again +- Use `--update` mode instead of full rebuild + +### Database Corruption + +If you suspect corruption: +```bash +# Full rebuild from scratch +npm run fetch:templates + +# This will: +# - Drop and recreate templates table +# - Fetch all templates fresh +# - Rebuild search indexes +``` + +## Database Schema + +Templates are stored with: +- Basic info (id, name, description, author, views, created_at) +- Node types used (JSON array) +- Complete workflow (gzip compressed, base64 encoded) +- AI-generated metadata (optional, requires OpenAI API key) +- FTS5 search index for fast text search + +## Metadata Generation + +Generate AI metadata for templates: +```bash +# Requires OPENAI_API_KEY in .env +export OPENAI_API_KEY="sk-..." + +# Generate for templates without metadata (recommended after incremental update) +npm run fetch:templates -- --metadata-only + +# Generate during template fetch (slower, but automatic) +npm run fetch:templates:update -- --generate-metadata +``` + +**Important**: Incremental updates (`--update`) do NOT generate metadata by default. After running `npm run fetch:templates:update`, you'll have new templates without metadata. Run `--metadata-only` separately to generate metadata for them. + +### Check Metadata Coverage + +```bash +# See how many templates have metadata +sqlite3 data/nodes.db "SELECT + COUNT(*) as total, + SUM(CASE WHEN metadata_json IS NOT NULL THEN 1 ELSE 0 END) as with_metadata, + SUM(CASE WHEN metadata_json IS NULL THEN 1 ELSE 0 END) as without_metadata +FROM templates" + +# See recent templates without metadata +sqlite3 data/nodes.db "SELECT id, name, created_at +FROM templates +WHERE metadata_json IS NULL +ORDER BY created_at DESC +LIMIT 10" +``` + +Metadata includes: +- Categories +- Complexity level (simple/medium/complex) +- Use cases +- Estimated setup time +- Required services +- Key features +- Target audience + +### Metadata Generation Troubleshooting + +If metadata generation fails: + +1. **Check error file**: Errors are saved to `temp/batch/batch_*_error.jsonl` +2. **Common issues**: + - `"Unsupported value: 'temperature'"` - Model doesn't support custom temperature + - `"Invalid request"` - Check OPENAI_API_KEY is valid + - Model availability issues +3. **Model**: Uses `gpt-5-mini-2025-08-07` by default +4. **Token limit**: 3000 tokens per request for detailed metadata + +The system will automatically: +- Process error files and assign default metadata to failed templates +- Save error details for debugging +- Continue processing even if some templates fail + +**Example error handling**: +```bash +# If you see: "No output file available for batch job" +# Check: temp/batch/batch_*_error.jsonl for error details +# The system now automatically processes errors and generates default metadata +``` + +## Environment Variables + +Optional configuration: +```bash +# OpenAI for metadata generation +OPENAI_API_KEY=sk-... +OPENAI_MODEL=gpt-4o-mini # Default model +OPENAI_BATCH_SIZE=50 # Batch size for metadata generation + +# Metadata generation limits +METADATA_LIMIT=100 # Max templates to process (0 = all) +``` + +## Statistics + +After update, check stats: +```bash +# Template count +sqlite3 data/nodes.db "SELECT COUNT(*) FROM templates" + +# Most recent template +sqlite3 data/nodes.db "SELECT MAX(created_at) FROM templates" + +# Templates by view count +sqlite3 data/nodes.db "SELECT COUNT(*), + CASE + WHEN views < 50 THEN '<50' + WHEN views < 100 THEN '50-100' + WHEN views < 500 THEN '100-500' + ELSE '500+' + END as view_range + FROM templates GROUP BY view_range" +``` + +## Integration with n8n-mcp + +Templates are available through MCP tools: +- `list_templates`: List all templates +- `get_template`: Get specific template with workflow +- `search_templates`: Search by keyword +- `list_node_templates`: Templates using specific nodes +- `get_templates_for_task`: Templates for common tasks +- `search_templates_by_metadata`: Advanced filtering + +See `npm run test:templates` for usage examples. + +## Time Estimates + +Typical incremental update: +- Loading existing IDs: 1-2 seconds +- Fetching template list: 2-3 minutes +- Filtering new templates: instant +- Fetching details for 100 new templates: ~15 seconds (0.15s each) +- Saving and indexing: 5-10 seconds +- **Total: 3-5 minutes** + +Full rebuild: +- Fetching 8000+ templates: 25-30 minutes +- Saving and indexing: 5-10 minutes +- **Total: 30-40 minutes** + +## Best Practices + +1. **Use incremental updates** for regular maintenance +2. **Rebuild only when necessary** (corruption, major changes) +3. **Generate metadata incrementally** to avoid OpenAI costs +4. **Monitor template count** to verify updates working +5. **Keep database backed up** before major operations + +## Next Steps + +After updating templates: +1. Test template search: `npm run test:templates` +2. Verify MCP tools work: Test in Claude Desktop +3. Check statistics in database +4. Commit changes if desired (database changes) + +## Related Documentation + +- `MEMORY_N8N_UPDATE.md` - Updating n8n dependencies +- `CLAUDE.md` - Project overview and architecture +- `README.md` - User documentation \ No newline at end of file diff --git a/data/nodes.db b/data/nodes.db index 28a7822..a965995 100644 Binary files a/data/nodes.db and b/data/nodes.db differ diff --git a/docs/batch_68db8255da0c8190a71d57e1ff76333e_error.jsonl b/docs/batch_68db8255da0c8190a71d57e1ff76333e_error.jsonl new file mode 100644 index 0000000..c3e59df --- /dev/null +++ b/docs/batch_68db8255da0c8190a71d57e1ff76333e_error.jsonl @@ -0,0 +1,112 @@ +{"id": "batch_req_68db84f9b1608190905d075cdff34e03", "custom_id": "template-3443", "response": {"status_code": 400, "request_id": "8359066bb976124a37c33b780e840d5c", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84fad45c8190a8bb0903beed487a", "custom_id": "template-2415", "response": {"status_code": 400, "request_id": "ee2f767ac83b2d7c0b59837c42e4a20c", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84fac1f08190962b0264cf0a5ded", "custom_id": "template-3654", "response": {"status_code": 400, "request_id": "802eb96d3c255bbb319d4405a3f4651a", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84f9acdc81909c30c1b0262a9701", "custom_id": "template-3657", "response": {"status_code": 400, "request_id": "d4fe9b0253879e061e0b4dda813a01dd", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84f9af5c81908eed58d785b2872f", "custom_id": "template-4968", "response": {"status_code": 400, "request_id": "1f19edc45d0ea8ffd2562ee10fae79be", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84fa0e6081908e24baf2e38fbec3", "custom_id": "template-2907", "response": {"status_code": 400, "request_id": "d9b9404ab4ed27dc93cea01ab545a3a9", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84f9cc748190b4bd0729a36936fc", "custom_id": "template-4452", "response": {"status_code": 400, "request_id": "a380f18bbbdfbde1195b8d28d34317d5", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84f9c2188190ae8a4a4b6befbe23", "custom_id": "template-4635", "response": {"status_code": 400, "request_id": "796bfa695c2178b8c2d9b745ddc6bad5", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84fa04048190aeb6d6930326740f", "custom_id": "template-2463", "response": {"status_code": 400, "request_id": "d0491ad90f65b0bfc5af7d4b5b2c5560", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84faa8908190b454a31038b8b7ce", "custom_id": "template-3796", "response": {"status_code": 400, "request_id": "61f73f1c05307e996ca9ae28e614b2eb", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84fbb8948190a45ba857c2ec11c7", "custom_id": "template-3585", "response": {"status_code": 400, "request_id": "29e47af07c2555700b6b1736e942d6ce", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84fb7fb08190bd18b773b4aa7470", "custom_id": "template-5835", "response": {"status_code": 400, "request_id": "ce38b2d32c2c142a2f160ac034288be6", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84fb76988190a7965ace4186a569", "custom_id": "template-3335", "response": {"status_code": 400, "request_id": "bfd480657d60b3c5b48a9a12f7c81f22", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84fb0f9c819095ad1a76ce40a039", "custom_id": "template-2737", "response": {"status_code": 400, "request_id": "0af82b259d78681f9dc668f9254b98b1", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84fc40848190ae1f4d6aa18097d3", "custom_id": "template-2919", "response": {"status_code": 400, "request_id": "f87aa5b793678f91dd52891050c233f7", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84fb51808190b5ced47d254ab9ff", "custom_id": "template-3010", "response": {"status_code": 400, "request_id": "4742344507233e0785bdf4bf16bfe25b", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84fb6b04819094d8832bcbaf69ba", "custom_id": "template-2424", "response": {"status_code": 400, "request_id": "1651ab4779a2ba9877bb1337e1919f51", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84fc7b5881909d70d2adb910d443", "custom_id": "template-4237", "response": {"status_code": 400, "request_id": "3e1ea83af796b7ff39e1946b035f745b", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84fc0acc81908f3b2c26317fb6cf", "custom_id": "template-4589", "response": {"status_code": 400, "request_id": "d8870f16fee72be27ce38d3c305a99cb", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84fca0ac819096bb92148cbb74db", "custom_id": "template-3195", "response": {"status_code": 400, "request_id": "86d5de9ef23689df1393b9e7999313c2", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84fc6cb08190ac4d055c6de89ac3", "custom_id": "template-3670", "response": {"status_code": 400, "request_id": "a538447256c1206fca7386f2cef1d148", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84fcb03c819093ab53ffc05b2b21", "custom_id": "template-5385", "response": {"status_code": 400, "request_id": "ab80dfbc9433703ec3f506882ddcacf4", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84fcca748190be482766f1af859b", "custom_id": "template-3564", "response": {"status_code": 400, "request_id": "1495d3e38c9a61dbad7b5b6e41c06fbd", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84fdcdb08190a9181b98ea4aaa26", "custom_id": "template-3599", "response": {"status_code": 400, "request_id": "dff0ed669b037885acc41dfaaea3633c", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84fd30bc8190a42a61c1dcb0b024", "custom_id": "template-3829", "response": {"status_code": 400, "request_id": "de5d9430ca60c6d1cfffd2077088b19e", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84fd449481909be67a5c1b3e9b1d", "custom_id": "template-3581", "response": {"status_code": 400, "request_id": "4d01c8aae8d3ca64aa7bbb38e310901e", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84fd714081908e6fcfb047d94422", "custom_id": "template-3725", "response": {"status_code": 400, "request_id": "96850d2d3d5bc1325643b22fa7b15a9e", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84fd84f48190bcf515d89ad12ad6", "custom_id": "template-4152", "response": {"status_code": 400, "request_id": "567809141b1bc8fd127679571e7c20f4", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84fdbf548190a167d4568751d019", "custom_id": "template-4226", "response": {"status_code": 400, "request_id": "0f20a55f06831fae0e00f9de97ecb6d9", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84fe10248190b94dae49381a91fa", "custom_id": "template-5904", "response": {"status_code": 400, "request_id": "22cf13e72a1b1235490435573884c043", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84fdf5ec8190b2b693b5f679459a", "custom_id": "template-8428", "response": {"status_code": 400, "request_id": "d9215cafc3d63b6c237786fce0fe049b", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84fe0b548190be21dfd1ba908db8", "custom_id": "template-2932", "response": {"status_code": 400, "request_id": "387ba03a4ec621cf7419b65b272a38a2", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84fe84208190833aaafc17b63ed4", "custom_id": "template-4004", "response": {"status_code": 400, "request_id": "399f866fcca20032ab3617176c6374b8", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84ff36188190a88c9ae9f4ac5ef7", "custom_id": "template-4744", "response": {"status_code": 400, "request_id": "82922f3b57cfc5c4d895ce9e9bfb6630", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84feb9d88190a880a7a9f85da56a", "custom_id": "template-6653", "response": {"status_code": 400, "request_id": "a9cf310dc718f72ad28a9ca7e8cbc031", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84feb4348190a2d7ddbd3a3d99f2", "custom_id": "template-8326", "response": {"status_code": 400, "request_id": "b2c304a13a4cf219fe9f3c603b02c597", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84feca8481908e24726c0965c842", "custom_id": "template-3794", "response": {"status_code": 400, "request_id": "4f7afb24e633f7a60874de2761745fbd", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84ff6760819089589f56b1078463", "custom_id": "template-4372", "response": {"status_code": 400, "request_id": "e4e4c59a3f64ba65b6fd788ff0688e50", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84ff5f3081909fc60d5dcf5dc0bd", "custom_id": "template-4834", "response": {"status_code": 400, "request_id": "537adf89871f0afd74e88f6545272208", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84ff4e088190b063a3f47dbedd2e", "custom_id": "template-5146", "response": {"status_code": 400, "request_id": "d308c392f5529e4ebae7aac9e7473ae8", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84ff4d848190aff48c247d56368b", "custom_id": "template-3788", "response": {"status_code": 400, "request_id": "c7d52ebe72253b8c76458270cad23da2", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84ff5d4c81908ab675efd7603569", "custom_id": "template-3828", "response": {"status_code": 400, "request_id": "da202a2c5cf38c11da469a6a1da0ab24", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db85013c308190b8b3b9ff0f722571", "custom_id": "template-4564", "response": {"status_code": 400, "request_id": "94e8f5ddf62b145d3d6a830b17eb3847", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84fff7f88190accf02fc9410cdd0", "custom_id": "template-8260", "response": {"status_code": 400, "request_id": "14cfe8c70551a3d88e0d8dcdc00624a6", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db84fff9108190be09631fc849b2ae", "custom_id": "template-8604", "response": {"status_code": 400, "request_id": "429800a0dbeea60c8dad66f86bab6f45", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db850051a081908a75e0d6661fe942", "custom_id": "template-7608", "response": {"status_code": 400, "request_id": "f9ba7bc9464b6721f6a8b7a31e693b5e", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db85009da481908062a78efcf9a416", "custom_id": "template-5103", "response": {"status_code": 400, "request_id": "011e69c3ef9a11d41313e23e90cb0c1f", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db85009e508190a3558be373374ca2", "custom_id": "template-8591", "response": {"status_code": 400, "request_id": "4d471a76797ab9c73c99078919b6262f", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db8500c5cc8190abd8d54be2214645", "custom_id": "template-8450", "response": {"status_code": 400, "request_id": "b4bca43a0a761e8fe238acc59ff2fde2", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db850330dc8190836d7ed2b853c6b8", "custom_id": "template-6840", "response": {"status_code": 400, "request_id": "8145bf9e3583fc39e13dbb639a1d889d", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db8500ab808190839914a4d7aae10f", "custom_id": "template-7480", "response": {"status_code": 400, "request_id": "f23a9ceb15ed5ddbb975b48d650a9da1", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db8501052881908adf93ab1bafb9ab", "custom_id": "template-4503", "response": {"status_code": 400, "request_id": "5539460de0359b55fd41d61f1000222e", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db850150148190909df8e1b1b566ae", "custom_id": "template-4980", "response": {"status_code": 400, "request_id": "50640a00f59c0f461a105f598abc1f7b", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db85013e5081908056243f59315de4", "custom_id": "template-4416", "response": {"status_code": 400, "request_id": "a77181376db74649e83221c63f742adb", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db8501ec508190a1a5b4049ed574d0", "custom_id": "template-3568", "response": {"status_code": 400, "request_id": "873cf619d33adc6716d259ce4a4efaa5", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db8501efac81909e036a510ea6dddb", "custom_id": "template-6915", "response": {"status_code": 400, "request_id": "0e6e6c86e23630f919c2da2656682fde", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db8501ebc081909a0c943166cedd47", "custom_id": "template-3474", "response": {"status_code": 400, "request_id": "311cc0a805259b4b744d9543d5c8d056", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db85020910819085657bd1f13b8eb9", "custom_id": "template-4348", "response": {"status_code": 400, "request_id": "cb07b716652a9a7f8bc67fec8c904726", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db85023f0481909fe958875a52790e", "custom_id": "template-7971", "response": {"status_code": 400, "request_id": "251c4fb970663c87be3a4f3c0cccb3d0", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db850244608190ac9392c45b006812", "custom_id": "template-7607", "response": {"status_code": 400, "request_id": "68c8e9110a908086451b9c5d056c2914", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db850286348190b7d6eb8f7ee3e2df", "custom_id": "template-4762", "response": {"status_code": 400, "request_id": "cb4ab973a1ae4a6ce3928fa3185f6ae4", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db8502d43c81908e64d2b8c5d7449b", "custom_id": "template-4259", "response": {"status_code": 400, "request_id": "9c1b026ac0c4c4fb16b3569fcff61482", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db85029b9081909c43cb49b9e35c5b", "custom_id": "template-6186", "response": {"status_code": 400, "request_id": "b26f2ab40f25a3d873630663f162e14e", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db85034e3c8190ba6187faa0f6a198", "custom_id": "template-6835", "response": {"status_code": 400, "request_id": "b2dfaed72870c8085350bd43ac426008", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db85043f648190bb8c42ae320fe1fa", "custom_id": "template-6767", "response": {"status_code": 400, "request_id": "31edfc6256915312444fbcb1467394b8", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db85033c088190b1637559b5e718ae", "custom_id": "template-8724", "response": {"status_code": 400, "request_id": "149f635bfed116d6a47889bea492be83", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db8504b3ec81909af17cafb7f0ca4e", "custom_id": "template-8500", "response": {"status_code": 400, "request_id": "db8968a5cfd2333a00b680f8dbd6fbe5", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db850385c4819092d4f7fb9dd3468f", "custom_id": "template-4625", "response": {"status_code": 400, "request_id": "5f276595d5e6143111e37097aee330fb", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db85038ed48190b2d088d5ef53b1c6", "custom_id": "template-8773", "response": {"status_code": 400, "request_id": "d35ed0519b284438402a412207b6172b", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db8503ec348190be325eb4f3892d12", "custom_id": "template-5710", "response": {"status_code": 400, "request_id": "4cf9f6dc67cea9f47c354816639593cb", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db850407c08190b62dc8da00225387", "custom_id": "template-5313", "response": {"status_code": 400, "request_id": "364de17b04bb64e3c41b4b9865ef01dd", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db85058cf88190b1938527e530d0c3", "custom_id": "template-5238", "response": {"status_code": 400, "request_id": "4de4218285633d5db29441035186343a", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db85050f708190980237bcbd594730", "custom_id": "template-7381", "response": {"status_code": 400, "request_id": "389f253c49e90857951b366ea62a2a9f", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db8504971c81908b9211ed1b995301", "custom_id": "template-5055", "response": {"status_code": 400, "request_id": "5fda0c473f8b342ac014570058240011", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db85049f8c819089a06257bb9fd3b7", "custom_id": "template-4014", "response": {"status_code": 400, "request_id": "3001b466d02148a63190050bed33c03b", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db8504cf5481909ce2b944e74acfed", "custom_id": "template-8292", "response": {"status_code": 400, "request_id": "be2d5d6d16caa3dcb1c24586800eb32e", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db8504fac48190bd00426b044e40a8", "custom_id": "template-8779", "response": {"status_code": 400, "request_id": "f269a24ae7bce532eeb26108f62e1c12", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db85058f848190a7c08c6eac9625cd", "custom_id": "template-8644", "response": {"status_code": 400, "request_id": "8165ce4e71ffb9fa40eb88c58bb75d5b", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db85055b24819096b64d7ceb79bd2c", "custom_id": "template-6547", "response": {"status_code": 400, "request_id": "613af9b493591fea47ff10f74cbdaf8b", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db8505946c819097196c575d8efd96", "custom_id": "template-6771", "response": {"status_code": 400, "request_id": "b20cc5aa88acadc4f6d8290df64c270a", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db85065eec8190b06d1d0a40e6f0a8", "custom_id": "template-8549", "response": {"status_code": 400, "request_id": "1ff6ea42d3a837cbfd663c9ecf97110c", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db85064b4c8190b488d2ca172a227f", "custom_id": "template-8592", "response": {"status_code": 400, "request_id": "e35391b85e620c3f75aa06177d884cde", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db850612e4819088517a6093f87d55", "custom_id": "template-7038", "response": {"status_code": 400, "request_id": "f5cba3b185ae6da89a14e141a89e3799", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db85062a148190a178d383360d1ae7", "custom_id": "template-8654", "response": {"status_code": 400, "request_id": "88abcf3d6591680a26445e32404f757f", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db850651bc819082a143074d2d93d5", "custom_id": "template-5181", "response": {"status_code": 400, "request_id": "8adc0f35f1f4128191b42c5f69a995c5", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db850673348190b00ebd2758e528cc", "custom_id": "template-8597", "response": {"status_code": 400, "request_id": "faacd390af51cebd7638e65b84f4e79e", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db8506ae3c8190b34ad5f7520100fd", "custom_id": "template-8340", "response": {"status_code": 400, "request_id": "c440ae31bd87d4c6560382a33698fa53", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db8506d3888190be121b1f67e2de78", "custom_id": "template-8414", "response": {"status_code": 400, "request_id": "cb4ed3d0d72b37664a9200daa9c2fbb7", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db8506f4a8819081b0f4ace4a46b0e", "custom_id": "template-6027", "response": {"status_code": 400, "request_id": "cb24562a440aece1a7963386fc510e66", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db8506e2108190b8f19ff16cf47815", "custom_id": "template-3179", "response": {"status_code": 400, "request_id": "206b5cb75186d8c706bff99a513a58fe", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db8507b2248190b1a93b3a26a7250b", "custom_id": "template-8452", "response": {"status_code": 400, "request_id": "d6a20173cebd2e7ff7b4d21c90ada40c", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db850779488190a68155795caeb7ad", "custom_id": "template-8562", "response": {"status_code": 400, "request_id": "bb4f79de3140200fc1544696eb1fecc9", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db8507954481909c5708ef4e1328ff", "custom_id": "template-8676", "response": {"status_code": 400, "request_id": "b12a97a3ed2e46952af0dbc2b8a9b349", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db850928088190ab80b380cc6ce744", "custom_id": "template-8427", "response": {"status_code": 400, "request_id": "d14d6e67a41ba3a4b02583040052913c", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db8507a2b08190b9ead530902652f5", "custom_id": "template-7382", "response": {"status_code": 400, "request_id": "ef4c9dfc239ed14b28e3c472b0ec3f56", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db8508141081909fe88468545181ef", "custom_id": "template-5080", "response": {"status_code": 400, "request_id": "92ec26817a12ebf6b07fa22f1307bd85", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db8507f1ec819092f6ca9df24e4d43", "custom_id": "template-7387", "response": {"status_code": 400, "request_id": "ce83ac950fc363875c300d108c033601", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db850820a08190981fe922ec438e97", "custom_id": "template-8618", "response": {"status_code": 400, "request_id": "625aae4771d5a9d972cea61e1f902f59", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db850833e481908aa522f4210919f1", "custom_id": "template-8272", "response": {"status_code": 400, "request_id": "45bf3fb73ea6c60a48e7f31cc8b3d552", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db85084bc481909f3d8ccd4e705953", "custom_id": "template-8491", "response": {"status_code": 400, "request_id": "ef2e9d44af0523cd5113313eda957acc", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db8508c4b4819081ef3f268bb6a5bf", "custom_id": "template-8721", "response": {"status_code": 400, "request_id": "4acefcd585de93149b63e68eb79625e8", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db85097a488190908158705cfe8ea5", "custom_id": "template-8769", "response": {"status_code": 400, "request_id": "dd3b844de2295f211bcdf500ca240787", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db8509c02881909776efc4bece333a", "custom_id": "template-8904", "response": {"status_code": 400, "request_id": "1ba8a6b95cb55a62d5f6973e8cd9bbac", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db8509491c81908c763cdf6acca99a", "custom_id": "template-6165", "response": {"status_code": 400, "request_id": "75e3d9174dbb794b4043fd5e3bb5d451", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db8509488c8190a8a4094346cbb578", "custom_id": "template-8585", "response": {"status_code": 400, "request_id": "1a1325f0b36d4b23531d5ab44a3e7654", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db850967d881908e2751c7364dd714", "custom_id": "template-7684", "response": {"status_code": 400, "request_id": "534dc7231a9ff8bd329b0a0d175f0be7", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db850a954481909b7889ca7aeb143d", "custom_id": "template-5886", "response": {"status_code": 400, "request_id": "6347769851ffc4631f8a36594f6a88dc", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db850a071881909fe9e8eb2a91e3a3", "custom_id": "template-7510", "response": {"status_code": 400, "request_id": "8c63727f9b9f1d1a14fdf3597b8305e5", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db8509a4388190ab4ab89d5399b8b3", "custom_id": "template-7589", "response": {"status_code": 400, "request_id": "fdbec117ff3444a2c8dce70890e9fa19", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db850a83508190a766ca24c6f61071", "custom_id": "template-7993", "response": {"status_code": 400, "request_id": "d504c4ef8e79f49b95b560adc2a57a25", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db850a838c8190b80c58e4cefb243a", "custom_id": "template-8780", "response": {"status_code": 400, "request_id": "03b3dbc5458a97a65dfe70393af74ca3", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} +{"id": "batch_req_68db8510da6c8190a0ec4162cb69c95b", "custom_id": "template-8015", "response": {"status_code": 400, "request_id": "c64effd348eeeefc022939f0dcdd6405", "body": {"error": {"message": "Unsupported value: 'temperature' does not support 0.3 with this model. Only the default (1) value is supported.", "type": "invalid_request_error", "param": "temperature", "code": "unsupported_value"}}}, "error": null} diff --git a/package.json b/package.json index bfc6c8a..721a8b2 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "update:n8n": "node scripts/update-n8n-deps.js", "update:n8n:check": "node scripts/update-n8n-deps.js --dry-run", "fetch:templates": "node dist/scripts/fetch-templates.js", + "fetch:templates:update": "node dist/scripts/fetch-templates.js --update", "fetch:templates:robust": "node dist/scripts/fetch-templates-robust.js", "prebuild:fts5": "npx tsx scripts/prebuild-fts5.ts", "test:templates": "node dist/scripts/test-templates.js", diff --git a/src/templates/batch-processor.ts b/src/templates/batch-processor.ts index 4042458..80d7567 100644 --- a/src/templates/batch-processor.ts +++ b/src/templates/batch-processor.ts @@ -312,31 +312,80 @@ export class BatchProcessor { * Retrieve and parse results */ private async retrieveResults(batchJob: any): Promise { - if (!batchJob.output_file_id) { - throw new Error('No output file available for batch job'); - } - - // Download result file - const fileResponse = await this.client.files.content(batchJob.output_file_id); - const fileContent = await fileResponse.text(); - - // Parse JSONL results const results: MetadataResult[] = []; - const lines = fileContent.trim().split('\n'); - - for (const line of lines) { - if (!line) continue; - + + // Check if we have an output file (successful results) + if (batchJob.output_file_id) { + const fileResponse = await this.client.files.content(batchJob.output_file_id); + const fileContent = await fileResponse.text(); + + const lines = fileContent.trim().split('\n'); + for (const line of lines) { + if (!line) continue; + try { + const result = JSON.parse(line); + const parsed = this.generator.parseResult(result); + results.push(parsed); + } catch (error) { + logger.error('Error parsing result line:', error); + } + } + logger.info(`Retrieved ${results.length} successful results from batch job`); + } + + // Check if we have an error file (failed results) + if (batchJob.error_file_id) { + logger.warn(`Batch job has error file: ${batchJob.error_file_id}`); + try { - const result = JSON.parse(line); - const parsed = this.generator.parseResult(result); - results.push(parsed); + const errorResponse = await this.client.files.content(batchJob.error_file_id); + const errorContent = await errorResponse.text(); + + // Save error file locally for debugging + const errorFilePath = path.join(this.outputDir, `batch_${batchJob.id}_error.jsonl`); + fs.writeFileSync(errorFilePath, errorContent); + logger.warn(`Error file saved to: ${errorFilePath}`); + + // Parse errors and create default metadata for failed templates + const errorLines = errorContent.trim().split('\n'); + logger.warn(`Found ${errorLines.length} failed requests in error file`); + + for (const line of errorLines) { + if (!line) continue; + try { + const errorResult = JSON.parse(line); + const templateId = parseInt(errorResult.custom_id?.replace('template-', '') || '0'); + + if (templateId > 0) { + const errorMessage = errorResult.response?.body?.error?.message || + errorResult.error?.message || + 'Unknown error'; + + logger.debug(`Template ${templateId} failed: ${errorMessage}`); + + // Use getDefaultMetadata() from generator (it's private but accessible via bracket notation) + const defaultMeta = (this.generator as any).getDefaultMetadata(); + results.push({ + templateId, + metadata: defaultMeta, + error: errorMessage + }); + } + } catch (parseError) { + logger.error('Error parsing error line:', parseError); + } + } } catch (error) { - logger.error('Error parsing result line:', error); + logger.error('Failed to process error file:', error); } } - - logger.info(`Retrieved ${results.length} results from batch job`); + + // If we have no results at all, something is very wrong + if (results.length === 0 && !batchJob.output_file_id && !batchJob.error_file_id) { + throw new Error('No output file or error file available for batch job'); + } + + logger.info(`Total results (successful + failed): ${results.length}`); return results; } diff --git a/src/templates/metadata-generator.ts b/src/templates/metadata-generator.ts index d4102db..2f933bd 100644 --- a/src/templates/metadata-generator.ts +++ b/src/templates/metadata-generator.ts @@ -34,7 +34,7 @@ export class MetadataGenerator { private client: OpenAI; private model: string; - constructor(apiKey: string, model: string = 'gpt-4o-mini') { + constructor(apiKey: string, model: string = 'gpt-5-mini-2025-08-07') { this.client = new OpenAI({ apiKey }); this.model = model; } @@ -131,8 +131,8 @@ export class MetadataGenerator { url: '/v1/chat/completions', body: { model: this.model, - temperature: 0.3, // Lower temperature for more consistent structured outputs - max_completion_tokens: 1000, + // temperature removed - batch API only supports default (1.0) for this model + max_completion_tokens: 3000, response_format: { type: 'json_schema', json_schema: this.getJsonSchema() @@ -288,8 +288,8 @@ export class MetadataGenerator { try { const completion = await this.client.chat.completions.create({ model: this.model, - temperature: 0.3, // Lower temperature for more consistent structured outputs - max_completion_tokens: 1000, + // temperature removed - not supported in batch API for this model + max_completion_tokens: 3000, response_format: { type: 'json_schema', json_schema: this.getJsonSchema() diff --git a/tests/unit/templates/batch-processor.test.ts b/tests/unit/templates/batch-processor.test.ts index f516b71..7887a11 100644 --- a/tests/unit/templates/batch-processor.test.ts +++ b/tests/unit/templates/batch-processor.test.ts @@ -71,7 +71,7 @@ describe('BatchProcessor', () => { options = { apiKey: 'test-api-key', - model: 'gpt-4o-mini', + model: 'gpt-5-mini-2025-08-07', batchSize: 3, outputDir: './test-temp' }; diff --git a/tests/unit/templates/metadata-generator.test.ts b/tests/unit/templates/metadata-generator.test.ts index 2614865..27c9b0d 100644 --- a/tests/unit/templates/metadata-generator.test.ts +++ b/tests/unit/templates/metadata-generator.test.ts @@ -18,7 +18,7 @@ describe('MetadataGenerator', () => { let generator: MetadataGenerator; beforeEach(() => { - generator = new MetadataGenerator('test-api-key', 'gpt-4o-mini'); + generator = new MetadataGenerator('test-api-key', 'gpt-5-mini-2025-08-07'); }); describe('createBatchRequest', () => { @@ -35,7 +35,7 @@ describe('MetadataGenerator', () => { expect(request.custom_id).toBe('template-123'); expect(request.method).toBe('POST'); expect(request.url).toBe('/v1/chat/completions'); - expect(request.body.model).toBe('gpt-4o-mini'); + expect(request.body.model).toBe('gpt-5-mini-2025-08-07'); expect(request.body.response_format.type).toBe('json_schema'); expect(request.body.response_format.json_schema.strict).toBe(true); expect(request.body.messages).toHaveLength(2); @@ -217,7 +217,7 @@ describe('MetadataGenerator', () => { // but should not cause any injection in our code expect(userMessage).toContain(''); expect(userMessage).toContain('javascript:alert(1)'); - expect(request.body.model).toBe('gpt-4o-mini'); + expect(request.body.model).toBe('gpt-5-mini-2025-08-07'); }); it('should handle extremely long template names', () => {