Skip to content

Commit

Permalink
fix(hand edit): maintain MessageInputOptions parameter position
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff-arn committed Jun 4, 2020
1 parent 22640b0 commit b3fb5ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Source/AssistantV2/Models/MessageInputOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions Tests/AssistantV2Tests/AssistantV2Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -273,7 +274,7 @@ class AssistantV2Tests: XCTestCase {
XCTAssertEqual(intents[0].intent, "General_Greetings")

// verify context
XCTAssertNil(context)
XCTAssertNotNil(context)

expectation3.fulfill()
}
Expand Down

0 comments on commit b3fb5ed

Please sign in to comment.