mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-12 09:47:08 +02:00
fix(openrouter): respect the requesting user's saved model config
generatePostText ignored the userId it received and always read an arbitrary row via getAnyOpenrouterConfig() (LIMIT 1, no ORDER BY), so a model chosen and saved in Settings could be shadowed by another stale config row. Now it prefers the requesting user's own config, falling back to the most recently updated shared one. Also swap the retired anthropic/claude-3.5-sonnet default for a live OpenRouter slug.
This commit is contained in:
7 files changed
+11
-10
No files matched your search
@@ -88,7 +88,7 @@ CREATE TABLE IF NOT EXISTS openrouter_config (
|
||||
id VARCHAR PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
user_id VARCHAR NOT NULL UNIQUE REFERENCES users(id) ON DELETE CASCADE,
|
||||
api_key TEXT NOT NULL,
|
||||
model TEXT NOT NULL DEFAULT 'anthropic/claude-3.5-sonnet',
|
||||
model TEXT NOT NULL DEFAULT 'anthropic/claude-sonnet-4.5',
|
||||
system_prompt TEXT NOT NULL DEFAULT 'Tu es un expert en marketing des réseaux sociaux. Génère 3 variations de textes engageants pour des publications Facebook et Instagram à partir des informations produit fournies. Chaque variation doit être unique, captivante et optimisée pour l''engagement.',
|
||||
created_at TIMESTAMP DEFAULT NOW(),
|
||||
updated_at TIMESTAMP DEFAULT NOW()
|
||||
|
||||
Reference in new issue
Block a user