diff --git a/+llms/+internal/textGenerator.m b/+llms/+internal/textGenerator.m index f6cb167..204e516 100644 --- a/+llms/+internal/textGenerator.m +++ b/+llms/+internal/textGenerator.m @@ -28,4 +28,10 @@ properties (Access=protected) StreamFun end + + methods + function hObj = set.StopSequences(hObj,value) + hObj.StopSequences = string(value); + end + end end diff --git a/+llms/+utils/mustBeValidStop.m b/+llms/+utils/mustBeValidStop.m index f3862c7..7301a2c 100644 --- a/+llms/+utils/mustBeValidStop.m +++ b/+llms/+utils/mustBeValidStop.m @@ -5,6 +5,7 @@ function mustBeValidStop(value) if ~isempty(value) mustBeVector(value); mustBeNonzeroLengthText(value); + value = string(value); % This restriction is set by the OpenAI API if numel(value)>4 error("llms:stopSequencesMustHaveMax4Elements", llms.utils.errorMessageCatalog.getMessage("llms:stopSequencesMustHaveMax4Elements")); diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..cf5aa55 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,4 @@ +# Code owners, to get auto-filled reviewer lists + +# To start with, we just assume everyone in the core team is included on all reviews +* @adulai @ccreutzi @debymf @MiriamScharnke @vpapanasta \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7babcc..6be9f48 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,7 @@ jobs: - name: Pull models run: | ollama pull mistral - ollama pull bakllava + ollama pull moondream OLLAMA_HOST=127.0.0.1:11435 ollama pull qwen2:0.5b - name: Set up MATLAB uses: matlab-actions/setup-matlab@v2 diff --git a/tests/tollamaChat.m b/tests/tollamaChat.m index 1040c4a..52d1376 100644 --- a/tests/tollamaChat.m +++ b/tests/tollamaChat.m @@ -99,7 +99,7 @@ function seedFixesResult(testCase) end function generateWithImages(testCase) - chat = ollamaChat("bakllava"); + chat = ollamaChat("moondream"); image_path = "peppers.png"; emptyMessages = messageHistory; messages = addUserMessageWithImages(emptyMessages,"What is in the image?",image_path); diff --git a/tests/topenAIChat.m b/tests/topenAIChat.m index e06db55..b156b18 100644 --- a/tests/topenAIChat.m +++ b/tests/topenAIChat.m @@ -388,7 +388,6 @@ function keyNotFound(testCase) function validConstructorInput = iGetValidConstructorInput() % while it is valid to provide the key via an environment variable, % this test set does not use that, for easier setup -validFunction = openAIFunction("funName"); validConstructorInput = struct( ... "JustKey", struct( ... "Input",{{"APIKey","this-is-not-a-real-key"}}, ... @@ -396,7 +395,7 @@ function keyNotFound(testCase) "VerifyProperties", struct( ... "Temperature", {1}, ... "TopP", {1}, ... - "StopSequences", {{}}, ... + "StopSequences", {string([])}, ... "PresencePenalty", {0}, ... "FrequencyPenalty", {0}, ... "TimeOut", {10}, ... @@ -412,7 +411,7 @@ function keyNotFound(testCase) "VerifyProperties", struct( ... "Temperature", {1}, ... "TopP", {1}, ... - "StopSequences", {{}}, ... + "StopSequences", {string([])}, ... "PresencePenalty", {0}, ... "FrequencyPenalty", {0}, ... "TimeOut", {10}, ... @@ -428,7 +427,7 @@ function keyNotFound(testCase) "VerifyProperties", struct( ... "Temperature", {2}, ... "TopP", {1}, ... - "StopSequences", {{}}, ... + "StopSequences", {string([])}, ... "PresencePenalty", {0}, ... "FrequencyPenalty", {0}, ... "TimeOut", {10}, ... @@ -444,7 +443,7 @@ function keyNotFound(testCase) "VerifyProperties", struct( ... "Temperature", {1}, ... "TopP", {0.2}, ... - "StopSequences", {{}}, ... + "StopSequences", {string([])}, ... "PresencePenalty", {0}, ... "FrequencyPenalty", {0}, ... "TimeOut", {10}, ... @@ -470,13 +469,29 @@ function keyNotFound(testCase) "ResponseFormat", {"text"} ... ) ... ), ... + "StopSequencesCharVector", struct( ... + "Input",{{"APIKey","this-is-not-a-real-key","StopSequences",'supercalifragilistic'}}, ... + "ExpectedWarning", '', ... + "VerifyProperties", struct( ... + "Temperature", {1}, ... + "TopP", {1}, ... + "StopSequences", {"supercalifragilistic"}, ... + "PresencePenalty", {0}, ... + "FrequencyPenalty", {0}, ... + "TimeOut", {10}, ... + "FunctionNames", {[]}, ... + "ModelName", {"gpt-4o-mini"}, ... + "SystemPrompt", {[]}, ... + "ResponseFormat", {"text"} ... + ) ... + ), ... "PresencePenalty", struct( ... "Input",{{"APIKey","this-is-not-a-real-key","PresencePenalty",0.1}}, ... "ExpectedWarning", '', ... "VerifyProperties", struct( ... "Temperature", {1}, ... "TopP", {1}, ... - "StopSequences", {{}}, ... + "StopSequences", {string([])}, ... "PresencePenalty", {0.1}, ... "FrequencyPenalty", {0}, ... "TimeOut", {10}, ... @@ -492,7 +507,7 @@ function keyNotFound(testCase) "VerifyProperties", struct( ... "Temperature", {1}, ... "TopP", {1}, ... - "StopSequences", {{}}, ... + "StopSequences", {string([])}, ... "PresencePenalty", {0}, ... "FrequencyPenalty", {0.1}, ... "TimeOut", {10}, ... @@ -508,7 +523,7 @@ function keyNotFound(testCase) "VerifyProperties", struct( ... "Temperature", {1}, ... "TopP", {1}, ... - "StopSequences", {{}}, ... + "StopSequences", {string([])}, ... "PresencePenalty", {0}, ... "FrequencyPenalty", {0}, ... "TimeOut", {0.1}, ... @@ -524,7 +539,7 @@ function keyNotFound(testCase) "VerifyProperties", struct( ... "Temperature", {1}, ... "TopP", {1}, ... - "StopSequences", {{}}, ... + "StopSequences", {string([])}, ... "PresencePenalty", {0}, ... "FrequencyPenalty", {0}, ... "TimeOut", {10}, ...