feat(openai): add getModelSetup() and typed provider options for OpenAI reasoning settings
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import * as plugins from './plugins.js';
|
||||
import type { ISmartAiOptions, LanguageModelV3 } from './smartai.interfaces.js';
|
||||
import type { ISmartAiModelSetup, ISmartAiOptions, LanguageModelV3 } from './smartai.interfaces.js';
|
||||
import { createOllamaModel } from './smartai.provider.ollama.js';
|
||||
import { createAnthropicCachingMiddleware } from './smartai.middleware.anthropic.js';
|
||||
|
||||
@@ -49,3 +49,11 @@ export function getModel(options: ISmartAiOptions): LanguageModelV3 {
|
||||
throw new Error(`Unknown provider: ${(options as ISmartAiOptions).provider}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the model plus request-time providerOptions for AI SDK calls.
|
||||
*/
|
||||
export function getModelSetup(options: ISmartAiOptions): ISmartAiModelSetup {
|
||||
const model = getModel(options);
|
||||
return options.providerOptions ? { model, providerOptions: options.providerOptions } : { model };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user