Commit 2725d0e
authored
feat: refactor union types to use discriminated dispatch and add new providers
Overhaul the assistant-related union types (AssistantCredentialsItem,
AssistantModel, AssistantTranscriber, AssistantVoice, and their
UpdateAssistantDto counterparts) to use a provider-discriminated pattern
instead of try-each untagged deserialization. All union struct fields are
renamed from verbose DTO names (e.g. CreateElevenLabsCredentialDto) to
short provider-keyed names (e.g. Field11Labs), and all Visitor interface
methods are renamed accordingly (e.g. VisitCreateElevenLabsCredentialDto
→ VisitField11Labs).
Key changes:
- All union types now expose a `Provider` string discriminant field and use
`internal.MarshalJSONWithExtraProperty` for serialization, ensuring the
provider tag is always present on the wire
- Renamed exported struct fields and Visitor methods across
AssistantCredentialsItem, AssistantModel, AssistantTranscriber,
AssistantVoice, UpdateAssistantDtoCredentialsItem,
UpdateAssistantDtoModel, UpdateAssistantDtoTranscriber, and
UpdateAssistantDtoVoice — existing callers must update field access and
Visitor implementations
- New credential providers added: AnthropicBedrock, Soniox, Wellsaid,
Email, SlackWebhook; new model providers: AnthropicBedrock, Minimax;
new transcriber providers: Soniox; new voice providers: Wellsaid
- New enum constants AssistantClientMessagesItemAssistantSpeechStarted,
AssistantServerMessagesItemAssistantSpeechStarted, and their
UpdateAssistantDto counterparts
- SessionCreatedHook added to AssistantHooksItem and
UpdateAssistantDtoHooksItem unions
- Metadata field type changed from map[string]interface{} to map[string]any
(source-compatible in Go 1.18+)
- Nil-guard and String() nil checks added to Assistant methods
- UpdateAssistantDto gains explicit MarshalJSON/UnmarshalJSON methods
🌿 Generated with Fern1 parent d92f8c5 commit 2725d0e
90 files changed
Lines changed: 699350 additions & 53080 deletions
File tree
- .fern
- .github/workflows
- analytics
- assistants
- calls
- campaigns
- chats
- client
- core
- eval
- files
- insight
- internal
- observabilityscorecard
- option
- phonenumbers
- providerresources
- sessions
- squads
- structuredoutputs
- tools
- wiremock
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
5 | 9 | | |
6 | 10 | | |
7 | 11 | | |
| |||
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
17 | 34 | | |
18 | 35 | | |
19 | 36 | | |
| |||
23 | 40 | | |
24 | 41 | | |
25 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
26 | 54 | | |
27 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments