CodeGPT icon indicating copy to clipboard operation
CodeGPT copied to clipboard

support ollama generate reponose when code completions.

Open me-v2 opened this issue 1 year ago • 2 comments

What happened?

curl http://localhost:11434/api/generate -d '{ "model": "llama2", "prompt": "Why is the sky blue?" }' Response A stream of JSON objects is returned:

{ "model": "llama2", "created_at": "2023-08-04T08:52:19.385406455-07:00", "response": "The", "done": false }

error: CleanShot 2024-04-27 at 14 35 23

Relevant log output or stack trace

No response

Steps to reproduce

No response

CodeGPT version

2.4.0

Operating System

None

me-v2 avatar Apr 27 '24 06:04 me-v2

https://github.com/carlrobertoh/CodeGPT/pull/510 will introduce Ollama as a high-level service and use its native API to support code-completions

Crustack avatar Apr 27 '24 07:04 Crustack

To add to that, specifying api/generate doesn't work because the request and response formats don't match OpenAI services. Currently, using OpenAI-compatible APIs is a requirement

boswelja avatar Apr 28 '24 01:04 boswelja