You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
preprompt: `Your task is to summarize concisely all your reasoning steps and then give the final answer. Keep it short, one short paragraph at most. If the reasoning steps explicitly include a code solution, make sure to include it in your answer.
73
+
try{
74
+
constsummary=yield*generateFromDefaultEndpoint({
75
+
messages: [
76
+
{
77
+
from: "user",
78
+
content: `Question: ${
79
+
messages[messages.length-1].content
80
+
}\n\nReasoning: ${reasoningBuffer}`,
81
+
},
82
+
],
83
+
preprompt: `Your task is to summarize concisely all your reasoning steps and then give the final answer. Keep it short, one short paragraph at most. If the reasoning steps explicitly include a code solution, make sure to include it in your answer.
82
84
83
85
If the user is just having a casual conversation that doesn't require explanations, answer directly without explaining your steps, otherwise make sure to summarize step by step, make sure to skip dead-ends in your reasoning and removing excess detail.
84
86
85
87
Do not use prefixes such as Response: or Answer: when answering to the user.`,
86
-
generateSettings: {
87
-
max_new_tokens: 1024,
88
-
},
89
-
});
90
-
finalAnswer=summary;
91
-
yield{
92
-
type: MessageUpdateType.Reasoning,
93
-
subtype: MessageReasoningUpdateType.Status,
94
-
status: `Done in ${Math.round((newDate().getTime()-startTime.getTime())/1000)}s.`,
95
-
};
88
+
generateSettings: {
89
+
max_new_tokens: 1024,
90
+
},
91
+
});
92
+
finalAnswer=summary;
93
+
yield{
94
+
type: MessageUpdateType.Reasoning,
95
+
subtype: MessageReasoningUpdateType.Status,
96
+
status: `Done in ${Math.round((newDate().getTime()-startTime.getTime())/1000)}s.`,
97
+
};
98
+
}catch(e){
99
+
finalAnswer=text;
100
+
logger.error(e);
101
+
}
96
102
}
97
103
98
104
yield{
@@ -143,9 +149,13 @@ Do not use prefixes such as Response: or Answer: when answering to the user.`,
0 commit comments