https://github.com/adjh54ir/multi-flex-chatgpt
Spring Boot 환경에서 ChatGPT API 통신 프로젝트
https://github.com/adjh54ir/multi-flex-chatgpt
chatgpt chatgpt3 java17 resttemplate
Last synced: 6 months ago
JSON representation
Spring Boot 환경에서 ChatGPT API 통신 프로젝트
- Host: GitHub
- URL: https://github.com/adjh54ir/multi-flex-chatgpt
- Owner: adjh54ir
- Created: 2023-12-28T04:59:43.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-21T05:46:03.000Z (almost 2 years ago)
- Last Synced: 2025-01-20T22:48:54.113Z (12 months ago)
- Topics: chatgpt, chatgpt3, java17, resttemplate
- Language: Java
- Homepage: https://adjh54.tistory.com
- Size: 74.2 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# multi-flex-chatgpt
⭕️ Spring Boot 기반의 ChatGPT Open API 활용 프로젝트
⭕️ 가이드 링크
* [Spring Boot 환경에서 ChatGPT API 활용하기 -1 : 정의, 환경구성, 간단한 활용방법](https://adjh54.tistory.com/372)
* [Spring Boot 환경에서 ChatGPT API 활용하기 -2 : 생태계, 레거시, 새로운 모델](https://adjh54.tistory.com/397)
## 1. 개발환경

| 환경 분류 | 버전 |
|-------------------------|---------|
| JDK | Java 17 |
| spring-boot | 3.2.1 |
| spring-boot-starter-web | 3.2.1 |
| Lombok | - |
## 2. 사용방법
1. src/main/resources/config 패키지가 없다면 구성하며, 해당위치에 application-xxx-local.yml 형태의 파일을 생성합니다.
2. 아래와 OpenAI에서 발급받은 키 값을 넣어줍니다.
```java
openai:
secret-key:xxxxx
```
3. application.properties 파일 내에 해당 yml 파일을 참조합니다.
```java
spring.profiles.active=multiflex-xxx
```
## 3. API Endpoint
| End point | HTTP METHOD | 설명 |
|----------------------------------------------------|:------------|--------------------------------------------------------------------------------------|
| http://localhost:8000//api/v1/chatGpt/modelList | GET | 사용 가능한 모델리스트를 조회합니다 |
| http://localhost:8000//api/v1/chatGpt/model | GET | 유효한 모델인지 확인합니다. |
| http://localhost:8000//api/v1/chatGpt/legacyPrompt | POST | 레거시 모델(gpt-3.5-turbo-instruct, babbage-002, davinci-002)을 사용하여 프롬프트를 입력하고 결과값을 받습니다. |
| http://localhost:8000//api/v1/chatGpt/prompt | POST | 새로운 모델(gpt-4, gpt-4 turbo, gpt-3.5-turbo)을 사용하여 프롬프트를 입력하여 결과값을 받습니다. |
⭕️ Request Format
### 1. 모델 리스트 조회

### 2. 유효한 모델 조회

### 3. 레거시 모델(gpt-3.5-turbo-instruct, babbage-002, davinci-002) 조회

### 4. 새로운 모델(gpt-4, gpt-4 turbo, gpt-3.5-turbo) 조회

## 4. Versions
### v0.0.2
* Legacy Model과 Newer Model API 분리 작업 완료
* Open AI Endpoint properties 파일로 분리 작업 완료
### v0.0.1
* 초기 개발환경 구축
* RestTemplate을 이용한 간단한 API 통신 방법 구성
* Legacy Model 통신만을 위한 Controller 및 로직 구성