matlab-deep-learning / llms-with-matlab

Connect MATLAB to LLM APIs, including OpenAI® Chat Completions, Azure® OpenAI Services, and Ollama™
Other
97 stars 21 forks source link

Incorrect error message when removing message from empty messageHistory #78

Closed MiriamScharnke closed 3 weeks ago

MiriamScharnke commented 3 weeks ago

When I try to remove a message from an empty messageHistory, the error message is technically incorrect:

>> messages = messageHistory;
>> removeMessage(messages,1)
Error using messageHistory/removeMessage (line 217)
Index exceeds the number of array elements. Index
must be less than or equal to 0.