@peopl-health/nexus 3.2.6 → 3.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -37,7 +37,9 @@ class OpenAIResponsesProvider {
|
|
|
37
37
|
responseModel: 'gpt-5',
|
|
38
38
|
chatModel: 'gpt-4o-mini',
|
|
39
39
|
transcriptionModel: 'whisper-1',
|
|
40
|
-
reasoningEffort: '
|
|
40
|
+
reasoningEffort: 'low',
|
|
41
|
+
temperature: 0.7,
|
|
42
|
+
maxOutputTokens: 600,
|
|
41
43
|
...defaultModels,
|
|
42
44
|
};
|
|
43
45
|
|
|
@@ -299,10 +301,12 @@ class OpenAIResponsesProvider {
|
|
|
299
301
|
prompt: promptConfig,
|
|
300
302
|
input: inputData,
|
|
301
303
|
instructions: instructions || additionalInstructions,
|
|
302
|
-
|
|
304
|
+
max_output_tokens: maxOutputTokens ?? this.defaults.maxOutputTokens,
|
|
305
|
+
...(topP !== undefined && { top_p: topP }),
|
|
303
306
|
}), { providerName: PROVIDER_NAME });
|
|
304
307
|
|
|
305
308
|
const { result: response, retries } = await makeAPICall(input);
|
|
309
|
+
logger.info('[OpenAIResponsesProvider] Run response', { response });
|
|
306
310
|
totalRetries += retries;
|
|
307
311
|
let finalResponse = response;
|
|
308
312
|
|
|
@@ -13,7 +13,7 @@ function formatForWhatsApp(text) {
|
|
|
13
13
|
let formatted = text;
|
|
14
14
|
|
|
15
15
|
// Add line breaks after dash items (bullet points)
|
|
16
|
-
formatted = formatted.replace(/(\.\s*-\s+)/g, '.\n
|
|
16
|
+
formatted = formatted.replace(/(\.\s*-\s+)/g, '.\n- ');
|
|
17
17
|
formatted = formatted.replace(/(:)\s*(-\s+)/g, '$1\n- ');
|
|
18
18
|
|
|
19
19
|
// Add line breaks after semicolons when they separate items
|
|
@@ -22,12 +22,8 @@ function formatForWhatsApp(text) {
|
|
|
22
22
|
// Add line breaks after periods that end sentences before dashes
|
|
23
23
|
formatted = formatted.replace(/(\.\s+)(-\s+)/g, '$1\n$2');
|
|
24
24
|
|
|
25
|
-
// Convert dashes to bullet points
|
|
26
|
-
formatted = formatted.replace(/^-\s+/gm, '• ');
|
|
27
|
-
formatted = formatted.replace(/(\n|^)\s*-\s+/g, '$1• ');
|
|
28
|
-
|
|
29
25
|
// Clean up multiple consecutive line breaks
|
|
30
|
-
formatted = formatted.replace(/\n{
|
|
26
|
+
formatted = formatted.replace(/\n{2,}/g, '\n');
|
|
31
27
|
|
|
32
28
|
return formatted.trim();
|
|
33
29
|
}
|