Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/js-client-grpc/src/api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function createClients(transport: Transport) {
export function createApis(baseUrl: string, {timeout, apiKey}: {timeout: number; apiKey?: string}): GrpcClients {
const interceptors: Interceptor[] = [
(next) => (req) => {
req.header.set('user-agent', 'qdrant-js/' + String(PACKAGE_VERSION));
req.header.set('user-agent', 'javascript-client/' + String(PACKAGE_VERSION));
Copy link

Copilot AI Jun 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider moving the user-agent string construction into a shared utility or constant to keep the REST and gRPC implementations consistent and DRY.

Suggested change
req.header.set('user-agent', 'javascript-client/' + String(PACKAGE_VERSION));
req.header.set('user-agent', getUserAgent());

Copilot uses AI. Check for mistakes.
return next(req);
},
(next) => (req) =>
Expand Down
2 changes: 1 addition & 1 deletion packages/js-client-rest/src/qdrant-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export class QdrantClient {
this._host = host ?? '127.0.0.1';
}

const headers = new Headers([['user-agent', 'qdrant-js/' + String(PACKAGE_VERSION)]]);
const headers = new Headers([['user-agent', 'javascript-client/' + String(PACKAGE_VERSION)]]);
Copy link

Copilot AI Jun 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider extracting the 'javascript-client/' + String(PACKAGE_VERSION) value into a shared constant to avoid duplication between REST and gRPC clients.

Suggested change
const headers = new Headers([['user-agent', 'javascript-client/' + String(PACKAGE_VERSION)]]);
const headers = new Headers([['user-agent', USER_AGENT]]);

Copilot uses AI. Check for mistakes.

const metadata = args.headers ?? {};
Object.keys(metadata).forEach((field) => {
Expand Down