MCPcopy Create free account
hub / github.com/experdot/pointer / getConfigsWithOptions

Function getConfigsWithOptions

src/renderer/src/services/titleService.ts:100–117  ·  view source on GitHub ↗

* 获取指定的配置(或使用默认配置)

(
  llmId?: string,
  modelConfigId?: string
)

Source from the content-addressed store, hash-verified

98 * 获取指定的配置(或使用默认配置)
99 */
100function getConfigsWithOptions(
101 llmId?: string,
102 modelConfigId?: string
103): { llmConfig: LLMConfig | null; modelConfig: ModelConfig | null } {
104 const settings = stores.settings.settings
105 if (!settings) {
106 return { llmConfig: null, modelConfig: null }
107 }
108
109 // 优先使用传入的 ID,否则使用默认 ID
110 const targetLlmId = llmId || settings.defaultLLMId
111 const targetModelConfigId = modelConfigId || settings.defaultModelConfigId
112
113 const llmConfig = settings.llmConfigs.items.find((c) => c.id === targetLlmId) || null
114 const modelConfig = settings.modelConfigs.items.find((c) => c.id === targetModelConfigId) || null
115
116 return { llmConfig, modelConfig }
117}
118
119/**
120 * 构建带额外要求的 Prompt

Calls

no outgoing calls

Tested by

no test coverage detected