Skip to content

Commit

Permalink
feat: added telemetry for vision methods (#217)
Browse files Browse the repository at this point in the history
* feat: added telemetry for vision methods

* chore: added changeset

* fix: updated llm package
  • Loading branch information
pushpam5 authored Oct 28, 2024
1 parent a8ec645 commit 3430e0e
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/brave-olives-boil.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"appwright": patch
---

feat: added telemetry for vision methods
20 changes: 15 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"license": "Apache-2.0",
"description": "E2E mobile app testing done right, with the Playwright test runner",
"dependencies": {
"@empiricalrun/llm": "^0.9.18",
"@empiricalrun/llm": "^0.9.19",
"@ffmpeg-installer/ffmpeg": "^1.1.0",
"@playwright/test": "^1.47.1",
"appium": "^2.6.0",
Expand Down
10 changes: 9 additions & 1 deletion src/device/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ export class Device {
beta = {
tap: async (
prompt: string,
options?: { useCache?: boolean },
options?: {
useCache?: boolean;
telemetry?: {
tags?: string[];
};
},
): Promise<{ x: number; y: number }> => {
return await this.vision().tap(prompt, options);
},
Expand All @@ -59,6 +64,9 @@ export class Device {
responseFormat?: T;
model?: LLMModel;
screenshot?: string;
telemetry?: {
tags?: string[];
};
},
): Promise<ExtractType<T>> => {
return await this.vision().query(prompt, options);
Expand Down
10 changes: 9 additions & 1 deletion src/vision/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ export interface AppwrightVision {
responseFormat?: T;
model?: LLMModel;
screenshot?: string;
telemetry?: {
tags?: string[];
};
},
): Promise<ExtractType<T>>;

Expand All @@ -46,7 +49,12 @@ export interface AppwrightVision {
*/
tap(
prompt: string,
options?: { useCache?: boolean },
options?: {
useCache?: boolean;
telemetry?: {
tags?: string[];
};
},
): Promise<{ x: number; y: number }>;
}

Expand Down

0 comments on commit 3430e0e

Please sign in to comment.