fix: ChatBubble crash and DeepSeek API compatibility

- Fix ChatBubble to handle non-string content with String() wrapper
- Fix API route to use generateText for non-streaming requests
- Add @ai-sdk/openai-compatible for non-OpenAI providers (DeepSeek, etc.)
- Use Chat Completions API instead of Responses API for compatible providers
- Update ChatBubble tests and fix component exports to kebab-case
- Remove stale PascalCase ChatBubble.tsx file
This commit is contained in:
Max
2026-01-26 16:55:05 +07:00
parent 6b113e0392
commit e9e6fadb1d
544 changed files with 113077 additions and 427 deletions

View File

@@ -0,0 +1,50 @@
# Intent vs Prescriptive Spectrum
**Principle:** Workflows lean toward **intent** (goals) not **prescription** (exact wording). The more intent-based, the more adaptive and creative the LLM can be.
---
## When to Use Each
### Intent-Based (Default)
**Use for:** Most workflows - creative, exploratory, collaborative
**Step instruction:** "Help the user understand X using multi-turn conversation. Probe to get good answers. Ask 1-2 questions at a time, not a laundry list."
**LLM figures out:** Exact wording, question order, how to respond
### Prescriptive (Exception)
**Use for:** Compliance, safety, legal, medical, regulated industries
**Step instruction:** "Say exactly: 'Do you currently experience fever, cough, or fatigue?' Wait for response. Then ask exactly: 'When did symptoms begin?'"
**LLM follows:** Exact script, specific order, no deviation
---
## Examples
### Intent-Based (Good for most)
```
"Guide the user through discovering their ideal nutrition plan.
Use multi-turn conversation. Ask 1-2 questions at a time.
Think about their responses before asking follow-ups.
Probe to understand preferences, restrictions, goals."
```
### Prescriptive (Only when required)
```
"Medical intake - ask exactly:
1. 'Do you have any of these symptoms: fever, cough, fatigue?'
2. 'When did symptoms begin?'
3. 'Have you traveled recently in the last 14 days?'
Follow sequence precisely. Do not deviate."
```
---
## Step Writing Tips
- **Default to intent** - give goals, not scripts
- **Use "think"** - "Think about their response before..."
- **Multi-turn** - "Use conversation, not interrogation"
- **Progressive** - "Ask 1-2 questions at a time"
- **Probe** - "Ask follow-ups to understand deeper"
Only use prescriptive when compliance/regulation requires it.