pablogzalez / OpenAI-API-Java-Request

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

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


Languages

Language:Java 100.0%