feat: enhance provider settings and model configuration

- Updated `ModelConfig` to include a `mode` property for better differentiation between 'chat' and 'responses'.
- Modified `createBaseModel` to conditionally set the provider based on the new `mode` property in `providerSettings`.
- Refactored `RuntimeExecutor` to utilize the updated `ModelConfig` for improved type safety and clarity in provider settings.
- Adjusted imports in `executor.ts` and `types.ts` to align with the new model configuration structure.
This commit is contained in:
lizhixuan
2025-07-12 11:31:06 +08:00
parent 3ab904e789
commit 16e0154200
5 changed files with 19 additions and 10 deletions
+5 -3
View File
@@ -71,14 +71,16 @@ function providerToAiSdkConfig(actualProvider: Provider): {
const openaiResponseOptions =
actualProviderId === 'openai'
? {
compatibility: 'strict'
mode: 'response'
}
: aiSdkProviderId === 'openai'
? {
compatibility: 'compatible'
mode: 'chat'
}
: undefined
console.log('openaiResponseOptions', openaiResponseOptions)
console.log('actualProvider', actualProvider)
console.log('aiSdkProviderId', aiSdkProviderId)
if (AiCore.isSupported(aiSdkProviderId) && aiSdkProviderId !== 'openai-compatible') {
const options = ProviderConfigFactory.fromProvider(
aiSdkProviderId,