feat: enhanced AI code generator with multi-provider support#2146
Merged
GermanBluefox merged 2 commits intoioBroker:masterfrom Mar 22, 2026
Merged
feat: enhanced AI code generator with multi-provider support#2146GermanBluefox merged 2 commits intoioBroker:masterfrom
GermanBluefox merged 2 commits intoioBroker:masterfrom
Conversation
b02eb48 to
1544d02
Compare
…mized prompts
Multi-provider API support:
- Per-provider test buttons in config (OpenAI, Anthropic, Gemini, DeepSeek, Custom)
- Optional API key for custom base URL (Ollama, LM Studio)
- Provider icons in config and code generator
- Human-readable HTTP error messages with API response details
- Disable reasoning/thinking for local models (reasoning_effort: none)
Two-step plan-then-code generation:
- Step 1: Model analyzes task and creates implementation plan with device IDs
- Step 2: Model generates code based on plan + API examples
- Collapsible plan view in UI for debugging
- Status display ("Planning..." / "Generating code...")
- 600s timeout for local models
Optimized prompts for small local models (tested with qwen2.5-coder:14b):
- Concrete code examples showing correct on(), setState(), getState() syntax
- WRONG/CORRECT pairs for common mistakes (adapter.set, console.log, etc.)
- Compact function signature list covering all 80+ API functions
- FORBIDDEN list preventing wrong patterns
- Task placed after device list (recency bias)
- TODO_DEVICE_ID placeholder for missing devices
Build fixes:
- Node 25 compatibility: rmSync instead of rmdirSync({recursive:true})
- admin/img/ preserved during clean builds
- Flexible result area height (flex:1 instead of fixed calc)
New documentation files:
- docs-compact.md: full API in 12.5KB (used for code generation)
- docs-essential.md: core functions with examples in 2.6KB
- Original docs.md preserved for reference
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
reasoning_effort: 'none'for Ollama models, reducing response time significantlyrmSyncinstead of deprecatedrmdirSync),admin/img/preserved during clean buildsTest plan
Tested with:
🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com