fix: agent loop for disable response storage (#543)
- Fixes post-merge of #506 --------- Co-authored-by: Ilan Bigio <ilan@openai.com>
This commit is contained in:
@@ -81,7 +81,13 @@ export function parseToolCallArguments(
|
||||
}
|
||||
|
||||
const { cmd, command } = json as Record<string, unknown>;
|
||||
const commandArray = toStringArray(cmd) ?? toStringArray(command);
|
||||
// The OpenAI model sometimes produces a single string instead of an array.
|
||||
// Accept both shapes:
|
||||
const commandArray =
|
||||
toStringArray(cmd) ??
|
||||
toStringArray(command) ??
|
||||
(typeof cmd === "string" ? [cmd] : undefined) ??
|
||||
(typeof command === "string" ? [command] : undefined);
|
||||
if (commandArray == null) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user