mirror of
https://github.com/openai/codex.git
synced 2026-05-03 10:56:37 +00:00
Merge origin/main
This commit is contained in:
@@ -22,13 +22,20 @@ function __codexCloneContentItem(item) {
|
||||
}
|
||||
}
|
||||
|
||||
function __codexNormalizeContentItems(value) {
|
||||
function __codexNormalizeRawContentItems(value) {
|
||||
if (Array.isArray(value)) {
|
||||
return value.flatMap((entry) => __codexNormalizeContentItems(entry));
|
||||
return value.flatMap((entry) => __codexNormalizeRawContentItems(entry));
|
||||
}
|
||||
return [__codexCloneContentItem(value)];
|
||||
}
|
||||
|
||||
function __codexNormalizeContentItems(value) {
|
||||
if (typeof value === 'string') {
|
||||
return [{ type: 'input_text', text: value }];
|
||||
}
|
||||
return __codexNormalizeRawContentItems(value);
|
||||
}
|
||||
|
||||
Object.defineProperty(globalThis, '__codexContentItems', {
|
||||
value: __codexContentItems,
|
||||
configurable: true,
|
||||
|
||||
Reference in New Issue
Block a user