ios: quick question UI

This commit is contained in:
2026-05-06 21:53:51 -07:00
parent 0c9b4d1ed3
commit bd0200ac98
12 changed files with 1007 additions and 19 deletions

View File

@@ -49,11 +49,16 @@ actor SybilAPIClient: SybilAPIClienting {
return response.chats
}
func createChat(title: String? = nil) async throws -> ChatSummary {
func createChat(
title: String? = nil,
provider: Provider? = nil,
model: String? = nil,
messages: [CompletionRequestMessage]? = nil
) async throws -> ChatSummary {
let response = try await request(
"/v1/chats",
method: "POST",
body: AnyEncodable(ChatCreateBody(title: title)),
body: AnyEncodable(ChatCreateBody(title: title, provider: provider, model: model, messages: messages)),
responseType: ChatCreateResponse.self
)
return response.chat
@@ -617,6 +622,7 @@ actor SybilAPIClient: SybilAPIClienting {
struct CompletionStreamRequest: Codable, Sendable {
var chatId: String?
var persist: Bool? = nil
var provider: Provider
var model: String
var messages: [CompletionRequestMessage]
@@ -624,6 +630,9 @@ struct CompletionStreamRequest: Codable, Sendable {
private struct ChatCreateBody: Encodable {
var title: String?
var provider: Provider?
var model: String?
var messages: [CompletionRequestMessage]?
}
private struct SearchCreateBody: Encodable {