Repository navigation
Conversation
|
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: zhouyi7.
|
🦋 Changeset detectedLatest commit: 84f1220 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
`Result.formats()` reported every available representation except `text` and `chart`, so a result carrying either reported no formats at all — a text+chart result returned `[]`. Append `text` and `chart` in the same positions the Python SDK's `Result.formats()` uses, so JS now matches Python's ordering (text, the MIME types, data, chart, then extra keys). Co-Authored-By: Kscc <noreply@owtffssent.com>
02722b3 to
84f1220
Compare
|
We require contributors to sign our Contributor License Agreement, and we don't have @lemonzoey on file. You can sign our CLA at https://e2b.dev/docs/cla . Once you've signed, post a comment here that says '@cla-bot check' |
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
Summary
Result.formats()in the JS Code Interpreter SDK reported every available representation excepttextandchart, so a result carrying either reported no formats at all (a text+chart result returned[]). This diverged from the Python SDK, whoseResult.formats()lists both. Fixes #1981.The JS
formats()listedhtml,markdown,svg,png,jpeg,pdf,latex,json,javascript,data, and extra keys — but nottextorchart. This addstext(first) andchart(afterdata), matching the Python SDK's ordering:formats(): string[] { const formats = [] + if (this.text) { + formats.push('text') + } if (this.html) { formats.push('html') } ... if (this.data) { formats.push('data') } + if (this.chart) { + formats.push('chart') + }Usage example
Discovery via
formats()now works as expected:Testing
formats()had no JS test coverage. Addspackages/code-interpreter-js/tests/formats.test.tscovering: a text-only result, a chart result, a text+chart result (asserting the Python order), a result with every format (asserting the full Python ordering), and a bare result (empty). All no-credential unit tests pass;format/lint/typecheckclean (the one remainingmessaging.tslint warning is pre-existing and unrelated).Scope
JS-only — Python already does the right thing. This is separate from the ongoing
Resultserialization work and does not overlap:dataintoJSON()/ Pythonformats()empty-data.chartintoJSON().Result.It complements #1948: that makes
chartsurvivetoJSON()serialization; this makeschartdiscoverable viaformats().🤖 Generated with kscc