add chat flow for search results

This commit is contained in:
2026-05-02 16:48:01 -07:00
parent fa429dcbb3
commit dc9336acf9
9 changed files with 322 additions and 28 deletions

View File

@@ -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?
}