-
Notifications
You must be signed in to change notification settings - Fork 0
Review pr 2497 #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Review pr 2497 #49
Changes from all commits
66be53c
b4689a6
37ef4d2
7b9407d
898f756
80fb3bf
d799cd9
08e941e
b10358a
5b0444c
273f6d9
61702e2
51209dc
c97ddb7
031fe1a
39c0887
b19efc3
901b491
fb768bf
8bd6a2e
450b2b0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -171,7 +171,7 @@ class AiHandler @Inject constructor( | |
| AiSystemPromptType.TAGGING -> 0.4f | ||
| AiSystemPromptType.PLAYLIST, AiSystemPromptType.DAILY_MIX -> 0.6f | ||
| AiSystemPromptType.PERSONA -> 0.85f | ||
| AiSystemPromptType.GENERAL -> 0.7f | ||
| AiSystemPromptType.GENERAL, AiSystemPromptType.LYRICS -> 0.7f | ||
| } | ||
| } else temperature | ||
| } else params.temperature | ||
|
|
@@ -182,7 +182,7 @@ class AiHandler @Inject constructor( | |
| val basePersona = getBasePersona(userProvider) | ||
| val combinedSystemPrompt = promptEngine.buildPrompt(basePersona, type, context) | ||
|
|
||
| val hash = (userProvider.name + combinedSystemPrompt + prompt).sha256() | ||
| val hash = (type.name + userProvider.name + combinedSystemPrompt + prompt).sha256() | ||
|
daedaevibin marked this conversation as resolved.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚩 Cache hash key uses original provider's prompt but response may come from fallback provider In Was this helpful? React with 👍 or 👎 to provide feedback. |
||
|
|
||
| cacheDao.getCache(hash)?.let { cached -> | ||
| val age = System.currentTimeMillis() - cached.timestamp | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,7 @@ enum class AiSystemPromptType { | |
| MOOD_ANALYSIS, | ||
| PERSONA, | ||
| DAILY_MIX, | ||
| LYRICS, | ||
| GENERAL | ||
| } | ||
|
|
||
|
|
@@ -182,6 +183,16 @@ class AiSystemPromptEngine @Inject constructor() { | |
| $dailyMixPersonaPrompt | ||
| """.trimIndent() | ||
|
|
||
| AiSystemPromptType.LYRICS -> """ | ||
| <role>Song lyrics translator — you translate lyrics between languages while preserving structure.</role> | ||
| <strategy> | ||
| - Preserve ALL timestamps and line structure exactly. | ||
| - Output each original line followed by its translation on the next line. | ||
| - Never add explanations, labels, or formatting beyond the requested format. | ||
| - If the source is already in the target language, respond with: ALREADY_IN_TARGET_LANGUAGE | ||
| </strategy> | ||
| """.trimIndent() | ||
|
Comment on lines
+186
to
+194
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 Info: LYRICS prompt type lacks an <output_schema> block unlike all other AI prompt types Every other Was this helpful? React with 👍 or 👎 to provide feedback. |
||
|
|
||
| AiSystemPromptType.GENERAL -> """ | ||
| <role>PixelPlayer Assistant — a knowledgeable music companion.</role> | ||
| <strategy> | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.