remove version params

This commit is contained in:
Sha Zhou 2025-02-27 11:33:29 +08:00
parent f8a0dbd0ac
commit efc405b1a0

View File

@ -83,14 +83,13 @@ export class SearcherHost extends RPCHost {
auth: JinaEmbeddingsAuthDTO, auth: JinaEmbeddingsAuthDTO,
@Param('count', { default: 5, validate: (v) => v >= 0 && v <= 20 }) @Param('count', { default: 5, validate: (v) => v >= 0 && v <= 20 })
count: number, count: number,
@Param('version', { default: 1, validate: (v) => v >= 1 })
version: number,
crawlerOptions: CrawlerOptions, crawlerOptions: CrawlerOptions,
searchExplicitOperators: GoogleSearchExplicitOperatorsDto, searchExplicitOperators: GoogleSearchExplicitOperatorsDto,
@Param('q') q?: string, @Param('q') q?: string,
) { ) {
const uid = await auth.solveUID(); const uid = await auth.solveUID();
const isVersion2 = version === 2; const version = ctx?.req.get('x-version');
const isVersion2 = version?.replace('v', '') === '2';
let chargeAmount = 0; let chargeAmount = 0;
const noSlashPath = decodeURIComponent(ctx.req.path).slice(1); const noSlashPath = decodeURIComponent(ctx.req.path).slice(1);