| 155 | }); |
| 156 | } |
| 157 | createModel() { |
| 158 | // Generate list of functions |
| 159 | const functions = []; |
| 160 | for (const entry of this._functions.values()) { |
| 161 | functions.push(entry.schema); |
| 162 | } |
| 163 | // Create an instance of a model |
| 164 | const modelOptions = { |
| 165 | apiKey: this._index.keys.apiKey, |
| 166 | completion_type: 'chat', |
| 167 | model: this._index.config.model, |
| 168 | temperature: this._index.config.temperature, |
| 169 | max_input_tokens: this._index.config.max_input_tokens, |
| 170 | max_tokens: this._index.config.max_tokens, |
| 171 | //logRequests: true |
| 172 | }; |
| 173 | if (functions.length > 0) { |
| 174 | modelOptions.functions = functions; |
| 175 | } |
| 176 | return new alphawave_1.OpenAIModel(modelOptions); |
| 177 | } |
| 178 | } |
| 179 | exports.Codepilot = Codepilot; |
| 180 | //# sourceMappingURL=Codepilot.js.map |