mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-18 10:36:22 +08:00
feat: get prompt model names (#13607)
fix AI-419 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - New Features - New API to fetch available models for a prompt, returning default, optional, and pro models with human‑readable names. - Added temperature and topP settings to prompt configuration for finer control. - Refactor - When no model is chosen, the default model is used instead of auto-picking a pro model. - Model metadata across providers now includes readable names, improving listings and selection UX. - Tests - Updated test snapshots and descriptions to reflect the new default-model behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -467,9 +467,9 @@ Generated by [AVA](https://avajs.dev).
|
||||
|
||||
'gemini-2.5-flash'
|
||||
|
||||
> should pick first pro model when no requested model during active
|
||||
> should pick default model when no requested model during active
|
||||
|
||||
'gemini-2.5-pro'
|
||||
'gemini-2.5-flash'
|
||||
|
||||
> should honor requested pro model during active
|
||||
|
||||
|
||||
Binary file not shown.
@@ -2129,13 +2129,13 @@ test('should resolve model correctly based on subscription status and prompt con
|
||||
);
|
||||
}
|
||||
|
||||
// payment enabled + active: without requested -> first pro; requested pro should be honored
|
||||
// payment enabled + active: without requested -> default model; requested pro should be honored
|
||||
{
|
||||
mockStatus(SubscriptionStatus.Active);
|
||||
const model6 = await s.resolveModel(true);
|
||||
t.snapshot(
|
||||
model6,
|
||||
'should pick first pro model when no requested model during active'
|
||||
'should pick default model when no requested model during active'
|
||||
);
|
||||
|
||||
const model7 = await s.resolveModel(true, 'claude-sonnet-4@20250514');
|
||||
|
||||
Reference in New Issue
Block a user