]> git.basschouten.com Git - openhab-addons.git/blob
71c97b1fa72a657581777984110b96e05588cb18
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.chatgpt.internal.dto;
14
15 import java.util.List;
16
17 import com.google.gson.annotations.SerializedName;
18
19 /**
20  * This is a dto used for parsing the JSON response from ChatGPT.
21  *
22  * @author Kai Kreuzer - Initial contribution
23  *
24  */
25 public class ChatResponse {
26
27     private List<Choice> choices;
28     private String id;
29     private String object;
30     private int created;
31     private String model;
32
33     public List<Choice> getChoices() {
34         return choices;
35     }
36
37     public String getId() {
38         return id;
39     }
40
41     public int getCreated() {
42         return created;
43     }
44
45     public String getObject() {
46         return object;
47     }
48
49     public String getModel() {
50         return model;
51     }
52
53     public static class Choice {
54         private Message message;
55
56         @SerializedName("finish_reason")
57         private String finishReason;
58         private int index;
59
60         public Message getMessage() {
61             return message;
62         }
63
64         public String getFinishReason() {
65             return finishReason;
66         }
67
68         public int getIndex() {
69             return index;
70         }
71     }
72
73     public static class Message {
74         private String role;
75         private String content;
76
77         public String getRole() {
78             return role;
79         }
80
81         public String getContent() {
82             return content;
83         }
84     }
85 }