Skip to content
Merged
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
6 changes: 4 additions & 2 deletions src/vision/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export type VOCRParams = {
page_range?: Array<number>;
/** High fidelity word-level bounding boxes within complex documents. Default: false. */
fine_grained?: boolean;
/** Include line and word level bounding box coordinates. When false, the coordinates are omitted but the text and confidence are still returned. Default: true. */
return_bounds?: boolean;
};

export interface VOCRResponse extends BaseResponse {
Expand All @@ -19,11 +21,11 @@ export interface VOCRResponse extends BaseResponse {
text: string;
lines: Array<{
text: string;
bounds: BoundingBox;
bounds?: BoundingBox; // omitted when return_bounds is false
average_confidence: number;
words: Array<{
text: string;
bounds: BoundingBox;
bounds?: BoundingBox; // omitted when return_bounds is false
confidence: number;
}>;
}>;
Expand Down
26 changes: 0 additions & 26 deletions tests/vision.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -724,32 +724,6 @@ describe("Object Detection API", () => {
});
});

// Complex scenario tests
test("should work with comprehensive configuration", async () => {
const result = await client.vision.object_detection({
url: TEST_URLS.image,
prompts: ["detect all objects", "find text elements"],
features: ["object", "gui"],
annotated_image: true,
return_type: "url",
});

expectSuccess(result);
expectType(result, "object");

if (result.objects !== undefined) {
expectArray(result.objects);
}

if (result.gui_elements !== undefined) {
expectArray(result.gui_elements);
}

if (result.annotated_image !== undefined) {
expectType(result.annotated_image, "string");
}
});

test("should work with file upload", async () => {
const imageResponse = await fetch(TEST_URLS.image);
const imageBlob = await imageResponse.blob();
Expand Down
Loading