Skip to content

Commit

Permalink
- fix: perplexity tool (#59)
Browse files Browse the repository at this point in the history
* - fix: perplexity tool

* - ci: version bump

* - fix: removed headless flag

* - fix: disable perplexity test in CI
  • Loading branch information
agallardol authored Nov 12, 2024
1 parent 90233d4 commit 8154708
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
12 changes: 12 additions & 0 deletions apps/shinkai-tool-perplexity/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ export const run: Run<Configurations, Parameters, Result> = async (
console.log('Filling textarea with query:', params.query);
await page.fill('textarea', params.query);

try {
console.log('trying to click app popup');
await page.click('button:has(svg[data-icon="xmark"])', { timeout: 2000 });
} catch (_) {
console.log('unable to find the x button to close the popup');
/*
We do nothing, so we have two cases:
- the code continue and fails later because we are not able to click the "submit" button
- the code continue and it just works because the app was changed and the popup doesn't exists
*/
}

console.log('Clicking the button with the specified SVG...');
await page.click('button:has(svg[data-icon="arrow-right"])');

Expand Down
4 changes: 2 additions & 2 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
@@ -1,6 +1,6 @@
{
"name": "@shinkai_protocol/source",
"version": "0.8.0",
"version": "0.8.1",
"description": "This repository serves as the ecosystem to execute Shinkai tools, provided by the Shinkai team or third-party developers, in a secure environment. It provides a sandboxed space for executing these tools, ensuring that they run safely and efficiently, while also allowing for seamless integration with Rust code.",
"main": "index.js",
"author": "",
Expand Down

0 comments on commit 8154708

Please sign in to comment.