{"record":{"id":"189bbf7d00ff806f","repo":"continuedev/continue","slug":"asksage-does-not-support-reranking","errorCode":null,"errorMessage":"AskSage does not support reranking","messagePattern":"AskSage does not support reranking","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/openai-adapters/src/apis/AskSage.ts","lineNumber":493,"sourceCode":"    _body: CompletionCreateParamsStreaming,\n    _signal: AbortSignal,\n  ): AsyncGenerator<Completion> {\n    throw new Error(\"AskSage does not support legacy completions API\");\n  }\n\n  fimStream(\n    _body: FimCreateParamsStreaming,\n    _signal: AbortSignal,\n  ): AsyncGenerator<ChatCompletionChunk> {\n    throw new Error(\"AskSage does not support FIM\");\n  }\n\n  async embed(_body: EmbeddingCreateParams): Promise<CreateEmbeddingResponse> {\n    throw new Error(\"AskSage does not support embeddings\");\n  }\n\n  async rerank(_body: RerankCreateParams): Promise<CreateRerankResponse> {\n    throw new Error(\"AskSage does not support reranking\");\n  }\n\n  async list(): Promise<Model[]> {\n    // AskSage has a /get-models endpoint, but it requires authentication\n    // For now, return empty array - models are typically configured explicitly\n    return [];\n  }\n}\n","sourceCodeStart":475,"sourceCodeEnd":502,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/packages/openai-adapters/src/apis/AskSage.ts#L475-L502","documentation":"AskSage does not provide a reranking endpoint, so the adapter's rerank method is a stub that always throws. Like FIM and embeddings, reranking is part of the shared LLM API interface but not offered by AskSage, so the method fails fast with an explicit message. Reranking requests must be routed to a provider that implements them.","triggerScenarios":"Calling rerank() on an AskSageApi instance, e.g. a retrieval pipeline configured with provider 'asksage' issuing a RerankCreateParams request.","commonSituations":"Using AskSage as the single provider for an enterprise RAG setup where the rerank step shares the chat config; assuming OpenAI-compatible providers also expose a /rerank endpoint (Cohere/Jina-style).","solutions":["Configure a dedicated rerank provider (e.g. cohere, llm7, any rerank-capable adapter) for the rerank role","Disable reranking in the retrieval pipeline when the only provider is AskSage","Fall back to similarity-score ordering without a reranker"],"exampleFix":"// before\nrerankProvider: { provider: 'asksage', apiKey: '...' }\n\n// after\nrerankProvider: { provider: 'cohere', model: 'rerank-v3.5', apiKey: '...' }","handlingStrategy":"fallback","validationCode":"const RERANK_CAPABLE = new Set(['cohere', 'llm7', ...]);\nif (!RERANK_CAPABLE.has(config.rerankProvider)) {\n  console.warn('rerank disabled: provider lacks support');\n  config.rerankEnabled = false;\n}","typeGuard":"const supportsRerank = (api: BaseLlmApi): boolean =>\n  Object.getPrototypeOf(api).rerank !== AskSageApi.prototype.rerank;","tryCatchPattern":"try { return await api.rerank(body); }\ncatch (e) {\n  if (e instanceof Error && e.message.includes('does not support reranking')) {\n    return { results: body.documents.map((d, i) => ({ index: i, relevance_score: 0 })) }; // no-op ordering\n  }\n  throw e;\n}","preventionTips":["Gate reranking behind a provider capability check in your retrieval pipeline","Have a no-rerank fallback path in retrieval code"],"tags":["asksage","rerank","unsupported-feature"],"backgroundTag":"unsupported-capability","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}