Skip to content

This repository demonstrates how to interact with OpenAI's API using a Java test class, OpenAIRequesterTest

Notifications You must be signed in to change notification settings

pablogzalez/OpenAI-API-Java-Request

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

OpenAI-API-Java-Request

This repository demonstrates how to interact with OpenAI's API using a Java test class, OpenAIRequesterTest.


🌟 Features

  • 🚀 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.

🔧 Setup

Prerequisites

  • ☕ Java JDK 8 or newer.
  • 🔑 A valid OpenAI API key.

Installation

  1. 📥 Clone this repository:

git clone https://github.com/pablogzalez/OpenAI-API-Java-Request.git

  1. 📂 Navigate to the project directory:

cd OpenAI-API-Java-Request

  1. 🔓 Open the OpenAIRequesterTest class and insert your OpenAI API key where indicated.

git clone https://github.com/pablogzalez/OpenAI-API-Java-Request.git

  1. 🖥️ 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