MCPcopy
hub / github.com/di-sukharev/opencommit / generateCommitMessage

Method generateCommitMessage

src/engine/ollama.ts:34–55  ·  view source on GitHub ↗
(
    messages: Array<OpenAI.Chat.Completions.ChatCompletionMessageParam>
  )

Source from the content-addressed store, hash-verified

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}

Callers

nothing calls this directly

Calls 3

removeContentTagsFunction · 0.90
normalizeEngineErrorFunction · 0.90
postMethod · 0.80

Tested by

no test coverage detected