fix: correct formatting

This commit is contained in:
Shankhadeep Dey 2025-06-06 21:23:40 +05:30
parent c8d9d959f1
commit cbb5c21f59
4 changed files with 16 additions and 19 deletions

View file

@ -4,7 +4,7 @@ import { findLlmInfo } from "@continuedev/llm-info";
import {
BaseLlmApi,
ChatCompletionCreateParams,
constructLlmApi
constructLlmApi,
} from "@continuedev/openai-adapters";
import Handlebars from "handlebars";
@ -1077,7 +1077,7 @@ export abstract class BaseLLM implements ILLM {
throw new Error(
`Unexpected rerank response format from ${this.providerName}. ` +
`Expected 'data' array but got: ${JSON.stringify(Object.keys(results))}`
`Expected 'data' array but got: ${JSON.stringify(Object.keys(results))}`,
);
}

View file

@ -36,11 +36,11 @@ class Vllm extends OpenAI {
async rerank(query: string, chunks: Chunk[]): Promise<number[]> {
if (this.useOpenAIAdapterFor.includes("rerank") && this.openaiAdapter) {
const results = await this.openaiAdapter.rerank({
const results = (await this.openaiAdapter.rerank({
model: this.model,
query,
documents: chunks.map((chunk) => chunk.content),
}) as unknown as VllmRerankResponse;
})) as unknown as VllmRerankResponse;
// vLLM uses 'results' array instead of 'data'
if (results.results && Array.isArray(results.results)) {
@ -49,7 +49,7 @@ class Vllm extends OpenAI {
}
throw new Error(
`vLLM rerank response missing 'results' array. Got: ${JSON.stringify(Object.keys(results))}`
`vLLM rerank response missing 'results' array. Got: ${JSON.stringify(Object.keys(results))}`,
);
}

View file

@ -1,14 +1,14 @@
import {
ChatCompletion,
ChatCompletionChunk,
ChatCompletionCreateParamsNonStreaming,
ChatCompletionCreateParamsStreaming,
Completion,
CompletionCreateParamsNonStreaming,
CompletionCreateParamsStreaming,
CreateEmbeddingResponse,
EmbeddingCreateParams,
Model,
ChatCompletion,
ChatCompletionChunk,
ChatCompletionCreateParamsNonStreaming,
ChatCompletionCreateParamsStreaming,
Completion,
CompletionCreateParamsNonStreaming,
CompletionCreateParamsStreaming,
CreateEmbeddingResponse,
EmbeddingCreateParams,
Model,
} from "openai/resources/index";
export interface FimCreateParamsStreaming
@ -37,8 +37,6 @@ export interface CreateRerankResponse {
};
}
export interface BaseLlmApi {
// Chat, no stream
chatCompletionNonStream(

View file

@ -117,10 +117,9 @@ export {
type Completion,
type CompletionCreateParams,
type CompletionCreateParamsNonStreaming,
type CompletionCreateParamsStreaming
type CompletionCreateParamsStreaming,
} from "openai/resources/index";
// export
export type { BaseLlmApi } from "./apis/base.js";
export type { LLMConfig } from "./types.js";