Add local source ingest and podcasts

This commit is contained in:
Krishna Kumar
2026-07-02 01:11:03 -05:00
parent 4d875e12d6
commit f8693f4be0
18 changed files with 1044 additions and 31 deletions

View File

@@ -56,9 +56,13 @@ struct ClaudeService: Sendable {
// MARK: - Podcast
func generatePodcast(url: String) async throws -> String {
func generatePodcast(url: String, title: String? = nil, sourceText: String? = nil, sourceKind: String? = nil) async throws -> String {
struct Response: Decodable { let job_id: String }
let data = try await post("/v1/podcast/generate", body: ["url": url])
var body: [String: Any] = ["url": url]
if let title, !title.isEmpty { body["title"] = title }
if let sourceText, !sourceText.isEmpty { body["text"] = sourceText }
if let sourceKind, !sourceKind.isEmpty { body["source_kind"] = sourceKind }
let data = try await post("/v1/podcast/generate", body: body)
return try JSONDecoder().decode(Response.self, from: data).job_id
}