Update aiEngine.js
Browse files- 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 |
-
|
| 191 |
modelId: "arn:aws:bedrock:us-east-1:106774395747:inference-profile/global.anthropic.claude-sonnet-4-6",
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
messages: [
|
| 195 |
-
|
| 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 |
-
|
| 211 |
-
|
| 212 |
-
|
| 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: {
|