forked from VapiAI/server-sdk-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArtifact.java
More file actions
278 lines (230 loc) · 10 KB
/
Copy pathArtifact.java
File metadata and controls
278 lines (230 loc) · 10 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
/**
* This file was auto-generated by Fern from our API Definition.
*/
package com.vapi.api.types;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.vapi.api.core.ObjectMappers;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
@JsonInclude(JsonInclude.Include.NON_ABSENT)
@JsonDeserialize(builder = Artifact.Builder.class)
public final class Artifact {
private final Optional<List<ArtifactMessagesItem>> messages;
private final Optional<List<OpenAiMessage>> messagesOpenAiFormatted;
private final Optional<String> recordingUrl;
private final Optional<String> stereoRecordingUrl;
private final Optional<String> videoRecordingUrl;
private final Optional<Double> videoRecordingStartDelaySeconds;
private final Optional<String> transcript;
private final Map<String, Object> additionalProperties;
private Artifact(
Optional<List<ArtifactMessagesItem>> messages,
Optional<List<OpenAiMessage>> messagesOpenAiFormatted,
Optional<String> recordingUrl,
Optional<String> stereoRecordingUrl,
Optional<String> videoRecordingUrl,
Optional<Double> videoRecordingStartDelaySeconds,
Optional<String> transcript,
Map<String, Object> additionalProperties) {
this.messages = messages;
this.messagesOpenAiFormatted = messagesOpenAiFormatted;
this.recordingUrl = recordingUrl;
this.stereoRecordingUrl = stereoRecordingUrl;
this.videoRecordingUrl = videoRecordingUrl;
this.videoRecordingStartDelaySeconds = videoRecordingStartDelaySeconds;
this.transcript = transcript;
this.additionalProperties = additionalProperties;
}
/**
* @return These are the messages that were spoken during the call.
*/
@JsonProperty("messages")
public Optional<List<ArtifactMessagesItem>> getMessages() {
return messages;
}
/**
* @return These are the messages that were spoken during the call, formatted for OpenAI.
*/
@JsonProperty("messagesOpenAIFormatted")
public Optional<List<OpenAiMessage>> getMessagesOpenAiFormatted() {
return messagesOpenAiFormatted;
}
/**
* @return This is the recording url for the call. To enable, set <code>assistant.artifactPlan.recordingEnabled</code>.
*/
@JsonProperty("recordingUrl")
public Optional<String> getRecordingUrl() {
return recordingUrl;
}
/**
* @return This is the stereo recording url for the call. To enable, set <code>assistant.artifactPlan.recordingEnabled</code>.
*/
@JsonProperty("stereoRecordingUrl")
public Optional<String> getStereoRecordingUrl() {
return stereoRecordingUrl;
}
/**
* @return This is video recording url for the call. To enable, set <code>assistant.artifactPlan.videoRecordingEnabled</code>.
*/
@JsonProperty("videoRecordingUrl")
public Optional<String> getVideoRecordingUrl() {
return videoRecordingUrl;
}
/**
* @return This is video recording start delay in ms. To enable, set <code>assistant.artifactPlan.videoRecordingEnabled</code>. This can be used to align the playback of the recording with artifact.messages timestamps.
*/
@JsonProperty("videoRecordingStartDelaySeconds")
public Optional<Double> getVideoRecordingStartDelaySeconds() {
return videoRecordingStartDelaySeconds;
}
/**
* @return This is the transcript of the call. This is derived from <code>artifact.messages</code> but provided for convenience.
*/
@JsonProperty("transcript")
public Optional<String> getTranscript() {
return transcript;
}
@java.lang.Override
public boolean equals(Object other) {
if (this == other) return true;
return other instanceof Artifact && equalTo((Artifact) other);
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
private boolean equalTo(Artifact other) {
return messages.equals(other.messages)
&& messagesOpenAiFormatted.equals(other.messagesOpenAiFormatted)
&& recordingUrl.equals(other.recordingUrl)
&& stereoRecordingUrl.equals(other.stereoRecordingUrl)
&& videoRecordingUrl.equals(other.videoRecordingUrl)
&& videoRecordingStartDelaySeconds.equals(other.videoRecordingStartDelaySeconds)
&& transcript.equals(other.transcript);
}
@java.lang.Override
public int hashCode() {
return Objects.hash(
this.messages,
this.messagesOpenAiFormatted,
this.recordingUrl,
this.stereoRecordingUrl,
this.videoRecordingUrl,
this.videoRecordingStartDelaySeconds,
this.transcript);
}
@java.lang.Override
public String toString() {
return ObjectMappers.stringify(this);
}
public static Builder builder() {
return new Builder();
}
@JsonIgnoreProperties(ignoreUnknown = true)
public static final class Builder {
private Optional<List<ArtifactMessagesItem>> messages = Optional.empty();
private Optional<List<OpenAiMessage>> messagesOpenAiFormatted = Optional.empty();
private Optional<String> recordingUrl = Optional.empty();
private Optional<String> stereoRecordingUrl = Optional.empty();
private Optional<String> videoRecordingUrl = Optional.empty();
private Optional<Double> videoRecordingStartDelaySeconds = Optional.empty();
private Optional<String> transcript = Optional.empty();
@JsonAnySetter
private Map<String, Object> additionalProperties = new HashMap<>();
private Builder() {}
public Builder from(Artifact other) {
messages(other.getMessages());
messagesOpenAiFormatted(other.getMessagesOpenAiFormatted());
recordingUrl(other.getRecordingUrl());
stereoRecordingUrl(other.getStereoRecordingUrl());
videoRecordingUrl(other.getVideoRecordingUrl());
videoRecordingStartDelaySeconds(other.getVideoRecordingStartDelaySeconds());
transcript(other.getTranscript());
return this;
}
@JsonSetter(value = "messages", nulls = Nulls.SKIP)
public Builder messages(Optional<List<ArtifactMessagesItem>> messages) {
this.messages = messages;
return this;
}
public Builder messages(List<ArtifactMessagesItem> messages) {
this.messages = Optional.ofNullable(messages);
return this;
}
@JsonSetter(value = "messagesOpenAIFormatted", nulls = Nulls.SKIP)
public Builder messagesOpenAiFormatted(Optional<List<OpenAiMessage>> messagesOpenAiFormatted) {
this.messagesOpenAiFormatted = messagesOpenAiFormatted;
return this;
}
public Builder messagesOpenAiFormatted(List<OpenAiMessage> messagesOpenAiFormatted) {
this.messagesOpenAiFormatted = Optional.ofNullable(messagesOpenAiFormatted);
return this;
}
@JsonSetter(value = "recordingUrl", nulls = Nulls.SKIP)
public Builder recordingUrl(Optional<String> recordingUrl) {
this.recordingUrl = recordingUrl;
return this;
}
public Builder recordingUrl(String recordingUrl) {
this.recordingUrl = Optional.ofNullable(recordingUrl);
return this;
}
@JsonSetter(value = "stereoRecordingUrl", nulls = Nulls.SKIP)
public Builder stereoRecordingUrl(Optional<String> stereoRecordingUrl) {
this.stereoRecordingUrl = stereoRecordingUrl;
return this;
}
public Builder stereoRecordingUrl(String stereoRecordingUrl) {
this.stereoRecordingUrl = Optional.ofNullable(stereoRecordingUrl);
return this;
}
@JsonSetter(value = "videoRecordingUrl", nulls = Nulls.SKIP)
public Builder videoRecordingUrl(Optional<String> videoRecordingUrl) {
this.videoRecordingUrl = videoRecordingUrl;
return this;
}
public Builder videoRecordingUrl(String videoRecordingUrl) {
this.videoRecordingUrl = Optional.ofNullable(videoRecordingUrl);
return this;
}
@JsonSetter(value = "videoRecordingStartDelaySeconds", nulls = Nulls.SKIP)
public Builder videoRecordingStartDelaySeconds(Optional<Double> videoRecordingStartDelaySeconds) {
this.videoRecordingStartDelaySeconds = videoRecordingStartDelaySeconds;
return this;
}
public Builder videoRecordingStartDelaySeconds(Double videoRecordingStartDelaySeconds) {
this.videoRecordingStartDelaySeconds = Optional.ofNullable(videoRecordingStartDelaySeconds);
return this;
}
@JsonSetter(value = "transcript", nulls = Nulls.SKIP)
public Builder transcript(Optional<String> transcript) {
this.transcript = transcript;
return this;
}
public Builder transcript(String transcript) {
this.transcript = Optional.ofNullable(transcript);
return this;
}
public Artifact build() {
return new Artifact(
messages,
messagesOpenAiFormatted,
recordingUrl,
stereoRecordingUrl,
videoRecordingUrl,
videoRecordingStartDelaySeconds,
transcript,
additionalProperties);
}
}
}