add chat flow for search results
This commit is contained in:
@@ -96,6 +96,16 @@ actor SybilAPIClient {
|
||||
return response.search
|
||||
}
|
||||
|
||||
func createChatFromSearch(searchID: String, title: String? = nil) async throws -> ChatSummary {
|
||||
let response = try await request(
|
||||
"/v1/searches/\(searchID)/chat",
|
||||
method: "POST",
|
||||
body: AnyEncodable(SearchChatCreateBody(title: title)),
|
||||
responseType: ChatCreateResponse.self
|
||||
)
|
||||
return response.chat
|
||||
}
|
||||
|
||||
func deleteSearch(searchID: String) async throws {
|
||||
_ = try await request("/v1/searches/\(searchID)", method: "DELETE", responseType: DeleteResponse.self)
|
||||
}
|
||||
@@ -552,3 +562,7 @@ private struct SearchCreateBody: Encodable {
|
||||
var title: String?
|
||||
var query: String?
|
||||
}
|
||||
|
||||
private struct SearchChatCreateBody: Encodable {
|
||||
var title: String?
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user