diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e5f5348..c10bcf4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,5 @@ name: Run MATLAB Tests on GitHub-Hosted Runner -on: [push] +on: push jobs: test: name: Run MATLAB Tests and Generate Artifacts diff --git a/openAIChat.m b/openAIChat.m index 7d73c75..1e81e3b 100644 --- a/openAIChat.m +++ b/openAIChat.m @@ -119,6 +119,22 @@ [this.FunctionsStruct, this.FunctionNames] = functionAsStruct(nvp.Tools); end + if isempty(nvp.Tools) + this.Tools = []; + this.FunctionsStruct = []; + this.FunctionNames = []; + else + this.Tools = nvp.Tools; + [this.FunctionsStruct, this.FunctionNames] = functionAsStruct(nvp.Tools); + end + + if ~isempty(systemPrompt) + systemPrompt = string(systemPrompt); + if systemPrompt ~= "" + this.SystemPrompt = {struct("role", "system", "content", systemPrompt)}; + end + end + if ~isempty(systemPrompt) systemPrompt = string(systemPrompt); if systemPrompt ~= ""