fix[notask]: destructure embedding from new embed() return shape in sdk-tests#1598
Closed
donriddo wants to merge 1 commit into
Closed
fix[notask]: destructure embedding from new embed() return shape in sdk-tests#1598donriddo wants to merge 1 commit into
donriddo wants to merge 1 commit into
Conversation
@qvac/sdk 0.9+ changes embed() to return `{ embedding, stats? }` instead
of raw vectors. Update the 6 `await embed(...)` call sites in sdk-tests
executors that bind the result to a variable so they destructure
`embedding` from the object. The 2 discard sites (error-executor invalid
modelId test, logging-executor fire-and-forget log) keep their existing
await-without-assignment form.
Contributor
Author
Contributor
Tier-based Approval Status |
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.
🎯 What problem does this PR solve?
@qvac/sdk'sembed()to return{ embedding, stats? }instead of rawnumber[] | number[][].sdk-testspackage (underpackages/sdk/tests-qvac) still treats the return value as raw vectors, so every embedding test executor would fail at runtime once the SDK types propagate through the build.📝 How does it solve it?
Destructure
embeddingfrom the new return shape in every call site that binds the result to a variable:embedding-executor.ts— 2 sites (batch loop + single)sharded-model-executor.ts— 2 sites (batch + per-text)http-embedding-executor.ts— 1 siteerror-executor.ts— 1 site (renameresult→ destructureembedding: result)The 2 call sites that discard the return (
error-executor.tsinvalid-modelId test at line 44,logging-executor.tsfire-and-forget at line 56) are intentionally left asawait embed(...)— they don't bind the result and just exercise the error/logging path.🧪 How was it tested?
npm run typecheck— the embed-shape errors that existed pre-change are now resolved. Remaining typecheck errors (indelegated-inference-tests.tsanddownload-tests.tsabout"function"literal type) are pre-existing and unrelated to this change; they also fail onmainwithout this PR applied.🔌 API Changes
None — this is a pure consumer migration to match the SDK's already-shipped embed return shape.
📋 Depends on
embed()return shape in the SDK.