Skip to content

Commit c357e75

Browse files
Merge remote-tracking branch 'origin' into doc-openaichat
2 parents 3da3ae6 + 2cbda4d commit c357e75

33 files changed

+198
-30
lines changed

+llms/+internal/callAzureChatAPI.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464

6565
parameters = buildParametersCall(messages, functions, nvp);
6666

67-
[response, streamedText] = llms.internal.sendRequest(parameters,nvp.APIKey, URL, nvp.TimeOut, nvp.StreamFun);
67+
[response, streamedText] = llms.internal.sendRequestWrapper(parameters,nvp.APIKey, URL, nvp.TimeOut, nvp.StreamFun);
6868

6969
% If call errors, "choices" will not be part of response.Body.Data, instead
7070
% we get response.Body.Data.error

+llms/+internal/callOllamaChatAPI.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353

5454
parameters = buildParametersCall(model, messages, nvp);
5555

56-
[response, streamedText] = llms.internal.sendRequest(parameters,[],URL,nvp.TimeOut,nvp.StreamFun);
56+
[response, streamedText] = llms.internal.sendRequestWrapper(parameters,[],URL,nvp.TimeOut,nvp.StreamFun);
5757

5858
% If call errors, "choices" will not be part of response.Body.Data, instead
5959
% we get response.Body.Data.error

+llms/+internal/callOpenAIChatAPI.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262

6363
parameters = buildParametersCall(messages, functions, nvp);
6464

65-
[response, streamedText] = llms.internal.sendRequest(parameters,nvp.APIKey, END_POINT, nvp.TimeOut, nvp.StreamFun);
65+
[response, streamedText] = llms.internal.sendRequestWrapper(parameters,nvp.APIKey, END_POINT, nvp.TimeOut, nvp.StreamFun);
6666

6767
% If call errors, "choices" will not be part of response.Body.Data, instead
6868
% we get response.Body.Data.error

+llms/+internal/sendRequestWrapper.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
function [response, streamedText] = sendRequestWrapper(varargin)
2+
% This function is undocumented and will change in a future release
3+
4+
% A wrapper around sendRequest to have a test seam
5+
[response, streamedText] = llms.internal.sendRequest(varargin{:});

+llms/+internal/textGenerator.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,10 @@
2828
properties (Access=protected)
2929
StreamFun
3030
end
31+
32+
methods
33+
function hObj = set.StopSequences(hObj,value)
34+
hObj.StopSequences = string(value);
35+
end
36+
end
3137
end

+llms/+stream/responseStreamer.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@
8484
end
8585
this.StreamFun('');
8686
this.ResponseText = txt;
87-
else
87+
elseif isfield(json.choices,"delta") && ...
88+
isfield(json.choices.delta,"content")
8889
txt = json.choices.delta.content;
8990
this.StreamFun(txt);
9091
this.ResponseText = [this.ResponseText txt];

+llms/+utils/mustBeValidStop.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ function mustBeValidStop(value)
55
if ~isempty(value)
66
mustBeVector(value);
77
mustBeNonzeroLengthText(value);
8+
value = string(value);
89
% This restriction is set by the OpenAI API
910
if numel(value)>4
1011
error("llms:stopSequencesMustHaveMax4Elements", llms.utils.errorMessageCatalog.getMessage("llms:stopSequencesMustHaveMax4Elements"));

.github/CODEOWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Code owners, to get auto-filled reviewer lists
2+
3+
# To start with, we just assume everyone in the core team is included on all reviews
4+
* @adulai @ccreutzi @debymf @MiriamScharnke @vpapanasta

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Pull models
3131
run: |
3232
ollama pull mistral
33-
ollama pull bakllava
33+
ollama pull moondream
3434
OLLAMA_HOST=127.0.0.1:11435 ollama pull qwen2:0.5b
3535
- name: Set up MATLAB
3636
uses: matlab-actions/setup-matlab@v2

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
*.env
22
*.asv
33
*.mat
4+
!tests/recordings/*.mat
45
startup.m
56
papers_to_read.csv
67
data/*

0 commit comments

Comments
 (0)