mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-04 03:40:33 +08:00
feat(aiCore): add enableUrlContext capability and new support function
- Enhanced the buildStreamTextParams function to include enableUrlContext in the capabilities object, improving the parameter set for AI interactions. - Introduced a new isSupportedFlexServiceTier function to streamline model support checks, enhancing code clarity and maintainability.
This commit is contained in:
parent
6c093f72d8
commit
02f8e7a857
@ -243,7 +243,12 @@ export async function buildStreamTextParams(
|
|||||||
): Promise<{
|
): Promise<{
|
||||||
params: StreamTextParams
|
params: StreamTextParams
|
||||||
modelId: string
|
modelId: string
|
||||||
capabilities: { enableReasoning: boolean; enableWebSearch: boolean; enableGenerateImage: boolean }
|
capabilities: {
|
||||||
|
enableReasoning: boolean
|
||||||
|
enableWebSearch: boolean
|
||||||
|
enableGenerateImage: boolean
|
||||||
|
enableUrlContext: boolean
|
||||||
|
}
|
||||||
}> {
|
}> {
|
||||||
const { mcpTools } = options
|
const { mcpTools } = options
|
||||||
|
|
||||||
@ -300,7 +305,11 @@ export async function buildStreamTextParams(
|
|||||||
params.system = assistant.prompt
|
params.system = assistant.prompt
|
||||||
}
|
}
|
||||||
|
|
||||||
return { params, modelId: model.id, capabilities: { enableReasoning, enableWebSearch, enableGenerateImage } }
|
return {
|
||||||
|
params,
|
||||||
|
modelId: model.id,
|
||||||
|
capabilities: { enableReasoning, enableWebSearch, enableGenerateImage, enableUrlContext }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -2508,6 +2508,9 @@ export function isSupportFlexServiceTierModel(model: Model): boolean {
|
|||||||
(modelId.includes('o3') && !modelId.includes('o3-mini')) || modelId.includes('o4-mini') || modelId.includes('gpt-5')
|
(modelId.includes('o3') && !modelId.includes('o3-mini')) || modelId.includes('o4-mini') || modelId.includes('gpt-5')
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
export function isSupportedFlexServiceTier(model: Model): boolean {
|
||||||
|
return isSupportFlexServiceTierModel(model)
|
||||||
|
}
|
||||||
|
|
||||||
export function isSupportVerbosityModel(model: Model): boolean {
|
export function isSupportVerbosityModel(model: Model): boolean {
|
||||||
const modelId = getLowerBaseModelName(model.id)
|
const modelId = getLowerBaseModelName(model.id)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user