[Feature]: Implement Provider Strategy Pattern for Multi-Model LLM Support
- 主要言語
- Python
- スター
- 0
- フォーク
- 0
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
### Is your feature request related to a problem? Please describe.
Provider strategy pattern created for different LLM model families (GPT-5, GPT-4o, LM Studio, Ollama) with automatic routing based on model prefixes.
Scenario generation failing due to JSON parsing errors when using GPT-5 models. Character background isn't created correctly on gpt-5 models.
The scenario generation system fails when using GPT-5 models (gpt-5-nano, gpt-5-mini) due to malformed JSON responses that cannot be parsed by the fallback JSON extraction logic.
Error Details:
fallback
Root Cause: GPT-5 models generate JSON responses with formatting issues (unterminated strings, extra commas, malformed structures) that the current simple extraction logic cannot handle.
### Describe the solution you'd like
1. Provider Capabilities Matrix (backend/providers/capabilities.py)
Model family detection and capability mapping
API family routing (responses vs chat_completions vs openai_compatible)
2. Strategy Pattern Implementation
OpenAIGPT5Strategy: GPT-5 Responses API integration
OpenAIGPT4oStrategy: GPT-4o Chat Completions via LangChain
OpenAICompatibleStrategy: LM Studio/Ollama support
3. Provider Routing (backend/providers/openai.py)
Automatic strategy selection based on model name prefix
Unified ProviderResponse interface
Testing - Test suite needs to be updated for new architecture
### Describe alternatives you've considered
_No response_
### Additional context
_No response_
### Would you like to contribute this feature?
- [ ] Yes, I would like to implement this feature
コントリビューションガイド
調査の方向性
The issue describes a strategy pattern for LLM providers. Start by examining backend/providers/capabilities.py and backend/providers/openai.py to understand the current structure. The goal is to create new strategy classes (OpenAIGPT5Strategy, OpenAIGPT4oStrategy, OpenAICompatibleStrategy) that handle different API families and JSON response formats. Testing will need updates to cover the new architecture.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- ollama
- 領域
- ai, backend
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 25/100