Skip to content

Commit b59fbd1

Browse files
committed
mark fields public and fixes
1 parent 4ec7974 commit b59fbd1

File tree

5 files changed

+23
-5
lines changed

5 files changed

+23
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Add to your project using Swift Package Manager:
1212

1313
```swift
1414
dependencies: [
15-
.package(url: "https://github.com/elevenlabs/elevenlabs-swift-sdk.git", from: "2.0.2")
15+
.package(url: "https://github.com/elevenlabs/elevenlabs-swift-sdk.git", from: "2.0.3")
1616
]
1717
```
1818

Sources/ElevenLabs/Conversation.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,18 +512,21 @@ public struct ConversationOptions: Sendable {
512512
public var ttsOverrides: TTSOverrides?
513513
public var customLlmExtraBody: [String: String]? // Simplified to be Sendable
514514
public var dynamicVariables: [String: String]? // Simplified to be Sendable
515+
public var userId: String?
515516

516517
public init(conversationOverrides: ConversationOverrides = .init(),
517518
agentOverrides: AgentOverrides? = nil,
518519
ttsOverrides: TTSOverrides? = nil,
519520
customLlmExtraBody: [String: String]? = nil,
520-
dynamicVariables: [String: String]? = nil)
521+
dynamicVariables: [String: String]? = nil,
522+
userId: String? = nil)
521523
{
522524
self.conversationOverrides = conversationOverrides
523525
self.agentOverrides = agentOverrides
524526
self.ttsOverrides = ttsOverrides
525527
self.customLlmExtraBody = customLlmExtraBody
526528
self.dynamicVariables = dynamicVariables
529+
self.userId = userId
527530
}
528531

529532
public static let `default` = ConversationOptions()

Sources/ElevenLabs/Models/ConversationConfig.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,22 @@ public struct ConversationConfig: Sendable {
77
public var conversationOverrides: ConversationOverrides?
88
public var customLlmExtraBody: [String: String]? // Simplified to be Sendable
99
public var dynamicVariables: [String: String]? // Simplified to be Sendable
10+
public var userId: String?
1011

1112
public init(
1213
agentOverrides: AgentOverrides? = nil,
1314
ttsOverrides: TTSOverrides? = nil,
1415
conversationOverrides: ConversationOverrides? = nil,
1516
customLlmExtraBody: [String: String]? = nil,
16-
dynamicVariables: [String: String]? = nil
17+
dynamicVariables: [String: String]? = nil,
18+
userId: String? = nil
1719
) {
1820
self.agentOverrides = agentOverrides
1921
self.ttsOverrides = ttsOverrides
2022
self.conversationOverrides = conversationOverrides
2123
self.customLlmExtraBody = customLlmExtraBody
2224
self.dynamicVariables = dynamicVariables
25+
self.userId = userId
2326
}
2427
}
2528

@@ -68,7 +71,8 @@ extension ConversationConfig {
6871
agentOverrides: agentOverrides,
6972
ttsOverrides: ttsOverrides,
7073
customLlmExtraBody: customLlmExtraBody,
71-
dynamicVariables: dynamicVariables
74+
dynamicVariables: dynamicVariables,
75+
userId: userId
7276
)
7377
}
7478
}

Sources/ElevenLabs/Protocol/EventSerializer.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,17 @@ enum EventSerializer {
107107
json["dynamic_variables"] = dynamicVars
108108
}
109109

110+
// Add source_info (equivalent to client in React Native)
111+
var sourceInfo: [String: Any] = [:]
112+
sourceInfo["source"] = "swift_sdk"
113+
sourceInfo["version"] = SDKVersion.version
114+
json["source_info"] = sourceInfo
115+
116+
// Add user_id if provided
117+
if let userId = config.userId {
118+
json["user_id"] = userId
119+
}
120+
110121
return json
111122
}
112123
}

Sources/ElevenLabs/Version.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
import Foundation
44

55
enum SDKVersion {
6-
static let version = "2.0.2"
6+
static let version = "2.0.3"
77
}

0 commit comments

Comments
 (0)