-
Notifications
You must be signed in to change notification settings - Fork 3
Fix tests and response converter #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
||
if (Array.isArray(data._input)) { | ||
data._input.forEach((item, i) => { | ||
if (item.type === 'message') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I liked this as a case statement for extensibility.
debug('Skipping function call result'); | ||
break; | ||
default: | ||
debug('Unknown input item type:', item.type); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also retain the debug message for unhandled types so we know to instrument them in the future.
default: | ||
debug('Unknown message content type:', contentItem.type); | ||
break; | ||
if (item.type === 'message') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, I prefer the case statements.
extractAttributesFromMapping(item, RESPONSE_TOOL_CALL_ATTRIBUTES)); | ||
break; | ||
} | ||
case 'image_generation_call': // ResponseOutputItem.ImageGenerationCall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maintain these cases and the comments for future development.
Summary
Testing
npm test
https://chatgpt.com/codex/tasks/task_e_6852e5949fcc832fbe0bbbb0d339a09e