Implement optional discussion mode
This commit is contained in:
@@ -17,6 +17,12 @@ final class ApplicationRuleInjectionTests: XCTestCase {
|
||||
context: AIRequestContext(userInstruction: "Generate.")
|
||||
)
|
||||
)
|
||||
_ = try await service.discussSongProject(
|
||||
from: SongProjectDiscussionRequest(
|
||||
context: AIRequestContext(userInstruction: "Discuss."),
|
||||
project: project
|
||||
)
|
||||
)
|
||||
_ = try await service.reviseLyrics(
|
||||
from: LyricsRevisionRequest(
|
||||
context: AIRequestContext(userInstruction: "Improve."),
|
||||
@@ -37,6 +43,7 @@ final class ApplicationRuleInjectionTests: XCTestCase {
|
||||
XCTAssertEqual(
|
||||
recordedRuleContents,
|
||||
[
|
||||
"Use private product rules.",
|
||||
"Use private product rules.",
|
||||
"Use private product rules.",
|
||||
"Use private product rules."
|
||||
@@ -90,6 +97,11 @@ private actor RecordingAIService: AIService {
|
||||
)
|
||||
}
|
||||
|
||||
func discussSongProject(from request: SongProjectDiscussionRequest) async throws -> SongProjectDiscussionResult {
|
||||
contexts.append(request.context)
|
||||
return SongProjectDiscussionResult(questions: ["Which direction should we take?"])
|
||||
}
|
||||
|
||||
func reviseLyrics(from request: LyricsRevisionRequest) async throws -> LyricsRevisionResult {
|
||||
contexts.append(request.context)
|
||||
return LyricsRevisionResult(lyrics: request.sourceLyrics)
|
||||
|
||||
Reference in New Issue
Block a user