Skip to content

Commit 3236e2d

Browse files
committed
fix: README
1 parent 60aca56 commit 3236e2d

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

solana-openai/nodejs/README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,24 @@ This code example demonstrates how an OpenAI API key can be used to generate a r
77
- **An Ethereum private key**
88
- This private key will be used to:
99
- Own the PKP we mint. The minted PKP will be used to create new Wrapped Keys.
10-
- In order to pay for this, the corresponding Ethereum account must have Lit Test Tokens. If you do not have any, you can get some from [the faucet](https://chronicle-yellowstone-faucet.getlit.dev/)
10+
- In order to pay for this, the corresponding Ethereum account must have Lit Test Tokens. If you do not have any, you can get some from [the faucet](https://chronicle-yellowstone-faucet.getlit.dev/).
1111
- **An OpenAI API key**
1212
- We will use this to make a request to OpenAI with our query to generate a response.
13-
- This example currently uses the GPT-4o-mini model, please enable this model on your API key or change it in the code if needed
13+
- This example currently uses the GPT-4o-mini model, please enable this model on your API key or change it in the code if needed.
1414
- **Node.js and Yarn**
15-
- Please have these installed before running the example
15+
- Please have these installed before running the example.
1616

1717
## Installation and Setup
1818

1919
1. Clone the repository
2020
2. `cd` into the code example directory: `cd solana-openai/nodejs`
2121
3. Install the dependencies: `yarn`
2222
4. Create and fill in the `.env` file: `cp .env.example .env`
23-
- `ETHEREUM_PRIVATE_KEY`: **Required** This is the Ethereum private key that will be used to mint a PKP if one is not provided
24-
- `OPENAI_API_KEY`: **Required** This is the OpenAI API key that will be used to make a request within our Lit Action
25-
- `LIT_PKP_PUBLIC_KEY`: **Optional** You can also provide your own PKP for this example, but please make sure the PKP is owned by the provided Ethereum wallet
23+
- **Required**:
24+
- `ETHEREUM_PRIVATE_KEY`: This is the Ethereum private key that will be used to mint a PKP if one is not provided
25+
- `OPENAI_API_KEY`: This is the OpenAI API key that will be used to make a request within our Lit Action
26+
- **Optional**:
27+
- `LIT_PKP_PUBLIC_KEY`: You can also provide your own PKP for this example, but please make sure the PKP is owned by the provided Ethereum wallet
2628
5. Test the example: `yarn test`
2729

2830
## Executing the Example
@@ -34,12 +36,12 @@ Here's an overview of how the code example works:
3436
1. Using an imported Ethereum private key, connect the wallet to the Lit RPC endpoint `Chronicle Yellowstone`
3537
2. Connect to the Lit network using the `LitNodeClient` on the `datil-dev` network
3638
3. Connect the `LitContracts` client to the Lit network (`datil-dev` in this case)
37-
4. **If PKP idnot provided in the .env file**: Mint a new PKP.
39+
4. **If a PKP is not provided in the .env file**: Mint a new PKP.
3840
5. Use your Ethereum wallet to create an AuthMethod.
3941
6. Use the created AuthMethod for authentication in generating session signatures for our PKP.
4042
7. Generate a new Solana Wrapped Key.
41-
8. Retrieve the encrypted metadata of our Wrapped Key.
42-
9. Set up Access Control Conditions (ACCs) to encrypt our OpenAI API key. This ensures it is not revealed at any point. The ACCs are the same ones used to encrypt the Wrapped Key metadata.
43+
8. Retrieve the encrypted private key of our Wrapped Key.
44+
9. Set up Access Control Conditions (ACCs) to encrypt our OpenAI API key. This ensures it is not revealed at any point. The ACCs are the same ones that were used to encrypt the Wrapped Key.
4345
10. Write a simple prompt for the AI to answer.
4446
11. Run the Lit Action, providing our encrypted Solana Wrapped Key and OpenAI API key metadata, as well as our prompt.
4547

0 commit comments

Comments
 (0)