(
messages: Array<OpenAI.Chat.Completions.ChatCompletionMessageParam>
)
| 32 | } |
| 33 | |
| 34 | async generateCommitMessage( |
| 35 | messages: Array<OpenAI.Chat.Completions.ChatCompletionMessageParam> |
| 36 | ): Promise<string | undefined> { |
| 37 | const params: Record<string, any> = { |
| 38 | model: this.config.model ?? 'mistral', |
| 39 | messages, |
| 40 | options: { temperature: 0, top_p: 0.1 }, |
| 41 | stream: false |
| 42 | }; |
| 43 | if (typeof this.config.ollamaThink === 'boolean') { |
| 44 | params.think = this.config.ollamaThink; |
| 45 | } |
| 46 | try { |
| 47 | const response = await this.client.post(this.chatUrl, params); |
| 48 | |
| 49 | const { message } = response.data; |
| 50 | let content = message?.content; |
| 51 | return removeContentTags(content, 'think'); |
| 52 | } catch (error) { |
| 53 | throw normalizeEngineError(error, 'ollama', this.config.model); |
| 54 | } |
| 55 | } |
| 56 | } |
nothing calls this directly
no test coverage detected