everydaytok commited on
Commit
611e63e
·
verified ·
1 Parent(s): 3656812

Update aiEngine.js

Browse files
Files changed (1) hide show
  1. aiEngine.js +8 -17
aiEngine.js CHANGED
@@ -187,30 +187,21 @@ export const AIEngine = {
187
  try {
188
  let ppp = `${prompts.analyst_system_prompt} Output ONLY JSON.`;
189
 
190
- const command = new ConverseCommand({
191
  modelId: "arn:aws:bedrock:us-east-1:106774395747:inference-profile/global.anthropic.claude-sonnet-4-6",
192
- system: [{ text: ppp }],
193
- // Only append input if it's not already the last message in history
194
- messages: [
195
- { role: "user", content: [{ text: `[MODE 1: QUESTIONS]\nIdea: "${desc}"` }] }
196
-
197
- ],
198
- inferenceConfig: {
199
- maxTokens: 20000, // Increased to allow room for Thinking + Output
200
- temperature: 1
201
- },
202
  additionalModelRequestFields: {
203
  thinking: { type: "adaptive" },
204
  output_config: { effort: "high" }
205
  }
206
  });
207
-
208
- const res = await bedrockClient.send(command);
209
 
210
- // 2. Claude 3.7/4.6 returns multiple content blocks (thinking + text)
211
- // We specifically look for the 'text' block.
212
- const text = res.output.message.content.find(b => b.text)?.text;
213
-
214
  return {
215
  text: text || "No response text found.",
216
  usage: {
 
187
  try {
188
  let ppp = `${prompts.analyst_system_prompt} Output ONLY JSON.`;
189
 
190
+ const command = new ConverseCommand({
191
  modelId: "arn:aws:bedrock:us-east-1:106774395747:inference-profile/global.anthropic.claude-sonnet-4-6",
192
+ // --- OFFICIAL BEDROCK SYSTEM PROMPT ---
193
+ system: [{ text: ppp }],
194
+ messages: [{ role: "user", content: [{ text: `[MODE 1: QUESTIONS]\nIdea: "${desc}"` }] }],
195
+ inferenceConfig: { maxTokens: 48000, temperature: 1 },
 
 
 
 
 
 
196
  additionalModelRequestFields: {
197
  thinking: { type: "adaptive" },
198
  output_config: { effort: "high" }
199
  }
200
  });
 
 
201
 
202
+ const response = await bedrockClient.send(command);
203
+ const text = response.output.message.content.find(b => b.text)?.text;
204
+
 
205
  return {
206
  text: text || "No response text found.",
207
  usage: {