Implement optional discussion mode
This commit is contained in:
@@ -2,10 +2,21 @@ import Foundation
|
||||
|
||||
public protocol AIService: Sendable {
|
||||
func generateSongProject(from request: SongProjectGenerationRequest) async throws -> SongProjectGenerationResult
|
||||
func discussSongProject(from request: SongProjectDiscussionRequest) async throws -> SongProjectDiscussionResult
|
||||
func reviseLyrics(from request: LyricsRevisionRequest) async throws -> LyricsRevisionResult
|
||||
func proposeProjectUpdate(from request: SongProjectUpdateRequest) async throws -> SongProjectUpdateResult
|
||||
}
|
||||
|
||||
public extension AIService {
|
||||
func discussSongProject(from request: SongProjectDiscussionRequest) async throws -> SongProjectDiscussionResult {
|
||||
throw AIServiceCapabilityError.discussionNotSupported
|
||||
}
|
||||
}
|
||||
|
||||
public enum AIServiceCapabilityError: Error, Equatable, Sendable {
|
||||
case discussionNotSupported
|
||||
}
|
||||
|
||||
public struct AIConversationMessage: Equatable, Identifiable, Sendable {
|
||||
public let id: String
|
||||
public var role: AIConversationRole
|
||||
@@ -82,6 +93,26 @@ public struct SongProjectGenerationResult: Equatable, Sendable {
|
||||
}
|
||||
}
|
||||
|
||||
public struct SongProjectDiscussionRequest: Equatable, Sendable {
|
||||
public var context: AIRequestContext
|
||||
public var project: SongProject
|
||||
|
||||
public init(context: AIRequestContext, project: SongProject) {
|
||||
self.context = context
|
||||
self.project = project
|
||||
}
|
||||
}
|
||||
|
||||
public struct SongProjectDiscussionResult: Equatable, Sendable {
|
||||
public var questions: [String]
|
||||
public var notes: [String]
|
||||
|
||||
public init(questions: [String], notes: [String] = []) {
|
||||
self.questions = questions
|
||||
self.notes = notes
|
||||
}
|
||||
}
|
||||
|
||||
public struct LyricsRevisionRequest: Equatable, Sendable {
|
||||
public var context: AIRequestContext
|
||||
public var project: SongProject
|
||||
|
||||
Reference in New Issue
Block a user