This Rust project showcases the utilization of OpenAI's API to construct an adventure game playable via text input in the console. The game master directs the player through a virtual map.
To utilize this project, you'll require an API key from either OpenAI or Anthropic.
-
Obtain an API Key: Acquire an API key from OpenAI or Anthropic.
-
Configuration: After obtaining your API key, create a configuration file at
~/.adventure.ini
with the following structure:OPENAI_API_KEY=<your-api-key>
or
ANTHROPIC_API_KEY=<your-api-key>
Replace
<your-api-key>
with your actual API key.
To start the game, follow these steps:
-
Clone the Repository: Clone this repository to your local machine.
-
Navigate to the Project Directory: Open your terminal and navigate to the project directory.
-
Run the Game: Execute the following command in your terminal:
cargo run
This command initiates the game, prompting you to enter text into the console. The game master will respond to your input with descriptions of the game world and instructions on what to do next.
This project is licensed under the MIT License.