Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class EmbeddingExecutor extends AbstractModelExecutor<
if (p.texts) {
const embeddings = [];
for (const text of p.texts) {
const embedding = await embed({ modelId: embeddingModelId, text });
const { embedding } = await embed({ modelId: embeddingModelId, text });
embeddings.push(embedding);
}
return ValidationHelpers.validate(
Expand All @@ -34,7 +34,7 @@ export class EmbeddingExecutor extends AbstractModelExecutor<
}

const text = p.text || "";
const embedding = await embed({ modelId: embeddingModelId, text });
const { embedding } = await embed({ modelId: embeddingModelId, text });
return ValidationHelpers.validate(embedding, expectation as Expectation);
} catch (error) {
const errorMsg = error instanceof Error ? error.message : String(error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export class ErrorExecutor extends AbstractModelExecutor<typeof errorTests> {
const p = params as { text: string };
const embeddingModelId = await this.resources.ensureLoaded("embeddings");
try {
const result = await embed({ modelId: embeddingModelId, text: p.text });
const { embedding: result } = await embed({ modelId: embeddingModelId, text: p.text });
return ValidationHelpers.validate(result, expectation as Expectation);
} catch (error) {
return { passed: true, output: `SDK correctly rejected empty input: ${error}` };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class HttpEmbeddingExecutor extends AbstractModelExecutor<typeof httpEmbe
modelType: p.modelType as "embeddings",
});
this.resources.register("embeddings", modelId);
const embeddings = await embed({ modelId, text: p.text });
const { embedding: embeddings } = await embed({ modelId, text: p.text });
return ValidationHelpers.validate(embeddings, expectation as Expectation);
} catch (error) {
const errorMsg = error instanceof Error ? error.message : String(error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class ShardedModelExecutor extends AbstractModelExecutor<typeof shardedMo
const modelId = await this.resources.ensureLoaded("sharded-embeddings");

try {
const embeddings = await embed({ modelId, text: p.text });
const { embedding: embeddings } = await embed({ modelId, text: p.text });
return ValidationHelpers.validate(embeddings, expectation as Expectation);
} catch (error) {
const errorMsg = error instanceof Error ? error.message : String(error);
Expand All @@ -64,7 +64,7 @@ export class ShardedModelExecutor extends AbstractModelExecutor<typeof shardedMo
try {
const embeddings = [];
for (const text of p.texts) {
const embedding = await embed({ modelId, text });
const { embedding } = await embed({ modelId, text });
embeddings.push(embedding);
}
return ValidationHelpers.validate(embeddings, expectation as Expectation);
Expand Down
Loading