MCPcopy Create free account
hub / github.com/allocnode/oh-my-sage / createModel

Function createModel

src/server/ai/model.ts:25–34  ·  view source on GitHub ↗
(config: ModelConfig)

Source from the content-addressed store, hash-verified

23 * 创建模型实例
24 */
25export function createModel(config: ModelConfig) {
26 if (!config.baseURL) throw new Error('缺少 API Base URL 配置');
27 if (!config.apiKey) throw new Error('缺少 API Key 配置');
28 if (!config.model) throw new Error('缺少模型名称配置');
29
30 return createOpenAI({
31 apiKey: config.apiKey,
32 baseURL: config.baseURL,
33 })(config.model);
34}
35
36/**
37 * 从环境变量读取模型配置

Callers 2

compressHistoryMethod · 0.90
runMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected