Skip to content

croissanteth/chatgpt-token

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
November 16, 2023 19:18
September 18, 2023 22:31
November 16, 2023 19:23
September 18, 2023 22:31
September 21, 2023 18:51
September 18, 2023 22:31
September 18, 2023 22:31
September 18, 2023 22:31
September 18, 2023 22:31

Prerequisites

-Node.js

-Hardhat development environment

-OpenAI API key

Setup

Clone the repository.

run npm install

Create empty "contracts" folder, and .env file containing OPENAI_API_KEY, GOERLI_PRIVATE_KEY, and GOERLI_URL (RPC) values

Modifying GPT Interactions

To modify the interactions with GPT, refer to the deploygpt4.ts script inside the scripts directory:

API Key: Ensure your OpenAI API key is set in the .env file. The key is retrieved in the script at Line 11. API Calls: The OpenAI API is called at Line 17 and Line 96. Modify the request body or headers as required to customize the GPT response. DALL·E Interactions: If you wish to modify interactions with OpenAI's DALL·E model, refer to Line 277.

Running locally

npx hardhat run scripts/deploygpt4.ts

Deploy to blockchain

npx hardhat run scripts/deploygpt4.ts --network GOERLI

Releases

No releases published

Packages

No packages published