Files
Sybil-2/ios/Packages/Sybil/Sources/Sybil/SybilAPIClienting.swift

50 lines
2.1 KiB
Swift
Raw Normal View History

2026-05-02 22:18:33 -07:00
import Foundation
protocol SybilAPIClienting: Sendable {
func verifySession() async throws -> AuthSession
func listWorkspaceItems() async throws -> [WorkspaceItem]
2026-05-02 22:18:33 -07:00
func listChats() async throws -> [ChatSummary]
2026-05-06 21:53:51 -07:00
func createChat(
title: String?,
provider: Provider?,
model: String?,
messages: [CompletionRequestMessage]?
) async throws -> ChatSummary
2026-05-02 22:18:33 -07:00
func getChat(chatID: String) async throws -> ChatDetail
2026-05-28 22:22:55 -07:00
func updateChatTitle(chatID: String, title: String) async throws -> ChatSummary
2026-05-28 22:47:45 -07:00
func updateChatStar(chatID: String, starred: Bool) async throws -> ChatSummary
2026-05-02 22:18:33 -07:00
func deleteChat(chatID: String) async throws
func suggestChatTitle(chatID: String, content: String) async throws -> ChatSummary
func listSearches() async throws -> [SearchSummary]
func createSearch(title: String?, query: String?) async throws -> SearchSummary
func getSearch(searchID: String) async throws -> SearchDetail
func createChatFromSearch(searchID: String, title: String?) async throws -> ChatSummary
2026-05-28 22:47:45 -07:00
func updateSearchStar(searchID: String, starred: Bool) async throws -> SearchSummary
2026-05-02 22:18:33 -07:00
func deleteSearch(searchID: String) async throws
func listModels() async throws -> ModelCatalogResponse
2026-05-04 20:14:16 -07:00
func getActiveRuns() async throws -> ActiveRunsResponse
2026-05-02 22:18:33 -07:00
func runCompletionStream(
body: CompletionStreamRequest,
onEvent: @escaping @Sendable (CompletionStreamEvent) async -> Void
) async throws
2026-05-04 20:14:16 -07:00
func attachCompletionStream(
chatID: String,
onEvent: @escaping @Sendable (CompletionStreamEvent) async -> Void
) async throws
2026-05-02 22:18:33 -07:00
func runSearchStream(
searchID: String,
body: SearchRunRequest,
onEvent: @escaping @Sendable (SearchStreamEvent) async -> Void
) async throws
2026-05-04 20:14:16 -07:00
func attachSearchStream(
searchID: String,
onEvent: @escaping @Sendable (SearchStreamEvent) async -> Void
) async throws
2026-05-02 22:18:33 -07:00
}
2026-05-06 21:53:51 -07:00
extension SybilAPIClienting {
func createChat(title: String?) async throws -> ChatSummary {
try await createChat(title: title, provider: nil, model: nil, messages: nil)
}
}