Skip to content

Commit f86f66f

Browse files
committed
test: conversational search
1 parent 4f9d06b commit f86f66f

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

Tests/TypesenseTests/ConversationModelTests.swift

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,38 @@ final class ConversationModelTests: XCTestCase {
7878
}
7979
}
8080

81+
func testConversationSearch() async {
82+
do {
83+
let string = """
84+
{
85+
"conversation": {
86+
"answer": " context information, I' unable to suggest an is information given about specific context action as,, specific titles If a preference for particular genre length of, please that information and I' try my best to suggestions.",
87+
"conversation_history": [
88+
{
89+
"user": "can you suggest an action series"
90+
},
91+
{
92+
"assistant": " context information, I' unable to suggest an is information given about specific context action as,, specific titles If a preference for particular genre length of, please that information and I' try my best to suggestions."
93+
}
94+
],
95+
"conversation_id": "123",
96+
"query": "can you suggest an action series"
97+
},
98+
"results": [
99+
{
100+
"code": 404,
101+
"error": "Not found."
102+
}
103+
]
104+
}
105+
"""
106+
let data = string.data(using: .utf8)!
107+
let _ = try decoder.decode(MultiSearchResult<Never>.self, from: data)
108+
XCTAssertTrue(true)
109+
}catch (let error) {
110+
print(error)
111+
XCTAssertTrue(false)
112+
}
113+
}
114+
81115
}

0 commit comments

Comments
 (0)