diff --git a/Source/AssistantV2/Models/MessageInputOptions.swift b/Source/AssistantV2/Models/MessageInputOptions.swift index d9ac34fdf..5f5c85c15 100644 --- a/Source/AssistantV2/Models/MessageInputOptions.swift +++ b/Source/AssistantV2/Models/MessageInputOptions.swift @@ -90,12 +90,12 @@ public struct MessageInputOptions: Codable, Equatable { - returns: An initialized `MessageInputOptions`. */ public init( + debug: Bool? = nil, restart: Bool? = nil, alternateIntents: Bool? = nil, - spelling: MessageInputOptionsSpelling? = nil, - debug: Bool? = nil, returnContext: Bool? = nil, - export: Bool? = nil + export: Bool? = nil, + spelling: MessageInputOptionsSpelling? = nil ) { self.restart = restart diff --git a/Tests/AssistantV2Tests/AssistantV2Tests.swift b/Tests/AssistantV2Tests/AssistantV2Tests.swift index 516b372e8..8b3480c3f 100644 --- a/Tests/AssistantV2Tests/AssistantV2Tests.swift +++ b/Tests/AssistantV2Tests/AssistantV2Tests.swift @@ -238,7 +238,8 @@ class AssistantV2Tests: XCTestCase { let description3 = "Continue a conversation." let expectation3 = self.expectation(description: description3) - let messageInput = MessageInput(messageType: MessageInput.MessageType.text.rawValue, text: "I'm good, how are you?") + let messageInputOptions = MessageInputOptions(debug: false, restart: false, alternateIntents: false, returnContext: true, export: false, spelling: nil) + let messageInput = MessageInput(messageType: MessageInput.MessageType.text.rawValue, text: "I'm good, how are you?", options: messageInputOptions) assistant.message(assistantID: assistantID, sessionID: sessionID, input: messageInput, context: nil) { response, error in @@ -273,7 +274,7 @@ class AssistantV2Tests: XCTestCase { XCTAssertEqual(intents[0].intent, "General_Greetings") // verify context - XCTAssertNil(context) + XCTAssertNotNil(context) expectation3.fulfill() }