Files
music-assistant/Sources/MusicAssistantCore/Services/AI/StructuredAIResponseSchema.swift
T

37 lines
1.1 KiB
Swift

import Foundation
public struct StructuredSongProjectUpdateResponse: Codable, Equatable, Sendable {
public static let schemaName = "song_project_update_response"
public var project: SongProjectSnapshot
public var changedScopes: [SongProjectUpdateScope]
public var notes: [String]
public var followUpQuestions: [String]
public init(
project: SongProjectSnapshot,
changedScopes: [SongProjectUpdateScope] = [],
notes: [String] = [],
followUpQuestions: [String] = []
) {
self.project = project
self.changedScopes = changedScopes
self.notes = notes
self.followUpQuestions = followUpQuestions
}
public func makeUpdateResult(
updating existingProject: SongProject,
updatedAt: Date = Date()
) -> SongProjectUpdateResult {
SongProjectAIUpdateMerger().apply(
snapshot: project,
changedScopes: changedScopes,
notes: notes,
followUpQuestions: followUpQuestions,
to: existingProject,
updatedAt: updatedAt
)
}
}