feat(eve): support file parts in tool model output#685
Open
BlackishGreen33 wants to merge 4 commits into
Open
Conversation
Signed-off-by: 墨綠BG <s5460703@gmail.com>
Signed-off-by: 墨綠BG <s5460703@gmail.com>
Signed-off-by: 墨綠BG <s5460703@gmail.com>
Contributor
|
@BlackishGreen33 is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
Signed-off-by: 墨綠BG <s5460703@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #456.
Description
Authored tools could return text or JSON to the model, but they could not return files or images. This meant a tool could create an image, while the model still had no way to inspect it.
This PR adds a
contentoutput type with text and file parts. File parts use{ type: "data", data: string }; the string must contain base64-encoded data. Eve validates the fields and base64 syntax, then copies each part into a new, clean object before passing it to the AI SDK. URLs, data URLs, provider references, raw bytes, and sandbox references remain out of scope.The original
executereturn value is still used foraction.result, channels, and hooks. Only the value sent back to the model is normalized.The tools documentation now includes an image example and explains the supported file source. The existing
agent-toolsmodel-output eval now returns a small PNG and checks that the model can identify it whileaction.resultkeeps the original tool result.Fork pull requests cannot access the repository secrets required by the model-backed E2E, Vercel E2E, and TUI jobs. Those jobs now use the repository's existing fork guard pattern and report as skipped for fork pull requests. Same-repository pull requests, main pushes, and manual workflow runs still run the full checks.
How did you test your changes?
Passed with Node.js v24.15.0:
pnpm --filter eve exec vitest run --config vitest.unit.config.ts src/harness/tools.test.ts(49 passed)pnpm typecheckpnpm lintpnpm exec oxfmt --checkon the changed filespnpm check:depspnpm guard:invariantspnpm docs:checkpnpm test:unitpnpm test:integrationpnpm buildpnpm test:scenariogit diff --checkI also attempted
pnpm exec eve eval --strict dynamic-tools/model-output. It stopped before the model or tool call because this environment does not haveAI_GATEWAY_API_KEYorVERCEL_OIDC_TOKEN. The PR is draft until that eval can run with provider credentials.A patch changeset is included for the published
evepackage.PR Checklist
CONTRIBUTING.mdevepackagegit commit --signoff)