From d24fa0031eb093509658a0f4efa6cbb0c36e337d Mon Sep 17 00:00:00 2001 From: Miriam Scharnke Date: Thu, 25 Jul 2024 15:37:43 +0100 Subject: [PATCH 1/4] Text only edits to error message catalog (doc review) --- +llms/+utils/errorMessageCatalog.m | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/+llms/+utils/errorMessageCatalog.m b/+llms/+utils/errorMessageCatalog.m index 36fef5e..f33fd3e 100644 --- a/+llms/+utils/errorMessageCatalog.m +++ b/+llms/+utils/errorMessageCatalog.m @@ -41,22 +41,22 @@ catalog("llms:mustBeAssistantWithIdAndFunction") = "Field 'tool_call' must be a struct with fields 'id' and 'function'."; catalog("llms:mustBeAssistantWithNameAndArguments") = "Field 'function' must be a struct with fields 'name' and 'arguments'."; catalog("llms:assistantMustHaveTextNameAndArguments") = "Fields 'name' and 'arguments' must be text with one or more characters."; -catalog("llms:mustBeValidIndex") = "Index exceeds the number of array elements. Index must be less than or equal to ({1})."; -catalog("llms:stopSequencesMustHaveMax4Elements") = "Number of elements must not be larger than 4."; +catalog("llms:mustBeValidIndex") = "Index exceeds the number of array elements. Index must be less than or equal to {1}."; +catalog("llms:stopSequencesMustHaveMax4Elements") = "Number of stop sequences must be less than or equal to 4."; catalog("llms:endpointMustBeSpecified") = "Unable to find endpoint. Either set environment variable AZURE_OPENAI_ENDPOINT or specify name-value argument ""Endpoint""."; catalog("llms:deploymentMustBeSpecified") = "Unable to find deployment name. Either set environment variable AZURE_OPENAI_DEPLOYMENT or specify name-value argument ""Deployment""."; catalog("llms:keyMustBeSpecified") = "Unable to find API key. Either set environment variable {1} or specify name-value argument ""APIKey""."; -catalog("llms:mustHaveMessages") = "Value must contain at least one message in Messages."; +catalog("llms:mustHaveMessages") = "Message must not be empty."; catalog("llms:mustSetFunctionsForCall") = "When no functions are defined, ToolChoice must not be specified."; -catalog("llms:mustBeMessagesOrTxt") = "Messages must be text with one or more characters or a messageHistory object."; -catalog("llms:invalidOptionAndValueForModel") = "'{1}' with value '{2}' is not supported for ModelName '{3}'"; -catalog("llms:invalidOptionForModel") = "{1} is not supported for ModelName '{2}'"; -catalog("llms:invalidContentTypeForModel") = "{1} is not supported for ModelName '{2}'"; -catalog("llms:functionNotAvailableForModel") = "This function is not supported for ModelName '{1}'"; -catalog("llms:promptLimitCharacter") = "Prompt must have a maximum length of {1} characters for ModelName '{2}'"; -catalog("llms:pngExpected") = "Argument must be a PNG image."; +catalog("llms:mustBeMessagesOrTxt") = "Message must be nonempty string, character array, or messageHistory object."; +catalog("llms:invalidOptionAndValueForModel") = "'{1}' with value '{2}' is not supported for model ""{3}""."; +catalog("llms:invalidOptionForModel") = "Invalid argument name {1} for model ""{2}""."; +catalog("llms:invalidContentTypeForModel") = "{1} is not supported for model ""{2}""."; +catalog("llms:functionNotAvailableForModel") = "This function is not supported for model ""{1}""."; +catalog("llms:promptLimitCharacter") = "Prompt must contain at most {1} characters for model ""{2}""."; +catalog("llms:pngExpected") = "Image must be a PNG file (*.png)."; catalog("llms:warningJsonInstruction") = "When using JSON mode, you must also prompt the model to produce JSON yourself via a system or user message."; -catalog("llms:apiReturnedError") = "Server error: ""{1}"""; +catalog("llms:apiReturnedError") = "Server returned error indicating: ""{1}"""; catalog("llms:dimensionsMustBeSmallerThan") = "Dimensions must be less than or equal to {1}."; catalog("llms:stream:responseStreamer:InvalidInput") = "Input does not have the expected json format, got ""{1}""."; end From 7bed93dcc733dacc92eb15decaca154e298ef547 Mon Sep 17 00:00:00 2001 From: MiriamScharnke Date: Fri, 26 Jul 2024 10:21:33 +0100 Subject: [PATCH 2/4] Update +llms/+utils/errorMessageCatalog.m Co-authored-by: Christopher Creutzig <89011131+ccreutzi@users.noreply.github.com> --- +llms/+utils/errorMessageCatalog.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/+llms/+utils/errorMessageCatalog.m b/+llms/+utils/errorMessageCatalog.m index f33fd3e..5b4d6a9 100644 --- a/+llms/+utils/errorMessageCatalog.m +++ b/+llms/+utils/errorMessageCatalog.m @@ -46,7 +46,7 @@ catalog("llms:endpointMustBeSpecified") = "Unable to find endpoint. Either set environment variable AZURE_OPENAI_ENDPOINT or specify name-value argument ""Endpoint""."; catalog("llms:deploymentMustBeSpecified") = "Unable to find deployment name. Either set environment variable AZURE_OPENAI_DEPLOYMENT or specify name-value argument ""Deployment""."; catalog("llms:keyMustBeSpecified") = "Unable to find API key. Either set environment variable {1} or specify name-value argument ""APIKey""."; -catalog("llms:mustHaveMessages") = "Message must not be empty."; +catalog("llms:mustHaveMessages") = "Message history must not be empty."; catalog("llms:mustSetFunctionsForCall") = "When no functions are defined, ToolChoice must not be specified."; catalog("llms:mustBeMessagesOrTxt") = "Message must be nonempty string, character array, or messageHistory object."; catalog("llms:invalidOptionAndValueForModel") = "'{1}' with value '{2}' is not supported for model ""{3}""."; From 83eff3abdaaf896c081f0a53b2feb690b1e512bd Mon Sep 17 00:00:00 2001 From: MiriamScharnke Date: Fri, 26 Jul 2024 10:21:52 +0100 Subject: [PATCH 3/4] Update +llms/+utils/errorMessageCatalog.m Co-authored-by: Christopher Creutzig <89011131+ccreutzi@users.noreply.github.com> --- +llms/+utils/errorMessageCatalog.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/+llms/+utils/errorMessageCatalog.m b/+llms/+utils/errorMessageCatalog.m index 5b4d6a9..fc1a7fc 100644 --- a/+llms/+utils/errorMessageCatalog.m +++ b/+llms/+utils/errorMessageCatalog.m @@ -52,7 +52,7 @@ catalog("llms:invalidOptionAndValueForModel") = "'{1}' with value '{2}' is not supported for model ""{3}""."; catalog("llms:invalidOptionForModel") = "Invalid argument name {1} for model ""{2}""."; catalog("llms:invalidContentTypeForModel") = "{1} is not supported for model ""{2}""."; -catalog("llms:functionNotAvailableForModel") = "This function is not supported for model ""{1}""."; +catalog("llms:functionNotAvailableForModel") = "Image editing is not supported for model ""{1}""."; catalog("llms:promptLimitCharacter") = "Prompt must contain at most {1} characters for model ""{2}""."; catalog("llms:pngExpected") = "Image must be a PNG file (*.png)."; catalog("llms:warningJsonInstruction") = "When using JSON mode, you must also prompt the model to produce JSON yourself via a system or user message."; From 1ed0f7cb20ba96e013d794fd879799c057aa651a Mon Sep 17 00:00:00 2001 From: MiriamScharnke Date: Tue, 30 Jul 2024 10:22:20 +0100 Subject: [PATCH 4/4] Apply suggestions from code review Co-authored-by: Deborah Ferreira --- +llms/+utils/errorMessageCatalog.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/+llms/+utils/errorMessageCatalog.m b/+llms/+utils/errorMessageCatalog.m index fc1a7fc..5a9be78 100644 --- a/+llms/+utils/errorMessageCatalog.m +++ b/+llms/+utils/errorMessageCatalog.m @@ -48,7 +48,7 @@ catalog("llms:keyMustBeSpecified") = "Unable to find API key. Either set environment variable {1} or specify name-value argument ""APIKey""."; catalog("llms:mustHaveMessages") = "Message history must not be empty."; catalog("llms:mustSetFunctionsForCall") = "When no functions are defined, ToolChoice must not be specified."; -catalog("llms:mustBeMessagesOrTxt") = "Message must be nonempty string, character array, or messageHistory object."; +catalog("llms:mustBeMessagesOrTxt") = "Message must be nonempty string, character array, cell array of character vectors, or messageHistory object."; catalog("llms:invalidOptionAndValueForModel") = "'{1}' with value '{2}' is not supported for model ""{3}""."; catalog("llms:invalidOptionForModel") = "Invalid argument name {1} for model ""{2}""."; catalog("llms:invalidContentTypeForModel") = "{1} is not supported for model ""{2}"".";