Persist selections and compile song output
This commit is contained in:
@@ -65,15 +65,20 @@ public struct SongProjectGenerationRequest: Equatable, Sendable {
|
||||
public var context: AIRequestContext
|
||||
public var seedProject: SongProject?
|
||||
public var discussionMode: ConversationMode
|
||||
public var songGenerationContext: SongGenerationContext
|
||||
|
||||
public init(
|
||||
context: AIRequestContext,
|
||||
seedProject: SongProject? = nil,
|
||||
discussionMode: ConversationMode = .auto
|
||||
discussionMode: ConversationMode = .auto,
|
||||
songGenerationContext: SongGenerationContext? = nil
|
||||
) {
|
||||
self.context = context
|
||||
self.seedProject = seedProject
|
||||
self.discussionMode = discussionMode
|
||||
self.songGenerationContext = songGenerationContext
|
||||
?? seedProject.map(SongGenerationContext.init(project:))
|
||||
?? .empty
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,10 +101,16 @@ public struct SongProjectGenerationResult: Equatable, Sendable {
|
||||
public struct SongProjectDiscussionRequest: Equatable, Sendable {
|
||||
public var context: AIRequestContext
|
||||
public var project: SongProject
|
||||
public var songGenerationContext: SongGenerationContext
|
||||
|
||||
public init(context: AIRequestContext, project: SongProject) {
|
||||
public init(
|
||||
context: AIRequestContext,
|
||||
project: SongProject,
|
||||
songGenerationContext: SongGenerationContext? = nil
|
||||
) {
|
||||
self.context = context
|
||||
self.project = project
|
||||
self.songGenerationContext = songGenerationContext ?? SongGenerationContext(project: project)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,17 +129,20 @@ public struct LyricsRevisionRequest: Equatable, Sendable {
|
||||
public var project: SongProject
|
||||
public var sourceLyrics: Lyrics
|
||||
public var mode: LyricsRevisionMode
|
||||
public var songGenerationContext: SongGenerationContext
|
||||
|
||||
public init(
|
||||
context: AIRequestContext,
|
||||
project: SongProject,
|
||||
sourceLyrics: Lyrics,
|
||||
mode: LyricsRevisionMode
|
||||
mode: LyricsRevisionMode,
|
||||
songGenerationContext: SongGenerationContext? = nil
|
||||
) {
|
||||
self.context = context
|
||||
self.project = project
|
||||
self.sourceLyrics = sourceLyrics
|
||||
self.mode = mode
|
||||
self.songGenerationContext = songGenerationContext ?? SongGenerationContext(project: project)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,15 +168,18 @@ public struct SongProjectUpdateRequest: Equatable, Sendable {
|
||||
public var context: AIRequestContext
|
||||
public var project: SongProject
|
||||
public var allowedScopes: [SongProjectUpdateScope]
|
||||
public var songGenerationContext: SongGenerationContext
|
||||
|
||||
public init(
|
||||
context: AIRequestContext,
|
||||
project: SongProject,
|
||||
allowedScopes: [SongProjectUpdateScope]
|
||||
allowedScopes: [SongProjectUpdateScope],
|
||||
songGenerationContext: SongGenerationContext? = nil
|
||||
) {
|
||||
self.context = context
|
||||
self.project = project
|
||||
self.allowedScopes = allowedScopes
|
||||
self.songGenerationContext = songGenerationContext ?? SongGenerationContext(project: project)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user