-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathassistants.go
3863 lines (3608 loc) · 144 KB
/
assistants.go
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
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// This file was auto-generated by Fern from our API Definition.
package api
import (
json "encoding/json"
fmt "fmt"
internal "github.com/VapiAI/server-sdk-go/internal"
time "time"
)
type AssistantsListRequest struct {
// This is the maximum number of items to return. Defaults to 100.
Limit *float64 `json:"-" url:"limit,omitempty"`
// This will return items where the createdAt is greater than the specified value.
CreatedAtGt *time.Time `json:"-" url:"createdAtGt,omitempty"`
// This will return items where the createdAt is less than the specified value.
CreatedAtLt *time.Time `json:"-" url:"createdAtLt,omitempty"`
// This will return items where the createdAt is greater than or equal to the specified value.
CreatedAtGe *time.Time `json:"-" url:"createdAtGe,omitempty"`
// This will return items where the createdAt is less than or equal to the specified value.
CreatedAtLe *time.Time `json:"-" url:"createdAtLe,omitempty"`
// This will return items where the updatedAt is greater than the specified value.
UpdatedAtGt *time.Time `json:"-" url:"updatedAtGt,omitempty"`
// This will return items where the updatedAt is less than the specified value.
UpdatedAtLt *time.Time `json:"-" url:"updatedAtLt,omitempty"`
// This will return items where the updatedAt is greater than or equal to the specified value.
UpdatedAtGe *time.Time `json:"-" url:"updatedAtGe,omitempty"`
// This will return items where the updatedAt is less than or equal to the specified value.
UpdatedAtLe *time.Time `json:"-" url:"updatedAtLe,omitempty"`
}
type Assistant struct {
// These are the options for the assistant's transcriber.
Transcriber *AssistantTranscriber `json:"transcriber,omitempty" url:"transcriber,omitempty"`
// These are the options for the assistant's LLM.
Model *AssistantModel `json:"model,omitempty" url:"model,omitempty"`
// These are the options for the assistant's voice.
Voice *AssistantVoice `json:"voice,omitempty" url:"voice,omitempty"`
// This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.).
//
// If unspecified, assistant will wait for user to speak and use the model to respond once they speak.
FirstMessage *string `json:"firstMessage,omitempty" url:"firstMessage,omitempty"`
// This is the mode for the first message. Default is 'assistant-speaks-first'.
//
// Use:
// - 'assistant-speaks-first' to have the assistant speak first.
// - 'assistant-waits-for-user' to have the assistant wait for the user to speak first.
// - 'assistant-speaks-first-with-model-generated-message' to have the assistant speak first with a message generated by the model based on the conversation state. (`assistant.model.messages` at call start, `call.messages` at squad transfer points).
//
// @default 'assistant-speaks-first'
FirstMessageMode *AssistantFirstMessageMode `json:"firstMessageMode,omitempty" url:"firstMessageMode,omitempty"`
// When this is enabled, no logs, recordings, or transcriptions will be stored. At the end of the call, you will still receive an end-of-call-report message to store on your server. Defaults to false.
HipaaEnabled *bool `json:"hipaaEnabled,omitempty" url:"hipaaEnabled,omitempty"`
// These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input. You can check the shape of the messages in ClientMessage schema.
ClientMessages []AssistantClientMessagesItem `json:"clientMessages,omitempty" url:"clientMessages,omitempty"`
// These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema.
ServerMessages []AssistantServerMessagesItem `json:"serverMessages,omitempty" url:"serverMessages,omitempty"`
// How many seconds of silence to wait before ending the call. Defaults to 30.
//
// @default 30
SilenceTimeoutSeconds *float64 `json:"silenceTimeoutSeconds,omitempty" url:"silenceTimeoutSeconds,omitempty"`
// This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended.
//
// @default 600 (10 minutes)
MaxDurationSeconds *float64 `json:"maxDurationSeconds,omitempty" url:"maxDurationSeconds,omitempty"`
// This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'.
BackgroundSound *AssistantBackgroundSound `json:"backgroundSound,omitempty" url:"backgroundSound,omitempty"`
// This enables filtering of noise and background speech while the user is talking.
//
// Default `false` while in beta.
//
// @default false
BackgroundDenoisingEnabled *bool `json:"backgroundDenoisingEnabled,omitempty" url:"backgroundDenoisingEnabled,omitempty"`
// This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech.
//
// Default `false` while in beta.
//
// @default false
ModelOutputInMessagesEnabled *bool `json:"modelOutputInMessagesEnabled,omitempty" url:"modelOutputInMessagesEnabled,omitempty"`
// These are the configurations to be passed to the transport providers of assistant's calls, like Twilio. You can store multiple configurations for different transport providers. For a call, only the configuration matching the call transport provider is used.
TransportConfigurations []*TransportConfigurationTwilio `json:"transportConfigurations,omitempty" url:"transportConfigurations,omitempty"`
// These are dynamic credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials.
Credentials []*AssistantCredentialsItem `json:"credentials,omitempty" url:"credentials,omitempty"`
// This is the name of the assistant.
//
// This is required when you want to transfer between assistants in a call.
Name *string `json:"name,omitempty" url:"name,omitempty"`
// These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool].
// This uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached.
// You can use neither of them, one of them, or both of them. By default, Twilio built-in detection is enabled while VoicemailTool is not.
VoicemailDetection *TwilioVoicemailDetection `json:"voicemailDetection,omitempty" url:"voicemailDetection,omitempty"`
// This is the message that the assistant will say if the call is forwarded to voicemail.
//
// If unspecified, it will hang up.
VoicemailMessage *string `json:"voicemailMessage,omitempty" url:"voicemailMessage,omitempty"`
// This is the message that the assistant will say if it ends the call.
//
// If unspecified, it will hang up without saying anything.
EndCallMessage *string `json:"endCallMessage,omitempty" url:"endCallMessage,omitempty"`
// This list contains phrases that, if spoken by the assistant, will trigger the call to be hung up. Case insensitive.
EndCallPhrases []string `json:"endCallPhrases,omitempty" url:"endCallPhrases,omitempty"`
// This is for metadata you want to store on the assistant.
Metadata map[string]interface{} `json:"metadata,omitempty" url:"metadata,omitempty"`
// This is the plan for analysis of assistant's calls. Stored in `call.analysis`.
AnalysisPlan *AnalysisPlan `json:"analysisPlan,omitempty" url:"analysisPlan,omitempty"`
// This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`.
//
// Note: `recordingEnabled` is currently at the root level. It will be moved to `artifactPlan` in the future, but will remain backwards compatible.
ArtifactPlan *ArtifactPlan `json:"artifactPlan,omitempty" url:"artifactPlan,omitempty"`
// This is the plan for static predefined messages that can be spoken by the assistant during the call, like `idleMessages`.
//
// Note: `firstMessage`, `voicemailMessage`, and `endCallMessage` are currently at the root level. They will be moved to `messagePlan` in the future, but will remain backwards compatible.
MessagePlan *MessagePlan `json:"messagePlan,omitempty" url:"messagePlan,omitempty"`
// This is the plan for when the assistant should start talking.
//
// You should configure this if you're running into these issues:
// - The assistant is too slow to start talking after the customer is done speaking.
// - The assistant is too fast to start talking after the customer is done speaking.
// - The assistant is so fast that it's actually interrupting the customer.
StartSpeakingPlan *StartSpeakingPlan `json:"startSpeakingPlan,omitempty" url:"startSpeakingPlan,omitempty"`
// This is the plan for when assistant should stop talking on customer interruption.
//
// You should configure this if you're running into these issues:
// - The assistant is too slow to recognize customer's interruption.
// - The assistant is too fast to recognize customer's interruption.
// - The assistant is getting interrupted by phrases that are just acknowledgments.
// - The assistant is getting interrupted by background noises.
// - The assistant is not properly stopping -- it starts talking right after getting interrupted.
StopSpeakingPlan *StopSpeakingPlan `json:"stopSpeakingPlan,omitempty" url:"stopSpeakingPlan,omitempty"`
// This is the plan for real-time monitoring of the assistant's calls.
//
// Usage:
// - To enable live listening of the assistant's calls, set `monitorPlan.listenEnabled` to `true`.
// - To enable live control of the assistant's calls, set `monitorPlan.controlEnabled` to `true`.
//
// Note, `serverMessages`, `clientMessages`, `serverUrl` and `serverUrlSecret` are currently at the root level but will be moved to `monitorPlan` in the future. Will remain backwards compatible
MonitorPlan *MonitorPlan `json:"monitorPlan,omitempty" url:"monitorPlan,omitempty"`
// These are the credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can provide a subset using this.
CredentialIds []string `json:"credentialIds,omitempty" url:"credentialIds,omitempty"`
// This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.
//
// The order of precedence is:
//
// 1. assistant.server.url
// 2. phoneNumber.serverUrl
// 3. org.serverUrl
Server *Server `json:"server,omitempty" url:"server,omitempty"`
// This is the unique identifier for the assistant.
Id string `json:"id" url:"id"`
// This is the unique identifier for the org that this assistant belongs to.
OrgId string `json:"orgId" url:"orgId"`
// This is the ISO 8601 date-time string of when the assistant was created.
CreatedAt time.Time `json:"createdAt" url:"createdAt"`
// This is the ISO 8601 date-time string of when the assistant was last updated.
UpdatedAt time.Time `json:"updatedAt" url:"updatedAt"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (a *Assistant) GetTranscriber() *AssistantTranscriber {
if a == nil {
return nil
}
return a.Transcriber
}
func (a *Assistant) GetModel() *AssistantModel {
if a == nil {
return nil
}
return a.Model
}
func (a *Assistant) GetVoice() *AssistantVoice {
if a == nil {
return nil
}
return a.Voice
}
func (a *Assistant) GetFirstMessage() *string {
if a == nil {
return nil
}
return a.FirstMessage
}
func (a *Assistant) GetFirstMessageMode() *AssistantFirstMessageMode {
if a == nil {
return nil
}
return a.FirstMessageMode
}
func (a *Assistant) GetHipaaEnabled() *bool {
if a == nil {
return nil
}
return a.HipaaEnabled
}
func (a *Assistant) GetClientMessages() []AssistantClientMessagesItem {
if a == nil {
return nil
}
return a.ClientMessages
}
func (a *Assistant) GetServerMessages() []AssistantServerMessagesItem {
if a == nil {
return nil
}
return a.ServerMessages
}
func (a *Assistant) GetSilenceTimeoutSeconds() *float64 {
if a == nil {
return nil
}
return a.SilenceTimeoutSeconds
}
func (a *Assistant) GetMaxDurationSeconds() *float64 {
if a == nil {
return nil
}
return a.MaxDurationSeconds
}
func (a *Assistant) GetBackgroundSound() *AssistantBackgroundSound {
if a == nil {
return nil
}
return a.BackgroundSound
}
func (a *Assistant) GetBackgroundDenoisingEnabled() *bool {
if a == nil {
return nil
}
return a.BackgroundDenoisingEnabled
}
func (a *Assistant) GetModelOutputInMessagesEnabled() *bool {
if a == nil {
return nil
}
return a.ModelOutputInMessagesEnabled
}
func (a *Assistant) GetTransportConfigurations() []*TransportConfigurationTwilio {
if a == nil {
return nil
}
return a.TransportConfigurations
}
func (a *Assistant) GetCredentials() []*AssistantCredentialsItem {
if a == nil {
return nil
}
return a.Credentials
}
func (a *Assistant) GetName() *string {
if a == nil {
return nil
}
return a.Name
}
func (a *Assistant) GetVoicemailDetection() *TwilioVoicemailDetection {
if a == nil {
return nil
}
return a.VoicemailDetection
}
func (a *Assistant) GetVoicemailMessage() *string {
if a == nil {
return nil
}
return a.VoicemailMessage
}
func (a *Assistant) GetEndCallMessage() *string {
if a == nil {
return nil
}
return a.EndCallMessage
}
func (a *Assistant) GetEndCallPhrases() []string {
if a == nil {
return nil
}
return a.EndCallPhrases
}
func (a *Assistant) GetMetadata() map[string]interface{} {
if a == nil {
return nil
}
return a.Metadata
}
func (a *Assistant) GetAnalysisPlan() *AnalysisPlan {
if a == nil {
return nil
}
return a.AnalysisPlan
}
func (a *Assistant) GetArtifactPlan() *ArtifactPlan {
if a == nil {
return nil
}
return a.ArtifactPlan
}
func (a *Assistant) GetMessagePlan() *MessagePlan {
if a == nil {
return nil
}
return a.MessagePlan
}
func (a *Assistant) GetStartSpeakingPlan() *StartSpeakingPlan {
if a == nil {
return nil
}
return a.StartSpeakingPlan
}
func (a *Assistant) GetStopSpeakingPlan() *StopSpeakingPlan {
if a == nil {
return nil
}
return a.StopSpeakingPlan
}
func (a *Assistant) GetMonitorPlan() *MonitorPlan {
if a == nil {
return nil
}
return a.MonitorPlan
}
func (a *Assistant) GetCredentialIds() []string {
if a == nil {
return nil
}
return a.CredentialIds
}
func (a *Assistant) GetServer() *Server {
if a == nil {
return nil
}
return a.Server
}
func (a *Assistant) GetId() string {
if a == nil {
return ""
}
return a.Id
}
func (a *Assistant) GetOrgId() string {
if a == nil {
return ""
}
return a.OrgId
}
func (a *Assistant) GetCreatedAt() time.Time {
if a == nil {
return time.Time{}
}
return a.CreatedAt
}
func (a *Assistant) GetUpdatedAt() time.Time {
if a == nil {
return time.Time{}
}
return a.UpdatedAt
}
func (a *Assistant) GetExtraProperties() map[string]interface{} {
return a.extraProperties
}
func (a *Assistant) UnmarshalJSON(data []byte) error {
type embed Assistant
var unmarshaler = struct {
embed
CreatedAt *internal.DateTime `json:"createdAt"`
UpdatedAt *internal.DateTime `json:"updatedAt"`
}{
embed: embed(*a),
}
if err := json.Unmarshal(data, &unmarshaler); err != nil {
return err
}
*a = Assistant(unmarshaler.embed)
a.CreatedAt = unmarshaler.CreatedAt.Time()
a.UpdatedAt = unmarshaler.UpdatedAt.Time()
extraProperties, err := internal.ExtractExtraProperties(data, *a)
if err != nil {
return err
}
a.extraProperties = extraProperties
a.rawJSON = json.RawMessage(data)
return nil
}
func (a *Assistant) MarshalJSON() ([]byte, error) {
type embed Assistant
var marshaler = struct {
embed
CreatedAt *internal.DateTime `json:"createdAt"`
UpdatedAt *internal.DateTime `json:"updatedAt"`
}{
embed: embed(*a),
CreatedAt: internal.NewDateTime(a.CreatedAt),
UpdatedAt: internal.NewDateTime(a.UpdatedAt),
}
return json.Marshal(marshaler)
}
func (a *Assistant) String() string {
if len(a.rawJSON) > 0 {
if value, err := internal.StringifyJSON(a.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(a); err == nil {
return value
}
return fmt.Sprintf("%#v", a)
}
// This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'.
type AssistantBackgroundSound string
const (
AssistantBackgroundSoundOff AssistantBackgroundSound = "off"
AssistantBackgroundSoundOffice AssistantBackgroundSound = "office"
)
func NewAssistantBackgroundSoundFromString(s string) (AssistantBackgroundSound, error) {
switch s {
case "off":
return AssistantBackgroundSoundOff, nil
case "office":
return AssistantBackgroundSoundOffice, nil
}
var t AssistantBackgroundSound
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (a AssistantBackgroundSound) Ptr() *AssistantBackgroundSound {
return &a
}
type AssistantClientMessagesItem string
const (
AssistantClientMessagesItemConversationUpdate AssistantClientMessagesItem = "conversation-update"
AssistantClientMessagesItemFunctionCall AssistantClientMessagesItem = "function-call"
AssistantClientMessagesItemFunctionCallResult AssistantClientMessagesItem = "function-call-result"
AssistantClientMessagesItemHang AssistantClientMessagesItem = "hang"
AssistantClientMessagesItemLanguageChanged AssistantClientMessagesItem = "language-changed"
AssistantClientMessagesItemMetadata AssistantClientMessagesItem = "metadata"
AssistantClientMessagesItemModelOutput AssistantClientMessagesItem = "model-output"
AssistantClientMessagesItemSpeechUpdate AssistantClientMessagesItem = "speech-update"
AssistantClientMessagesItemStatusUpdate AssistantClientMessagesItem = "status-update"
AssistantClientMessagesItemTranscript AssistantClientMessagesItem = "transcript"
AssistantClientMessagesItemToolCalls AssistantClientMessagesItem = "tool-calls"
AssistantClientMessagesItemToolCallsResult AssistantClientMessagesItem = "tool-calls-result"
AssistantClientMessagesItemTransferUpdate AssistantClientMessagesItem = "transfer-update"
AssistantClientMessagesItemUserInterrupted AssistantClientMessagesItem = "user-interrupted"
AssistantClientMessagesItemVoiceInput AssistantClientMessagesItem = "voice-input"
)
func NewAssistantClientMessagesItemFromString(s string) (AssistantClientMessagesItem, error) {
switch s {
case "conversation-update":
return AssistantClientMessagesItemConversationUpdate, nil
case "function-call":
return AssistantClientMessagesItemFunctionCall, nil
case "function-call-result":
return AssistantClientMessagesItemFunctionCallResult, nil
case "hang":
return AssistantClientMessagesItemHang, nil
case "language-changed":
return AssistantClientMessagesItemLanguageChanged, nil
case "metadata":
return AssistantClientMessagesItemMetadata, nil
case "model-output":
return AssistantClientMessagesItemModelOutput, nil
case "speech-update":
return AssistantClientMessagesItemSpeechUpdate, nil
case "status-update":
return AssistantClientMessagesItemStatusUpdate, nil
case "transcript":
return AssistantClientMessagesItemTranscript, nil
case "tool-calls":
return AssistantClientMessagesItemToolCalls, nil
case "tool-calls-result":
return AssistantClientMessagesItemToolCallsResult, nil
case "transfer-update":
return AssistantClientMessagesItemTransferUpdate, nil
case "user-interrupted":
return AssistantClientMessagesItemUserInterrupted, nil
case "voice-input":
return AssistantClientMessagesItemVoiceInput, nil
}
var t AssistantClientMessagesItem
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (a AssistantClientMessagesItem) Ptr() *AssistantClientMessagesItem {
return &a
}
type AssistantCredentialsItem struct {
CreateAnthropicCredentialDto *CreateAnthropicCredentialDto
CreateAnyscaleCredentialDto *CreateAnyscaleCredentialDto
CreateAssemblyAiCredentialDto *CreateAssemblyAiCredentialDto
CreateAzureOpenAiCredentialDto *CreateAzureOpenAiCredentialDto
CreateAzureCredentialDto *CreateAzureCredentialDto
CreateByoSipTrunkCredentialDto *CreateByoSipTrunkCredentialDto
CreateCartesiaCredentialDto *CreateCartesiaCredentialDto
CreateCloudflareCredentialDto *CreateCloudflareCredentialDto
CreateCustomLlmCredentialDto *CreateCustomLlmCredentialDto
CreateDeepgramCredentialDto *CreateDeepgramCredentialDto
CreateDeepInfraCredentialDto *CreateDeepInfraCredentialDto
CreateDeepSeekCredentialDto *CreateDeepSeekCredentialDto
CreateElevenLabsCredentialDto *CreateElevenLabsCredentialDto
CreateGcpCredentialDto *CreateGcpCredentialDto
CreateGladiaCredentialDto *CreateGladiaCredentialDto
CreateGoHighLevelCredentialDto *CreateGoHighLevelCredentialDto
CreateGroqCredentialDto *CreateGroqCredentialDto
CreateLangfuseCredentialDto *CreateLangfuseCredentialDto
CreateLmntCredentialDto *CreateLmntCredentialDto
CreateMakeCredentialDto *CreateMakeCredentialDto
CreateOpenAiCredentialDto *CreateOpenAiCredentialDto
CreateOpenRouterCredentialDto *CreateOpenRouterCredentialDto
CreatePerplexityAiCredentialDto *CreatePerplexityAiCredentialDto
CreatePlayHtCredentialDto *CreatePlayHtCredentialDto
CreateRimeAiCredentialDto *CreateRimeAiCredentialDto
CreateRunpodCredentialDto *CreateRunpodCredentialDto
CreateS3CredentialDto *CreateS3CredentialDto
CreateSmallestAiCredentialDto *CreateSmallestAiCredentialDto
CreateTavusCredentialDto *CreateTavusCredentialDto
CreateTogetherAiCredentialDto *CreateTogetherAiCredentialDto
CreateTwilioCredentialDto *CreateTwilioCredentialDto
CreateVonageCredentialDto *CreateVonageCredentialDto
CreateWebhookCredentialDto *CreateWebhookCredentialDto
CreateXAiCredentialDto *CreateXAiCredentialDto
typ string
}
func (a *AssistantCredentialsItem) GetCreateAnthropicCredentialDto() *CreateAnthropicCredentialDto {
if a == nil {
return nil
}
return a.CreateAnthropicCredentialDto
}
func (a *AssistantCredentialsItem) GetCreateAnyscaleCredentialDto() *CreateAnyscaleCredentialDto {
if a == nil {
return nil
}
return a.CreateAnyscaleCredentialDto
}
func (a *AssistantCredentialsItem) GetCreateAssemblyAiCredentialDto() *CreateAssemblyAiCredentialDto {
if a == nil {
return nil
}
return a.CreateAssemblyAiCredentialDto
}
func (a *AssistantCredentialsItem) GetCreateAzureOpenAiCredentialDto() *CreateAzureOpenAiCredentialDto {
if a == nil {
return nil
}
return a.CreateAzureOpenAiCredentialDto
}
func (a *AssistantCredentialsItem) GetCreateAzureCredentialDto() *CreateAzureCredentialDto {
if a == nil {
return nil
}
return a.CreateAzureCredentialDto
}
func (a *AssistantCredentialsItem) GetCreateByoSipTrunkCredentialDto() *CreateByoSipTrunkCredentialDto {
if a == nil {
return nil
}
return a.CreateByoSipTrunkCredentialDto
}
func (a *AssistantCredentialsItem) GetCreateCartesiaCredentialDto() *CreateCartesiaCredentialDto {
if a == nil {
return nil
}
return a.CreateCartesiaCredentialDto
}
func (a *AssistantCredentialsItem) GetCreateCloudflareCredentialDto() *CreateCloudflareCredentialDto {
if a == nil {
return nil
}
return a.CreateCloudflareCredentialDto
}
func (a *AssistantCredentialsItem) GetCreateCustomLlmCredentialDto() *CreateCustomLlmCredentialDto {
if a == nil {
return nil
}
return a.CreateCustomLlmCredentialDto
}
func (a *AssistantCredentialsItem) GetCreateDeepgramCredentialDto() *CreateDeepgramCredentialDto {
if a == nil {
return nil
}
return a.CreateDeepgramCredentialDto
}
func (a *AssistantCredentialsItem) GetCreateDeepInfraCredentialDto() *CreateDeepInfraCredentialDto {
if a == nil {
return nil
}
return a.CreateDeepInfraCredentialDto
}
func (a *AssistantCredentialsItem) GetCreateDeepSeekCredentialDto() *CreateDeepSeekCredentialDto {
if a == nil {
return nil
}
return a.CreateDeepSeekCredentialDto
}
func (a *AssistantCredentialsItem) GetCreateElevenLabsCredentialDto() *CreateElevenLabsCredentialDto {
if a == nil {
return nil
}
return a.CreateElevenLabsCredentialDto
}
func (a *AssistantCredentialsItem) GetCreateGcpCredentialDto() *CreateGcpCredentialDto {
if a == nil {
return nil
}
return a.CreateGcpCredentialDto
}
func (a *AssistantCredentialsItem) GetCreateGladiaCredentialDto() *CreateGladiaCredentialDto {
if a == nil {
return nil
}
return a.CreateGladiaCredentialDto
}
func (a *AssistantCredentialsItem) GetCreateGoHighLevelCredentialDto() *CreateGoHighLevelCredentialDto {
if a == nil {
return nil
}
return a.CreateGoHighLevelCredentialDto
}
func (a *AssistantCredentialsItem) GetCreateGroqCredentialDto() *CreateGroqCredentialDto {
if a == nil {
return nil
}
return a.CreateGroqCredentialDto
}
func (a *AssistantCredentialsItem) GetCreateLangfuseCredentialDto() *CreateLangfuseCredentialDto {
if a == nil {
return nil
}
return a.CreateLangfuseCredentialDto
}
func (a *AssistantCredentialsItem) GetCreateLmntCredentialDto() *CreateLmntCredentialDto {
if a == nil {
return nil
}
return a.CreateLmntCredentialDto
}
func (a *AssistantCredentialsItem) GetCreateMakeCredentialDto() *CreateMakeCredentialDto {
if a == nil {
return nil
}
return a.CreateMakeCredentialDto
}
func (a *AssistantCredentialsItem) GetCreateOpenAiCredentialDto() *CreateOpenAiCredentialDto {
if a == nil {
return nil
}
return a.CreateOpenAiCredentialDto
}
func (a *AssistantCredentialsItem) GetCreateOpenRouterCredentialDto() *CreateOpenRouterCredentialDto {
if a == nil {
return nil
}
return a.CreateOpenRouterCredentialDto
}
func (a *AssistantCredentialsItem) GetCreatePerplexityAiCredentialDto() *CreatePerplexityAiCredentialDto {
if a == nil {
return nil
}
return a.CreatePerplexityAiCredentialDto
}
func (a *AssistantCredentialsItem) GetCreatePlayHtCredentialDto() *CreatePlayHtCredentialDto {
if a == nil {
return nil
}
return a.CreatePlayHtCredentialDto
}
func (a *AssistantCredentialsItem) GetCreateRimeAiCredentialDto() *CreateRimeAiCredentialDto {
if a == nil {
return nil
}
return a.CreateRimeAiCredentialDto
}
func (a *AssistantCredentialsItem) GetCreateRunpodCredentialDto() *CreateRunpodCredentialDto {
if a == nil {
return nil
}
return a.CreateRunpodCredentialDto
}
func (a *AssistantCredentialsItem) GetCreateS3CredentialDto() *CreateS3CredentialDto {
if a == nil {
return nil
}
return a.CreateS3CredentialDto
}
func (a *AssistantCredentialsItem) GetCreateSmallestAiCredentialDto() *CreateSmallestAiCredentialDto {
if a == nil {
return nil
}
return a.CreateSmallestAiCredentialDto
}
func (a *AssistantCredentialsItem) GetCreateTavusCredentialDto() *CreateTavusCredentialDto {
if a == nil {
return nil
}
return a.CreateTavusCredentialDto
}
func (a *AssistantCredentialsItem) GetCreateTogetherAiCredentialDto() *CreateTogetherAiCredentialDto {
if a == nil {
return nil
}
return a.CreateTogetherAiCredentialDto
}
func (a *AssistantCredentialsItem) GetCreateTwilioCredentialDto() *CreateTwilioCredentialDto {
if a == nil {
return nil
}
return a.CreateTwilioCredentialDto
}
func (a *AssistantCredentialsItem) GetCreateVonageCredentialDto() *CreateVonageCredentialDto {
if a == nil {
return nil
}
return a.CreateVonageCredentialDto
}
func (a *AssistantCredentialsItem) GetCreateWebhookCredentialDto() *CreateWebhookCredentialDto {
if a == nil {
return nil
}
return a.CreateWebhookCredentialDto
}
func (a *AssistantCredentialsItem) GetCreateXAiCredentialDto() *CreateXAiCredentialDto {
if a == nil {
return nil
}
return a.CreateXAiCredentialDto
}
func (a *AssistantCredentialsItem) UnmarshalJSON(data []byte) error {
valueCreateAnthropicCredentialDto := new(CreateAnthropicCredentialDto)
if err := json.Unmarshal(data, &valueCreateAnthropicCredentialDto); err == nil {
a.typ = "CreateAnthropicCredentialDto"
a.CreateAnthropicCredentialDto = valueCreateAnthropicCredentialDto
return nil
}
valueCreateAnyscaleCredentialDto := new(CreateAnyscaleCredentialDto)
if err := json.Unmarshal(data, &valueCreateAnyscaleCredentialDto); err == nil {
a.typ = "CreateAnyscaleCredentialDto"
a.CreateAnyscaleCredentialDto = valueCreateAnyscaleCredentialDto
return nil
}
valueCreateAssemblyAiCredentialDto := new(CreateAssemblyAiCredentialDto)
if err := json.Unmarshal(data, &valueCreateAssemblyAiCredentialDto); err == nil {
a.typ = "CreateAssemblyAiCredentialDto"
a.CreateAssemblyAiCredentialDto = valueCreateAssemblyAiCredentialDto
return nil
}
valueCreateAzureOpenAiCredentialDto := new(CreateAzureOpenAiCredentialDto)
if err := json.Unmarshal(data, &valueCreateAzureOpenAiCredentialDto); err == nil {
a.typ = "CreateAzureOpenAiCredentialDto"
a.CreateAzureOpenAiCredentialDto = valueCreateAzureOpenAiCredentialDto
return nil
}
valueCreateAzureCredentialDto := new(CreateAzureCredentialDto)
if err := json.Unmarshal(data, &valueCreateAzureCredentialDto); err == nil {
a.typ = "CreateAzureCredentialDto"
a.CreateAzureCredentialDto = valueCreateAzureCredentialDto
return nil
}
valueCreateByoSipTrunkCredentialDto := new(CreateByoSipTrunkCredentialDto)
if err := json.Unmarshal(data, &valueCreateByoSipTrunkCredentialDto); err == nil {
a.typ = "CreateByoSipTrunkCredentialDto"
a.CreateByoSipTrunkCredentialDto = valueCreateByoSipTrunkCredentialDto
return nil
}
valueCreateCartesiaCredentialDto := new(CreateCartesiaCredentialDto)
if err := json.Unmarshal(data, &valueCreateCartesiaCredentialDto); err == nil {
a.typ = "CreateCartesiaCredentialDto"
a.CreateCartesiaCredentialDto = valueCreateCartesiaCredentialDto
return nil
}
valueCreateCloudflareCredentialDto := new(CreateCloudflareCredentialDto)
if err := json.Unmarshal(data, &valueCreateCloudflareCredentialDto); err == nil {
a.typ = "CreateCloudflareCredentialDto"
a.CreateCloudflareCredentialDto = valueCreateCloudflareCredentialDto
return nil
}
valueCreateCustomLlmCredentialDto := new(CreateCustomLlmCredentialDto)
if err := json.Unmarshal(data, &valueCreateCustomLlmCredentialDto); err == nil {
a.typ = "CreateCustomLlmCredentialDto"
a.CreateCustomLlmCredentialDto = valueCreateCustomLlmCredentialDto
return nil
}
valueCreateDeepgramCredentialDto := new(CreateDeepgramCredentialDto)
if err := json.Unmarshal(data, &valueCreateDeepgramCredentialDto); err == nil {
a.typ = "CreateDeepgramCredentialDto"
a.CreateDeepgramCredentialDto = valueCreateDeepgramCredentialDto
return nil
}
valueCreateDeepInfraCredentialDto := new(CreateDeepInfraCredentialDto)
if err := json.Unmarshal(data, &valueCreateDeepInfraCredentialDto); err == nil {
a.typ = "CreateDeepInfraCredentialDto"
a.CreateDeepInfraCredentialDto = valueCreateDeepInfraCredentialDto
return nil
}
valueCreateDeepSeekCredentialDto := new(CreateDeepSeekCredentialDto)
if err := json.Unmarshal(data, &valueCreateDeepSeekCredentialDto); err == nil {
a.typ = "CreateDeepSeekCredentialDto"
a.CreateDeepSeekCredentialDto = valueCreateDeepSeekCredentialDto
return nil
}
valueCreateElevenLabsCredentialDto := new(CreateElevenLabsCredentialDto)
if err := json.Unmarshal(data, &valueCreateElevenLabsCredentialDto); err == nil {
a.typ = "CreateElevenLabsCredentialDto"
a.CreateElevenLabsCredentialDto = valueCreateElevenLabsCredentialDto
return nil
}
valueCreateGcpCredentialDto := new(CreateGcpCredentialDto)
if err := json.Unmarshal(data, &valueCreateGcpCredentialDto); err == nil {
a.typ = "CreateGcpCredentialDto"
a.CreateGcpCredentialDto = valueCreateGcpCredentialDto
return nil
}
valueCreateGladiaCredentialDto := new(CreateGladiaCredentialDto)
if err := json.Unmarshal(data, &valueCreateGladiaCredentialDto); err == nil {
a.typ = "CreateGladiaCredentialDto"
a.CreateGladiaCredentialDto = valueCreateGladiaCredentialDto
return nil
}
valueCreateGoHighLevelCredentialDto := new(CreateGoHighLevelCredentialDto)
if err := json.Unmarshal(data, &valueCreateGoHighLevelCredentialDto); err == nil {
a.typ = "CreateGoHighLevelCredentialDto"
a.CreateGoHighLevelCredentialDto = valueCreateGoHighLevelCredentialDto
return nil
}
valueCreateGroqCredentialDto := new(CreateGroqCredentialDto)
if err := json.Unmarshal(data, &valueCreateGroqCredentialDto); err == nil {
a.typ = "CreateGroqCredentialDto"
a.CreateGroqCredentialDto = valueCreateGroqCredentialDto
return nil
}
valueCreateLangfuseCredentialDto := new(CreateLangfuseCredentialDto)
if err := json.Unmarshal(data, &valueCreateLangfuseCredentialDto); err == nil {
a.typ = "CreateLangfuseCredentialDto"
a.CreateLangfuseCredentialDto = valueCreateLangfuseCredentialDto
return nil
}
valueCreateLmntCredentialDto := new(CreateLmntCredentialDto)
if err := json.Unmarshal(data, &valueCreateLmntCredentialDto); err == nil {
a.typ = "CreateLmntCredentialDto"
a.CreateLmntCredentialDto = valueCreateLmntCredentialDto
return nil
}
valueCreateMakeCredentialDto := new(CreateMakeCredentialDto)
if err := json.Unmarshal(data, &valueCreateMakeCredentialDto); err == nil {
a.typ = "CreateMakeCredentialDto"
a.CreateMakeCredentialDto = valueCreateMakeCredentialDto
return nil
}
valueCreateOpenAiCredentialDto := new(CreateOpenAiCredentialDto)
if err := json.Unmarshal(data, &valueCreateOpenAiCredentialDto); err == nil {
a.typ = "CreateOpenAiCredentialDto"
a.CreateOpenAiCredentialDto = valueCreateOpenAiCredentialDto
return nil
}
valueCreateOpenRouterCredentialDto := new(CreateOpenRouterCredentialDto)
if err := json.Unmarshal(data, &valueCreateOpenRouterCredentialDto); err == nil {
a.typ = "CreateOpenRouterCredentialDto"
a.CreateOpenRouterCredentialDto = valueCreateOpenRouterCredentialDto
return nil
}
valueCreatePerplexityAiCredentialDto := new(CreatePerplexityAiCredentialDto)
if err := json.Unmarshal(data, &valueCreatePerplexityAiCredentialDto); err == nil {
a.typ = "CreatePerplexityAiCredentialDto"
a.CreatePerplexityAiCredentialDto = valueCreatePerplexityAiCredentialDto
return nil
}
valueCreatePlayHtCredentialDto := new(CreatePlayHtCredentialDto)
if err := json.Unmarshal(data, &valueCreatePlayHtCredentialDto); err == nil {
a.typ = "CreatePlayHtCredentialDto"
a.CreatePlayHtCredentialDto = valueCreatePlayHtCredentialDto
return nil
}
valueCreateRimeAiCredentialDto := new(CreateRimeAiCredentialDto)
if err := json.Unmarshal(data, &valueCreateRimeAiCredentialDto); err == nil {
a.typ = "CreateRimeAiCredentialDto"
a.CreateRimeAiCredentialDto = valueCreateRimeAiCredentialDto
return nil
}
valueCreateRunpodCredentialDto := new(CreateRunpodCredentialDto)
if err := json.Unmarshal(data, &valueCreateRunpodCredentialDto); err == nil {
a.typ = "CreateRunpodCredentialDto"
a.CreateRunpodCredentialDto = valueCreateRunpodCredentialDto
return nil
}
valueCreateS3CredentialDto := new(CreateS3CredentialDto)
if err := json.Unmarshal(data, &valueCreateS3CredentialDto); err == nil {
a.typ = "CreateS3CredentialDto"
a.CreateS3CredentialDto = valueCreateS3CredentialDto
return nil
}
valueCreateSmallestAiCredentialDto := new(CreateSmallestAiCredentialDto)
if err := json.Unmarshal(data, &valueCreateSmallestAiCredentialDto); err == nil {
a.typ = "CreateSmallestAiCredentialDto"
a.CreateSmallestAiCredentialDto = valueCreateSmallestAiCredentialDto
return nil
}
valueCreateTavusCredentialDto := new(CreateTavusCredentialDto)
if err := json.Unmarshal(data, &valueCreateTavusCredentialDto); err == nil {
a.typ = "CreateTavusCredentialDto"
a.CreateTavusCredentialDto = valueCreateTavusCredentialDto
return nil
}
valueCreateTogetherAiCredentialDto := new(CreateTogetherAiCredentialDto)
if err := json.Unmarshal(data, &valueCreateTogetherAiCredentialDto); err == nil {
a.typ = "CreateTogetherAiCredentialDto"
a.CreateTogetherAiCredentialDto = valueCreateTogetherAiCredentialDto
return nil
}
valueCreateTwilioCredentialDto := new(CreateTwilioCredentialDto)
if err := json.Unmarshal(data, &valueCreateTwilioCredentialDto); err == nil {
a.typ = "CreateTwilioCredentialDto"
a.CreateTwilioCredentialDto = valueCreateTwilioCredentialDto
return nil
}
valueCreateVonageCredentialDto := new(CreateVonageCredentialDto)
if err := json.Unmarshal(data, &valueCreateVonageCredentialDto); err == nil {
a.typ = "CreateVonageCredentialDto"
a.CreateVonageCredentialDto = valueCreateVonageCredentialDto
return nil
}