You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// This example uses the [E2B SDK](https://github.com/e2b-dev/code-interpreter) as a code interpreter for [IBM Granite Code](https://www.ibm.com/granite/docs/models/code/) on [IBM WatsonX](https://www.ibm.com/watsonx).
3
+
// The code generated by the LLM runs in a [E2B secure cloud sandbox](https://e2b.dev/docs/sandbox/overview).
4
+
5
+
// 1. Imports and API keys
6
+
// You need to get your API keys and save them in .env file. You can copy and rename the .env.template file. We import all necessary libraries.
7
+
8
+
import{config}from"dotenv";
9
+
import{WatsonXAI}from"@ibm-cloud/watsonx-ai";
10
+
import{IamAuthenticator}from"ibm-cloud-sdk-core";
11
+
import{Sandbox}from"@e2b/code-interpreter";
12
+
importfsfrom"fs";
13
+
14
+
// Load environment variables from .env file
15
+
config({path: "./.env"});
16
+
17
+
// 2. Initialize WatsonX AI Client
18
+
// We initialize the WatsonX AI client using the credentials stored in the environment variables. This client will be used to interact with the IBM WatsonX Granite model.
0 commit comments