File tree Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Original file line number Diff line number Diff line change 151
151
TimeOut= this .TimeOut , StreamFun= this .StreamFun );
152
152
end
153
153
end
154
- end
155
154
156
- function mustBeNonzeroLengthTextScalar(content )
157
- mustBeNonzeroLengthText(content )
158
- mustBeTextScalar(content )
155
+ methods (Static )
156
+ function mdls = models
157
+ % ollamaChat.models - return models available on ollama server
158
+ % MDLS = ollamaChat.models returns a string vector MDLS
159
+ % listing the models available on the local ollama server.
160
+ %
161
+ % These names can be used in the ollamaChat constructor.
162
+ % For names with a colon, such as "phi:latest", it is
163
+ % possible to only use the part before the colon, i.e.,
164
+ % "phi".
165
+ endpoint = " http://localhost:11434/api/tags" ;
166
+ response = webread(endpoint );
167
+ mdls = string({response .models .name }).' ;
168
+ end
169
+ end
159
170
end
160
171
161
172
function mustBeValidMsgs(value )
Original file line number Diff line number Diff line change @@ -100,6 +100,14 @@ function assignValueToProperty(property, value)
100
100
101
101
testCase .verifyWarningFree(@() assignValueToProperty(ValidValuesSetters .Property ,ValidValuesSetters .Value ));
102
102
end
103
+
104
+ function queryModels(testCase )
105
+ % our test setup has at least mistral loaded
106
+ models = ollamaChat .models ;
107
+ testCase .verifyClass(models ," string" );
108
+ testCase .verifyThat(models , ...
109
+ matlab .unittest .constraints .IsSupersetOf(" mistral:latest" ));
110
+ end
103
111
end
104
112
end
105
113
You can’t perform that action at this time.
0 commit comments