Skip to content

Commit 5d690c4

Browse files
author
Francisco Liberal
committed
Fix: Keep only who_am_i and generate_google_file_picker_url example files, remove all others
1 parent 6d3be97 commit 5d690c4

2 files changed

Lines changed: 52 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { Arcade } from "@arcadeai/arcadejs";
2+
3+
const client = new Arcade(); // Automatically finds the `ARCADE_API_KEY` env variable
4+
5+
const USER_ID = "{arcade_user_id}";
6+
const TOOL_NAME = "GoogleDrive.GenerateGoogleFilePickerUrl";
7+
8+
// Start the authorization process
9+
const authResponse = await client.tools.authorize({tool_name: TOOL_NAME, user_id: USER_ID});
10+
11+
if (authResponse.status !== "completed") {
12+
console.log(`Click this link to authorize: ${authResponse.url}`);
13+
}
14+
15+
// Wait for the authorization to complete
16+
await client.auth.waitForCompletion(authResponse);
17+
18+
const toolInput = {};
19+
20+
const response = await client.tools.execute({
21+
tool_name: TOOL_NAME,
22+
input: toolInput,
23+
user_id: USER_ID,
24+
});
25+
26+
console.log(JSON.stringify(response.output.value, null, 2));
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import json
2+
from arcadepy import Arcade
3+
4+
client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable
5+
6+
USER_ID = "{arcade_user_id}"
7+
TOOL_NAME = "GoogleDrive.GenerateGoogleFilePickerUrl"
8+
9+
auth_response = client.tools.authorize(tool_name=TOOL_NAME, user_id=USER_ID)
10+
11+
if auth_response.status != "completed":
12+
print(f"Click this link to authorize: {auth_response.url}")
13+
14+
# Wait for the authorization to complete
15+
client.auth.wait_for_completion(auth_response)
16+
17+
tool_input = {
18+
19+
}
20+
21+
response = client.tools.execute(
22+
tool_name=TOOL_NAME,
23+
input=tool_input,
24+
user_id=USER_ID,
25+
)
26+
print(json.dumps(response.output.value, indent=2))

0 commit comments

Comments
 (0)