Skip to content

json: cannot unmarshal object into Go struct field #195

Open
@h-b

Description

@h-b

Environment

codegpt version: 0.14.2 (commit: fd5758c)
Model: Gemma 2 (via local KoboldCpp 1.72 instance)

I’ve configured codegpt to use a local KoboldCpp instance:

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:

❯ 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions