Skip to content

Commit

Permalink
test: conversational search
Browse files Browse the repository at this point in the history
  • Loading branch information
phiHero committed Nov 5, 2024
1 parent 4f9d06b commit f86f66f
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Tests/TypesenseTests/ConversationModelTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,38 @@ final class ConversationModelTests: XCTestCase {
}
}

func testConversationSearch() async {
do {
let string = """
{
"conversation": {
"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.",
"conversation_history": [
{
"user": "can you suggest an action series"
},
{
"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."
}
],
"conversation_id": "123",
"query": "can you suggest an action series"
},
"results": [
{
"code": 404,
"error": "Not found."
}
]
}
"""
let data = string.data(using: .utf8)!
let _ = try decoder.decode(MultiSearchResult<Never>.self, from: data)
XCTAssertTrue(true)
}catch (let error) {
print(error)
XCTAssertTrue(false)
}
}

}

0 comments on commit f86f66f

Please sign in to comment.