|
64 | 64 | % Copyright 2024 The MathWorks, Inc. |
65 | 65 |
|
66 | 66 | properties |
67 | | - Model (1,1) string |
68 | | - TopK (1,1) {mustBeReal,mustBePositive} = Inf |
| 67 | + Model (1,1) string |
| 68 | + Endpoint (1,1) string |
| 69 | + TopK (1,1) {mustBeReal,mustBePositive} = Inf |
69 | 70 | TailFreeSamplingZ (1,1) {mustBeReal} = 1 |
70 | 71 | end |
71 | 72 |
|
|
82 | 83 | nvp.TimeOut (1,1) {mustBeReal,mustBePositive} = 120 |
83 | 84 | nvp.TailFreeSamplingZ (1,1) {mustBeReal} = 1 |
84 | 85 | nvp.StreamFun (1,1) {mustBeA(nvp.StreamFun,'function_handle')} |
| 86 | + nvp.Endpoint (1,1) string = "127.0.0.1:11434" |
85 | 87 | end |
86 | 88 |
|
87 | 89 | if isfield(nvp,"StreamFun") |
|
105 | 107 | this.TailFreeSamplingZ = nvp.TailFreeSamplingZ; |
106 | 108 | this.StopSequences = nvp.StopSequences; |
107 | 109 | this.TimeOut = nvp.TimeOut; |
| 110 | + this.Endpoint = nvp.Endpoint; |
108 | 111 | end |
109 | 112 |
|
110 | 113 | function [text, message, response] = generate(this, messages, nvp) |
|
147 | 150 | TailFreeSamplingZ=this.TailFreeSamplingZ,... |
148 | 151 | StopSequences=this.StopSequences, MaxNumTokens=nvp.MaxNumTokens, ... |
149 | 152 | ResponseFormat=this.ResponseFormat,Seed=nvp.Seed, ... |
150 | | - TimeOut=this.TimeOut, StreamFun=this.StreamFun); |
| 153 | + TimeOut=this.TimeOut, StreamFun=this.StreamFun, ... |
| 154 | + Endpoint=this.Endpoint); |
151 | 155 |
|
152 | 156 | if isfield(response.Body.Data,"error") |
153 | 157 | err = response.Body.Data.error; |
|
0 commit comments