continuedev/continue · warning · Error

Method not implemented.

Error message

Method not implemented.

What it means

The Cohere adapter does not support legacy (non-chat) text completions; completionNonStream is an intentional stub. Cohere's API is chat-oriented in this adapter, so /v1/completions style calls are unsupported.

Source

Thrown at packages/openai-adapters/src/apis/Cohere.ts:144

            {
              index: 0,
              logprobs: undefined,
              finish_reason: null,
              delta: {
                role: "assistant",
                content: value.text,
              },
            },
          ],
          usage: undefined,
        };
      }
    }
  }
  completionNonStream(
    body: CompletionCreateParamsNonStreaming,
  ): Promise<Completion> {
    throw new Error("Method not implemented.");
  }
  completionStream(
    body: CompletionCreateParamsStreaming,
  ): AsyncGenerator<Completion> {
    throw new Error("Method not implemented.");
  }
  fimStream(
    body: FimCreateParamsStreaming,
  ): AsyncGenerator<ChatCompletionChunk> {
    throw new Error("Method not implemented.");
  }
  async rerank(body: RerankCreateParams): Promise<CreateRerankResponse> {
    const endpoint = new URL("rerank", this.apiBase);
    const response = await customFetch(this.config.requestOptions)(endpoint, {
      method: "POST",
      body: JSON.stringify(body),
      headers: {
        "Content-Type": "application/json",

View on GitHub (pinned to 5522c6f44c)

Solutions

  1. Use chatCompletionNonStream instead for Cohere.
  2. Pick a provider that supports the completions API for base-model prompts.
  3. If you control the router, add capability flags so completions never reach Cohere.

Example fix

// before
await cohere.completionNonStream({ model: 'command-r', prompt: 'hi' });
// after
await cohere.chatCompletionNonStream({ model: 'command-r', messages: [{ role: 'user', content: 'hi' }] });
Defensive patterns

Strategy: type-guard

Type guard

const supportsCompletions = (p: API): boolean => !(p instanceof Cohere) && typeof p.completionNonStream === 'function';

Try / catch

try { await p.completionNonStream(b); } catch (e) { if (e.message === 'Method not implemented.') await p.chatCompletionNonStream(toChat(b)); else throw e; }

Prevention

When it happens

Trigger: Routing a CompletionCreateParamsNonStreaming request (model output raw, prompt field) to the Cohere adapter.

Common situations: Using a unified router that falls back to completion endpoints for base models (e.g. codestral-style usage) but pointing it at Cohere; migrating configs from an OpenAI-compatible provider.

Related errors


AI-assisted analysis of continuedev/continue@5522c6f44c (2026-08-27). Data as JSON: /api/errors/71563d1978bce344. Report an issue: GitHub.