json: cannot unmarshal object into Go struct field
- Dominant language
- Go
- Stars
- 1.5k
- Forks
- 133
- Avg merge
- 12m
- Merged PRs (30d)
- 1
Description
# Environment
codegpt version: 0.14.2 (commit: fd5758c)
Model: [Gemma 2](https://huggingface.co/bartowski/gemma-2-2b-it-GGUF/resolve/main/gemma-2-2b-it-Q6_K.gguf) (via local KoboldCpp 1.72 instance)
I’ve configured codegpt to use a local KoboldCpp instance:
```bash
codegpt config set openai.base_url http://localhost:5001/v1
codegpt config set openai.timeout 1m
```
# Issue Description
The configured koboldcpp endpoint is designed to be compatible with the OpenAI API format, see https://github.com/LostRuins/koboldcpp#Notes. Given this API compatibility, `codegpt review` operates without throwing errors (although the output quality depends on the specific model used). However, `codegpt commit` encounters a persistent issue, resulting in the following error:
```bash
❯ codegpt commit
Summarize the commit message use gpt-3.5-turbo model
We are trying to summarize a git diff
PromptTokens: 100, CompletionTokens: 100, TotalTokens: 200
We are trying to summarize a title for pull request
PromptTokens: 100, CompletionTokens: 100, TotalTokens: 200
We are trying to get conventional commit prefix (Tools)
Error: json: cannot unmarshal object into Go struct field ChatCompletionChoice.choices.message of type string
```
# Expected Behavior
The command should process the commit message successfully, even if the model outputs unusual characters.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.