continue icon indicating copy to clipboard operation
continue copied to clipboard

After filling in the aipkey, it cannot be used

Open SlyviaCC opened this issue 1 year ago • 1 comments

Before submitting your bug report

Relevant environment info

- OS:13.0 (22A380)
- Continue:0.8.24
- IDE:vscode

Description

I'm the plus user in openai, and i got my apikey already. but still can't use continue, i don't know why.

To reproduce

my config: { "models": [ { "title": "GPT-4 (Free Trial)", "provider": "openai", "model": "gpt-4", "apiKey": "mykeys" }, { "title": "GPT-4 Vision (Free Trial)", "provider": "openai", "model": "gpt-4-vision-preview", "apiKey": "mykeys", "apiBase": "https://api.openai.com/v1/chat/completions" }, { "title": "Gemini Pro (Free Trial)", "provider": "openai", "model": "gemini-pro", "apiKey": "mykeys" }, { "title": "Codellama 70b (Free Trial)", "provider": "openai", "model": "codellama-70b", "apiKey": "mykeys" }, { "title": "Phind Codellama", "provider": "ollama", "model": "phind-codellama", "num_ctx": 16384 }, { "model": "gpt-3.5-turbo", "title": "GPT-3.5-Turbo", "apiKey": "mykeys", "completionOptions": { "enabled": true, "maxResults": 5000 }, "provider": "openai" } ], "slashCommands": [ { "name": "edit", "description": "Edit selected code" }, { "name": "comment", "description": "Write comments for the selected code" }, { "name": "share", "description": "Download and share this session" }, { "name": "cmd", "description": "Generate a shell command" } ], "customCommands": [ { "name": "test", "prompt": "Write a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.", "description": "Write unit tests for highlighted code" } ], "contextProviders": [ { "name": "diff", "params": {} }, { "name": "open", "params": {} }, { "name": "terminal", "params": {} }, { "name": "problems", "params": {} }, { "name": "codebase", "params": { "nRetrieve": 45, "nFinal": 15, "useReranking": true } } ], "embeddingsProvider": { "provider": "transformers.js" }, "allowAnonymousTelemetry": false } 222222

Log output

workbench.desktop.main.js:sourcemap:149 [Extension Host] Error handling webview message: {
  "msg": {
    "messageId": "209f0cdb-9e24-43b1-86cb-0a8a0c06b7e2",
    "messageType": "llm/streamChat",
    "data": {
      "messages": [
        {
          "role": "user",
          "content": [
            {
              "type": "text",
              "text": "22"
            }
          ]
        },
        {
          "role": "assistant",
          "content": [
            {
              "type": "text",
              "text": ""
            }
          ]
        },
        {
          "role": "user",
          "content": [
            {
              "type": "text",
              "text": "w"
            }
          ]
        }
      ],
      "title": "GPT-4 Vision (Free Trial)",
      "completionOptions": {}
    }
  }
}
$ @ workbench.desktop.main.js:sourcemap:149
$logExtensionHostMessage @ workbench.desktop.main.js:sourcemap:1551
S @ workbench.desktop.main.js:sourcemap:1551
Q @ workbench.desktop.main.js:sourcemap:1551
M @ workbench.desktop.main.js:sourcemap:1551
L @ workbench.desktop.main.js:sourcemap:1551
(anonymous) @ workbench.desktop.main.js:sourcemap:1551
z @ workbench.desktop.main.js:sourcemap:87
fire @ workbench.desktop.main.js:sourcemap:87
fire @ workbench.desktop.main.js:sourcemap:616
Y.onmessage @ workbench.desktop.main.js:sourcemap:1652
workbench.desktop.main.js:sourcemap:769 Error: HTTP 404 Not Found from https://api.openai.com/v1/chat/completions/chat/completions  {     "error": {         "message": "Invalid URL (POST /v1/chat/completions/chat/completions)",         "type": "invalid_request_error",         "param": null,         "code": null     } }
c @ workbench.desktop.main.js:sourcemap:769
(anonymous) @ workbench.desktop.main.js:sourcemap:769
z @ workbench.desktop.main.js:sourcemap:87
A @ workbench.desktop.main.js:sourcemap:87
fire @ workbench.desktop.main.js:sourcemap:87
addNotification @ workbench.desktop.main.js:sourcemap:769
notify @ workbench.desktop.main.js:sourcemap:1654
(anonymous) @ workbench.desktop.main.js:sourcemap:1544
d @ workbench.desktop.main.js:sourcemap:1544
$showMessage @ workbench.desktop.main.js:sourcemap:1544
S @ workbench.desktop.main.js:sourcemap:1551
Q @ workbench.desktop.main.js:sourcemap:1551
M @ workbench.desktop.main.js:sourcemap:1551
L @ workbench.desktop.main.js:sourcemap:1551
(anonymous) @ workbench.desktop.main.js:sourcemap:1551
z @ workbench.desktop.main.js:sourcemap:87
fire @ workbench.desktop.main.js:sourcemap:87
fire @ workbench.desktop.main.js:sourcemap:616
Y.onmessage @ workbench.desktop.main.js:sourcemap:1652

SlyviaCC avatar Apr 24 '24 03:04 SlyviaCC

@SlyviaCC Here is a modified version of your model configuration that I believe should work:

{
  "title": "GPT-4 Vision (Free Trial)",
  "provider": "openai",
  "model": "gpt-4-vision-preview",
  "apiKey": "mykeys",
  "apiBase": "https://api.openai.com/v1"
}

The important thing here is to use the /v1 endpoint, rather than adding /chat/completions to the end.

Continue will also assume https://api.openai.com/v1 as the default, so you can leave this out entirely:

{
  "title": "GPT-4 Vision (Free Trial)",
  "provider": "openai",
  "model": "gpt-4-vision-preview",
  "apiKey": "mykeys"
}

sestinj avatar Apr 24 '24 07:04 sestinj

@SlyviaCC Here is a modified version of your model configuration that I believe should work:

{
  "title": "GPT-4 Vision (Free Trial)",
  "provider": "openai",
  "model": "gpt-4-vision-preview",
  "apiKey": "mykeys",
  "apiBase": "https://api.openai.com/v1"
}

The important thing here is to use the /v1 endpoint, rather than adding /chat/completions to the end.

Continue will also assume https://api.openai.com/v1 as the default, so you can leave this out entirely:

{
  "title": "GPT-4 Vision (Free Trial)",
  "provider": "openai",
  "model": "gpt-4-vision-preview",
  "apiKey": "mykeys"
}

here is my configs now, but still not work: { "models": [ { "title": "GPT-4 (Free Trial)", "provider": "openai", "model": "gpt-4", "apiKey": "apikeys" }, { "title": "GPT-4 Vision (Free Trial)", "provider": "openai", "model": "gpt-4-vision-preview", "apiKey": "apikeys" }, { "model": "gpt-3.5-turbo", "title": "GPT-3.5-Turbo", "apiKey": "apikeys", "completionOptions": { "enabled": true, "maxResults": 5000 }, "provider": "openai" }, { "model": "gpt-4", "title": "GPT-4", "apiKey": "apikeys", "completionOptions": {}, "provider": "openai" } ], "slashCommands": [ { "name": "edit", "description": "Edit selected code" }, { "name": "comment", "description": "Write comments for the selected code" }, { "name": "share", "description": "Download and share this session" }, { "name": "cmd", "description": "Generate a shell command" } ], "customCommands": [ { "name": "test", "prompt": "Write a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.", "description": "Write unit tests for highlighted code" } ], "contextProviders": [ { "name": "diff", "params": {} }, { "name": "open", "params": {} }, { "name": "terminal", "params": {} }, { "name": "problems", "params": {} }, { "name": "codebase", "params": { "nRetrieve": 45, "nFinal": 15, "useReranking": true } } ], "embeddingsProvider": { "provider": "transformers.js" }, "allowAnonymousTelemetry": false } image image

SlyviaCC avatar Apr 26 '24 03:04 SlyviaCC