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