smoltalk 0.0.27 → 0.0.28
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.
|
@@ -137,6 +137,13 @@ export class BaseClient {
|
|
|
137
137
|
async textWithRetry(promptConfig, retries) {
|
|
138
138
|
const result = await this._textSync(promptConfig);
|
|
139
139
|
if (result.success) {
|
|
140
|
+
if (!("output" in result.value)) {
|
|
141
|
+
const retryMessages = [
|
|
142
|
+
...promptConfig.messages,
|
|
143
|
+
userMessage(`You returned "undefined" instead of a valid response. Please provide a valid response.`),
|
|
144
|
+
];
|
|
145
|
+
return this.textWithRetry({ ...promptConfig, messages: retryMessages }, retries - 1);
|
|
146
|
+
}
|
|
140
147
|
const { output } = result.value;
|
|
141
148
|
if (output !== null &&
|
|
142
149
|
promptConfig.responseFormat &&
|