File tree Expand file tree Collapse file tree 3 files changed +20
-11
lines changed
Expand file tree Collapse file tree 3 files changed +20
-11
lines changed Original file line number Diff line number Diff line change @@ -6,11 +6,11 @@ const client = new Kernel({
66 apiKey: ' My API Key' ,
77});
88
9- const response = await client .extensions .download (' id_or_name' );
9+ const extension = await client .extensions .retrieve (' id_or_name' );
1010
11- console .log (response );
11+ console .log (extension );
1212
13- const content = await response .blob ();
13+ const content = await extension .blob ();
1414console .log (content );
1515```
1616
@@ -21,11 +21,11 @@ from kernel import Kernel
2121client = Kernel(
2222 api_key = " My API Key" ,
2323)
24- response = client.extensions.download (
24+ extension = client.extensions.retrieve (
2525 " id_or_name" ,
2626)
27- print (response )
28- content = response .read()
27+ print (extension )
28+ content = extension .read()
2929print (content)
3030```
3131</CodeGroup >
Original file line number Diff line number Diff line change @@ -8,7 +8,10 @@ const client = new Kernel({
88
99const deployment = await client .deployments .create ({
1010 entrypoint_rel_path: ' src/app.py' ,
11+ env_vars: { FOO: ' bar' },
1112 file: fs .createReadStream (' path/to/file' ),
13+ region: ' aws.us-east-1a' ,
14+ version: ' 1.0.0' ,
1215});
1316
1417console .log (deployment .id );
@@ -23,7 +26,13 @@ client = Kernel(
2326)
2427deployment = client.deployments.create(
2528 entrypoint_rel_path = " src/app.py" ,
26- file = b " raw file contents" ,
29+ env_vars = {
30+ " FOO" : " bar"
31+ },
32+ file = b " <binary>" ,
33+ force = False ,
34+ region = " aws.us-east-1a" ,
35+ version = " 1.0.0" ,
2736)
2837print (deployment.id)
2938```
Original file line number Diff line number Diff line change @@ -6,9 +6,9 @@ const client = new Kernel({
66 apiKey: ' My API Key' ,
77});
88
9- const response = await client .extensions .upload ({ file: fs .createReadStream (' path/to/file' ) });
9+ const extension = await client .extensions .create ({ file: fs .createReadStream (' path/to/file' ) });
1010
11- console .log (response .id );
11+ console .log (extension .id );
1212```
1313
1414
@@ -18,9 +18,9 @@ from kernel import Kernel
1818client = Kernel(
1919 api_key = " My API Key" ,
2020)
21- response = client.extensions.upload (
21+ extension = client.extensions.create (
2222 file = b " raw file contents" ,
2323)
24- print (response .id)
24+ print (extension .id)
2525```
2626</CodeGroup >
You can’t perform that action at this time.
0 commit comments