MCPcopy Create free account
hub / github.com/SpartanJ/eepp / setFilter

Method setFilter

src/tools/ecode/plugins/aiassistant/chatui.cpp:104–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102 }
103
104 void setFilter( const std::string& filter ) {
105 if ( mCurFilter == filter )
106 return;
107 mCurFilter = filter;
108 mCurModels.clear();
109
110 for ( const auto& model : mModels ) {
111 if ( filter.empty() ) {
112 mCurModels.emplace_back( &model );
113 continue;
114 }
115
116 bool matchesName = String::icontains( model.name, filter );
117 bool matchesDisplayName =
118 model.displayName.has_value() && String::icontains( *model.displayName, filter );
119 bool matchesProvider = String::icontains( model.provider, filter );
120
121 if ( matchesName || matchesDisplayName || matchesProvider ) {
122 mCurModels.emplace_back( &model );
123 }
124 }
125
126 invalidate();
127 }
128
129 const std::vector<const LLMModel*>& getCurModels() const { return mCurModels; }
130

Callers 6

LLMChatUIMethod · 0.45
showChatHistoryMethod · 0.45
loadSelectAgentMethod · 0.45
showSelectAgentMethod · 0.45
loadSelectModelMethod · 0.45
showSelectModelMethod · 0.45

Calls 2

clearMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected