mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-25 10:22:55 +08:00
chore(server): update config naming (#13419)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Updated scenario names and options for Copilot, including new and renamed scenarios such as "audio_transcribing," "complex_text_generation," "quick_decision_making," "quick_text_generation," and "polish_and_summarize." * Enhanced support for customizing and overriding default model assignments in Copilot scenarios. * **Bug Fixes** * Improved consistency and clarity in scenario configuration and prompt selection. * **Documentation** * Updated descriptions in configuration interfaces to better explain the ability to use custom models and override defaults. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -45,10 +45,11 @@ export class PromptService implements OnApplicationBootstrap {
|
||||
}
|
||||
|
||||
protected async setup(scenarios?: CopilotPromptScenario) {
|
||||
if (!!scenarios && scenarios.enabled && scenarios.scenarios) {
|
||||
if (!!scenarios && scenarios.override_enabled && scenarios.scenarios) {
|
||||
this.logger.log('Updating prompts based on scenarios...');
|
||||
for (const [scenario, model] of Object.entries(scenarios.scenarios)) {
|
||||
const promptNames = Scenario[scenario];
|
||||
const promptNames = Scenario[scenario as keyof typeof Scenario] || [];
|
||||
if (!promptNames.length) continue;
|
||||
for (const name of promptNames) {
|
||||
const prompt = prompts.find(p => p.name === name);
|
||||
if (prompt && model) {
|
||||
|
||||
Reference in New Issue
Block a user