This repository demonstrates how to interact with OpenAI's API using a Java test class, OpenAIRequesterTest
.
- 🚀 Easy interaction with OpenAI's API to fetch model completions.
- 📝 Clear and concise code with descriptive comments.
- 🧪 A simple test to ensure proper communication and data retrieval from the API.
- ☕ Java JDK 8 or newer.
- 🔑 A valid OpenAI API key.
- 📥 Clone this repository:
git clone https://github.com/pablogzalez/OpenAI-API-Java-Request.git
- 📂 Navigate to the project directory:
cd OpenAI-API-Java-Request
- 🔓 Open the OpenAIRequesterTest class and insert your OpenAI API key where indicated.
git clone https://github.com/pablogzalez/OpenAI-API-Java-Request.git
- 🖥️ Compile and run the tests.
📖 Usage After setting up your API key, you can run the OpenAIRequesterTest to send a query to the OpenAI API and see the response.
🔍 Feel free to modify the query variable in the test to experiment with different inputs.
🤝 Contributing Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
🧐 Please make sure to update tests as appropriate.
Created with 💖 by Pablo Gonzalez