| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 |
Tags
- boot
- IOS
- data binding
- Framework
- Chat GPT
- mac
- Compose
- Andorid
- VM arguments
- Jetpack
- retrofit
- AOS
- DispatchQueue
- ndkVersion
- 3rd part
- Swift
- xcframework
- defaultconfig
- arm-linux-androideabi
- 3rd framework
- Kotlin
- buildconfigfield
- EditText
- Eclipse
- Android
- gradle
- Java
- NDK
- Registering an InstanceCreator with Gson for this type may fix this problem
- BindingAdapter
Archives
- Today
- Total
grape
[android] simple GPT retrofit 2 - data 본문
Request Body
import com.google.gson.annotations.SerializedName;
public class GptCall {
@SerializedName("model")
public String model;
@SerializedName("messages")
public messages messages;
@SerializedName("max_tokens")
public String max_tokens;
public class messages {
public String role;
public String content;
}
}
Request Body Json String Example
//String json = "{\"model\": \"gpt-3.5-turbo\", \"messages\": [{\"role\": \"user\", \"content\": \"What is the OpenAI mission?\"}]}";
Resbody
public class gptResponse {
public String id;
public String object;
public int created;
public String model;
public choices choices[];
public class choices{
public message message;
public String finish_reason;
public int index;
}
public class message{
public String role;
public String content;
}
}
Response Json String Example
// {
// "id": "chatcmpl-(...)",
// "object": "chat.completion",
// "created": 1678346481,
// "model": "gpt-3.5-turbo-0301",
// "usage": {
// "prompt_tokens": 11,
// "completion_tokens": 313,
// "total_tokens": 324
// },
// "choices": [
// {
// "message": {
// "role": "assistant",
// "content": "한글날은 한글의 문화적·역사적·언어학적 가치를 널리 알리고 (...)"
// },
// "finish_reason": "stop",
// "index": 0
// }
// ]
// }'dev > aos' 카테고리의 다른 글
| [android] android studio build setting issue - Unsupported Java. Your build is currently configured to use Java 17.0.6 and Gradle (0) | 2023.10.14 |
|---|---|
| [android] simple GPT retrofit 3 - call (2) | 2023.10.14 |
| [android] simple GPT retrofit 1 - setting (0) | 2023.10.13 |
| [android]data binding 5 - mistake error (0) | 2023.10.12 |
| [android]data binding 4 - app custom attribute (0) | 2023.10.12 |