MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / getLLM

Method getLLM

src/plugins/aimanager/aimanager.cpp:54–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54AbstractLLM *AiManager::getLLM(const LLMInfo &info)
55{
56 if (d->models.contains(info)) {
57 if (info.type == LLMType::OPENAI) {
58 auto llm = new OpenAiCompatibleLLM(this);
59 llm->setModelName(info.modelName);
60 llm->setModelPath(info.modelPath);
61 if (!info.apikey.isEmpty())
62 llm->setApiKey(info.apikey);
63 return llm;
64 } else if (info.type == LLMType::ZHIPU_CODEGEEX) {
65 auto llm = new CodeGeeXLLM(this);
66 llm->setModelName(info.modelName);
67 llm->setModelPath(info.modelPath);
68 return llm;
69 }
70 }
71
72 return nullptr;
73}
74
75bool AiManager::checkModelValid(const LLMInfo &info, QString *errStr)
76{

Callers 5

initLLMMethod · 0.80
onLLMChangedMethod · 0.80
ChatManagerMethod · 0.80
initConnectionsMethod · 0.80
findModelMethod · 0.80

Calls 5

containsMethod · 0.45
setModelNameMethod · 0.45
setModelPathMethod · 0.45
isEmptyMethod · 0.45
setApiKeyMethod · 0.45

Tested by

no test coverage detected