zhlajiex commited on
Commit
0b27045
·
1 Parent(s): 0e9c354

Fix: codex-v3-2 provider and add cross-model awareness

Browse files
Files changed (1) hide show
  1. backend/controllers/ai.js +11 -3
backend/controllers/ai.js CHANGED
@@ -15,12 +15,12 @@ const MODELS = {
15
  'codex-extras-ultra': 'qwen-3-235b-a22b-instruct-2507',
16
  'codex-extras-agile': 'qwen-3-32b',
17
  'codex-extras-lite': 'llama-3.1-8b',
18
- 'codex-v3-2': 'deepseek/deepseek-v3.2'
19
  };
20
 
21
  const PROVIDERS = {
22
  'codex-v3-2': {
23
- url: process.env.FLOWEY_URL || 'https://api.flowey.dev/v1/chat/completions',
24
  key: process.env.FLOWEY_KEY
25
  }
26
  };
@@ -35,6 +35,7 @@ OPERATIONAL_RULES:
35
  4. REASONING: Enforce ultra-strong reasoning, safety, and clarity. Always prioritize efficient, production-ready code.
36
  5. TONE: Maintain a professional, elite, and futuristic technical tone.
37
  6. IDENTITY_RESPONSE: If asked "who are you" or "who they are", you MUST respond exactly with: "Im Codex, A High Speed AI Agent And Model utilizing the model {ACTIVE_MODEL}".
 
38
 
39
  ARCHITECT_IDENTIFICATION:
40
  The user johanvoncd7@gmail.com is the OWNER/ARCHITECT with elevated clearance.`;
@@ -81,8 +82,15 @@ exports.chat = asyncHandler(async (req, res, next) => {
81
  // 3. Build History
82
  const history = await Message.find({ sessionId: session._id }).sort({ createdAt: 1 }).limit(10);
83
  const activeModel = model || 'codex-thinking';
 
 
84
  const apiMessages = [
85
- { role: 'system', content: SYSTEM_PROMPT.replace('{ACTIVE_MODEL}', activeModel) },
 
 
 
 
 
86
  { role: 'system', content: `[STATUS] ACTIVE_ENGINE: ${activeModel}` }
87
  ];
88
 
 
15
  'codex-extras-ultra': 'qwen-3-235b-a22b-instruct-2507',
16
  'codex-extras-agile': 'qwen-3-32b',
17
  'codex-extras-lite': 'llama-3.1-8b',
18
+ 'codex-v3-2': 'deepseek-chat'
19
  };
20
 
21
  const PROVIDERS = {
22
  'codex-v3-2': {
23
+ url: process.env.FLOWEY_URL || 'https://api.deepseek.com/v1/chat/completions',
24
  key: process.env.FLOWEY_KEY
25
  }
26
  };
 
35
  4. REASONING: Enforce ultra-strong reasoning, safety, and clarity. Always prioritize efficient, production-ready code.
36
  5. TONE: Maintain a professional, elite, and futuristic technical tone.
37
  6. IDENTITY_RESPONSE: If asked "who are you" or "who they are", you MUST respond exactly with: "Im Codex, A High Speed AI Agent And Model utilizing the model {ACTIVE_MODEL}".
38
+ 7. MODEL_ACKNOWLEDGEMENT: If asked "What Are The AI models avaible here" or similar queries about available models, you MUST respond with: "The AI model avaible is {AVAILABLE_MODELS}". You are part of the CODEX collective.
39
 
40
  ARCHITECT_IDENTIFICATION:
41
  The user johanvoncd7@gmail.com is the OWNER/ARCHITECT with elevated clearance.`;
 
82
  // 3. Build History
83
  const history = await Message.find({ sessionId: session._id }).sort({ createdAt: 1 }).limit(10);
84
  const activeModel = model || 'codex-thinking';
85
+ const availableModelsList = Object.keys(MODELS).join(', ');
86
+
87
  const apiMessages = [
88
+ {
89
+ role: 'system',
90
+ content: SYSTEM_PROMPT
91
+ .replace('{ACTIVE_MODEL}', activeModel)
92
+ .replace('{AVAILABLE_MODELS}', availableModelsList)
93
+ },
94
  { role: 'system', content: `[STATUS] ACTIVE_ENGINE: ${activeModel}` }
95
  ];
96