This repository was archived by the owner on Oct 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathArtifact.java
More file actions
427 lines (359 loc) · 15.5 KB
/
Copy pathArtifact.java
File metadata and controls
427 lines (359 loc) · 15.5 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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
/**
* 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<Recording> recording;
private final Optional<String> transcript;
private final Optional<String> pcapUrl;
private final Optional<List<NodeArtifact>> nodes;
private final Optional<Map<String, Object>> variableValues;
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<Recording> recording,
Optional<String> transcript,
Optional<String> pcapUrl,
Optional<List<NodeArtifact>> nodes,
Optional<Map<String, Object>> variableValues,
Map<String, Object> additionalProperties) {
this.messages = messages;
this.messagesOpenAiFormatted = messagesOpenAiFormatted;
this.recordingUrl = recordingUrl;
this.stereoRecordingUrl = stereoRecordingUrl;
this.videoRecordingUrl = videoRecordingUrl;
this.videoRecordingStartDelaySeconds = videoRecordingStartDelaySeconds;
this.recording = recording;
this.transcript = transcript;
this.pcapUrl = pcapUrl;
this.nodes = nodes;
this.variableValues = variableValues;
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 recording url for the call. To enable, set <code>assistant.artifactPlan.recordingEnabled</code>.
*/
@JsonProperty("recording")
public Optional<Recording> getRecording() {
return recording;
}
/**
* @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;
}
/**
* @return This is the packet capture url for the call. This is only available for <code>phone</code> type calls where phone number's provider is <code>vapi</code> or <code>byo-phone-number</code>.
*/
@JsonProperty("pcapUrl")
public Optional<String> getPcapUrl() {
return pcapUrl;
}
/**
* @return This is the history of workflow nodes that were executed during the call.
*/
@JsonProperty("nodes")
public Optional<List<NodeArtifact>> getNodes() {
return nodes;
}
/**
* @return These are the variable values at the end of the workflow execution.
*/
@JsonProperty("variableValues")
public Optional<Map<String, Object>> getVariableValues() {
return variableValues;
}
@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)
&& recording.equals(other.recording)
&& transcript.equals(other.transcript)
&& pcapUrl.equals(other.pcapUrl)
&& nodes.equals(other.nodes)
&& variableValues.equals(other.variableValues);
}
@java.lang.Override
public int hashCode() {
return Objects.hash(
this.messages,
this.messagesOpenAiFormatted,
this.recordingUrl,
this.stereoRecordingUrl,
this.videoRecordingUrl,
this.videoRecordingStartDelaySeconds,
this.recording,
this.transcript,
this.pcapUrl,
this.nodes,
this.variableValues);
}
@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<Recording> recording = Optional.empty();
private Optional<String> transcript = Optional.empty();
private Optional<String> pcapUrl = Optional.empty();
private Optional<List<NodeArtifact>> nodes = Optional.empty();
private Optional<Map<String, Object>> variableValues = 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());
recording(other.getRecording());
transcript(other.getTranscript());
pcapUrl(other.getPcapUrl());
nodes(other.getNodes());
variableValues(other.getVariableValues());
return this;
}
/**
* <p>These are the messages that were spoken during the call.</p>
*/
@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;
}
/**
* <p>These are the messages that were spoken during the call, formatted for OpenAI.</p>
*/
@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;
}
/**
* <p>This is the recording url for the call. To enable, set <code>assistant.artifactPlan.recordingEnabled</code>.</p>
*/
@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;
}
/**
* <p>This is the stereo recording url for the call. To enable, set <code>assistant.artifactPlan.recordingEnabled</code>.</p>
*/
@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;
}
/**
* <p>This is video recording url for the call. To enable, set <code>assistant.artifactPlan.videoRecordingEnabled</code>.</p>
*/
@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;
}
/**
* <p>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.</p>
*/
@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;
}
/**
* <p>This is the recording url for the call. To enable, set <code>assistant.artifactPlan.recordingEnabled</code>.</p>
*/
@JsonSetter(value = "recording", nulls = Nulls.SKIP)
public Builder recording(Optional<Recording> recording) {
this.recording = recording;
return this;
}
public Builder recording(Recording recording) {
this.recording = Optional.ofNullable(recording);
return this;
}
/**
* <p>This is the transcript of the call. This is derived from <code>artifact.messages</code> but provided for convenience.</p>
*/
@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;
}
/**
* <p>This is the packet capture url for the call. This is only available for <code>phone</code> type calls where phone number's provider is <code>vapi</code> or <code>byo-phone-number</code>.</p>
*/
@JsonSetter(value = "pcapUrl", nulls = Nulls.SKIP)
public Builder pcapUrl(Optional<String> pcapUrl) {
this.pcapUrl = pcapUrl;
return this;
}
public Builder pcapUrl(String pcapUrl) {
this.pcapUrl = Optional.ofNullable(pcapUrl);
return this;
}
/**
* <p>This is the history of workflow nodes that were executed during the call.</p>
*/
@JsonSetter(value = "nodes", nulls = Nulls.SKIP)
public Builder nodes(Optional<List<NodeArtifact>> nodes) {
this.nodes = nodes;
return this;
}
public Builder nodes(List<NodeArtifact> nodes) {
this.nodes = Optional.ofNullable(nodes);
return this;
}
/**
* <p>These are the variable values at the end of the workflow execution.</p>
*/
@JsonSetter(value = "variableValues", nulls = Nulls.SKIP)
public Builder variableValues(Optional<Map<String, Object>> variableValues) {
this.variableValues = variableValues;
return this;
}
public Builder variableValues(Map<String, Object> variableValues) {
this.variableValues = Optional.ofNullable(variableValues);
return this;
}
public Artifact build() {
return new Artifact(
messages,
messagesOpenAiFormatted,
recordingUrl,
stereoRecordingUrl,
videoRecordingUrl,
videoRecordingStartDelaySeconds,
recording,
transcript,
pcapUrl,
nodes,
variableValues,
additionalProperties);
}
}
}