@ancatag/n-r 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,19 +1,14 @@
1
- /**
2
- * gRPC Client (stub implementation)
3
- *
4
- * This is a placeholder for gRPC functionality.
5
- * OpenChat uses REST transport only, so this is not implemented.
6
- *
7
- * To implement gRPC support, this would use @grpc/grpc-js and @nova-ai/proto
8
- *
9
- * Note: gRPC dependencies are optional. If gRPC is requested but dependencies
10
- * are not installed, this will throw an error suggesting to use REST instead.
11
- */
12
1
  import type { ChatCompletionChunk, ChatCompletionRequest, ChatCompletionResponse, Model, NovaClientConfig } from "./types.js";
13
2
  export declare class GrpcClient {
14
- constructor(_config: NovaClientConfig);
15
- createChatCompletion(_request: ChatCompletionRequest): Promise<ChatCompletionResponse>;
16
- createChatCompletionStream(_request: ChatCompletionRequest): AsyncGenerator<ChatCompletionChunk, void, unknown>;
3
+ private readonly config;
4
+ private client;
5
+ constructor(config: NovaClientConfig);
6
+ private getMetadata;
7
+ createChatCompletion(request: ChatCompletionRequest): Promise<ChatCompletionResponse>;
8
+ createChatCompletionStream(request: ChatCompletionRequest): AsyncGenerator<ChatCompletionChunk, void, unknown>;
17
9
  listModels(): Promise<Model[]>;
10
+ private mapToGrpcRequest;
11
+ private mapFromGrpcResponse;
12
+ private mapFromGrpcStreamResponse;
18
13
  }
19
14
  //# sourceMappingURL=grpc-client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"grpc-client.d.ts","sourceRoot":"","sources":["../src/grpc-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EACX,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,KAAK,EACL,gBAAgB,EAChB,MAAM,YAAY,CAAC;AAEpB,qBAAa,UAAU;gBACV,OAAO,EAAE,gBAAgB;IAW/B,oBAAoB,CACzB,QAAQ,EAAE,qBAAqB,GAC7B,OAAO,CAAC,sBAAsB,CAAC;IAI3B,0BAA0B,CAChC,QAAQ,EAAE,qBAAqB,GAC7B,cAAc,CAAC,mBAAmB,EAAE,IAAI,EAAE,OAAO,CAAC;IAI/C,UAAU,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;CAGpC"}
1
+ {"version":3,"file":"grpc-client.d.ts","sourceRoot":"","sources":["../src/grpc-client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACX,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,KAAK,EACL,gBAAgB,EAChB,MAAM,YAAY,CAAC;AAEpB,qBAAa,UAAU;IAGV,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,OAAO,CAAC,MAAM,CAAM;gBAES,MAAM,EAAE,gBAAgB;IAmBrD,OAAO,CAAC,WAAW;IAMb,oBAAoB,CACzB,OAAO,EAAE,qBAAqB,GAC5B,OAAO,CAAC,sBAAsB,CAAC;IAmB3B,0BAA0B,CAChC,OAAO,EAAE,qBAAqB,GAC5B,cAAc,CAAC,mBAAmB,EAAE,IAAI,EAAE,OAAO,CAAC;IAW/C,UAAU,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;IAoBpC,OAAO,CAAC,gBAAgB;IAwBxB,OAAO,CAAC,mBAAmB;IA+B3B,OAAO,CAAC,yBAAyB;CAiBjC"}
@@ -1,31 +1,132 @@
1
- /**
2
- * gRPC Client (stub implementation)
3
- *
4
- * This is a placeholder for gRPC functionality.
5
- * OpenChat uses REST transport only, so this is not implemented.
6
- *
7
- * To implement gRPC support, this would use @grpc/grpc-js and @nova-ai/proto
8
- *
9
- * Note: gRPC dependencies are optional. If gRPC is requested but dependencies
10
- * are not installed, this will throw an error suggesting to use REST instead.
11
- */
1
+ import * as grpc from "@grpc/grpc-js";
2
+ import * as protoLoader from "@grpc/proto-loader";
3
+ import { NOVA_SERVICE_PROTO } from "@nova-ai/proto";
12
4
  export class GrpcClient {
13
- constructor(_config) {
14
- // Stub implementation - gRPC not fully implemented yet
15
- // Note: gRPC dependencies (@grpc/grpc-js, @grpc/proto-loader) are optional
16
- // If you need gRPC support, install them: pnpm add @grpc/grpc-js @grpc/proto-loader
17
- // For now, use REST transport: transport: "rest"
18
- throw new Error('gRPC transport is not fully implemented. Use transport: "rest" instead.\n' +
19
- "If you need gRPC support, ensure @grpc/grpc-js and @grpc/proto-loader are installed.");
5
+ config;
6
+ client;
7
+ constructor(config) {
8
+ this.config = config;
9
+ const packageDefinition = protoLoader.loadSync(NOVA_SERVICE_PROTO, {
10
+ keepCase: true,
11
+ longs: String,
12
+ enums: String,
13
+ defaults: true,
14
+ oneofs: true,
15
+ });
16
+ const protoDescriptor = grpc.loadPackageDefinition(packageDefinition);
17
+ const novaService = protoDescriptor.nova.service;
18
+ const grpcUrl = config.grpcUrl || "0.0.0.0:50051";
19
+ this.client = new novaService.NovaService(grpcUrl, grpc.credentials.createInsecure());
20
20
  }
21
- async createChatCompletion(_request) {
22
- throw new Error("gRPC not implemented");
21
+ getMetadata(apiKey) {
22
+ const metadata = new grpc.Metadata();
23
+ metadata.add("authorization", `Bearer ${apiKey}`);
24
+ return metadata;
23
25
  }
24
- async *createChatCompletionStream(_request) {
25
- throw new Error("gRPC not implemented");
26
+ async createChatCompletion(request) {
27
+ return new Promise((resolve, reject) => {
28
+ const grpcRequest = this.mapToGrpcRequest(request);
29
+ const metadata = this.getMetadata(this.config.apiKey);
30
+ this.client.GenerateText(grpcRequest, metadata, { deadline: new Date(Date.now() + (this.config.timeoutMs || 60000)) }, (error, response) => {
31
+ if (error) {
32
+ return reject(error);
33
+ }
34
+ resolve(this.mapFromGrpcResponse(response));
35
+ });
36
+ });
37
+ }
38
+ async *createChatCompletionStream(request) {
39
+ const grpcRequest = this.mapToGrpcRequest(request);
40
+ const metadata = this.getMetadata(this.config.apiKey);
41
+ const stream = this.client.StreamText(grpcRequest, metadata);
42
+ for await (const chunk of stream) {
43
+ yield this.mapFromGrpcStreamResponse(chunk);
44
+ }
26
45
  }
27
46
  async listModels() {
28
- throw new Error("gRPC not implemented");
47
+ return new Promise((resolve, reject) => {
48
+ const metadata = this.getMetadata(this.config.apiKey);
49
+ this.client.ListModels({}, metadata, (error, response) => {
50
+ if (error) {
51
+ return reject(error);
52
+ }
53
+ resolve(response.models.map((m) => ({
54
+ id: m.id,
55
+ object: "model",
56
+ created: Math.floor(Date.now() / 1000),
57
+ owned_by: m.provider || "nova",
58
+ })));
59
+ });
60
+ });
61
+ }
62
+ mapToGrpcRequest(request) {
63
+ // Map OpenAI-style request to Nova gRPC request
64
+ const lastMessage = request.messages[request.messages.length - 1];
65
+ return {
66
+ prompt: lastMessage.content,
67
+ model_selection: {
68
+ model_id: request.model,
69
+ },
70
+ max_tokens: request.max_tokens,
71
+ temperature: request.temperature,
72
+ top_p: request.top_p,
73
+ context: {
74
+ conversation_history: request.messages.slice(0, -1).map((m) => ({
75
+ role: m.role,
76
+ content: m.content,
77
+ })),
78
+ },
79
+ // Nova extensions
80
+ enable_cache: !request.nova?.skipCache,
81
+ enable_semantic_cache: !request.nova?.skipCache,
82
+ };
83
+ }
84
+ mapFromGrpcResponse(response) {
85
+ return {
86
+ id: response.result?.metadata?.request_id || `chatcmpl-${Date.now()}`,
87
+ object: "chat.completion",
88
+ created: Math.floor(Date.now() / 1000),
89
+ model: response.used_model?.model_id || "unknown",
90
+ choices: [
91
+ {
92
+ index: 0,
93
+ message: {
94
+ role: "assistant",
95
+ content: response.result?.result || "",
96
+ },
97
+ finish_reason: "stop",
98
+ },
99
+ ],
100
+ usage: {
101
+ prompt_tokens: response.usage?.input_tokens || 0,
102
+ completion_tokens: response.usage?.output_tokens || 0,
103
+ total_tokens: response.usage?.total_tokens || 0,
104
+ },
105
+ nova: {
106
+ cacheHit: response.cached || false,
107
+ cacheLayer: response.semantic_cache_hit ? "semantic" : "hot",
108
+ tokensSaved: response.usage?.total_tokens || 0, // Simplified
109
+ responseTimeMs: 0, // Not available in raw gRPC response easily
110
+ requestId: response.result?.metadata?.request_id || "",
111
+ },
112
+ };
113
+ }
114
+ mapFromGrpcStreamResponse(chunk) {
115
+ return {
116
+ id: `chatcmpl-${Date.now()}`,
117
+ object: "chat.completion.chunk",
118
+ created: Math.floor(Date.now() / 1000),
119
+ model: chunk.used_model?.model_id || "unknown",
120
+ choices: [
121
+ {
122
+ index: 0,
123
+ delta: {
124
+ content: chunk.token || "",
125
+ },
126
+ finish_reason: chunk.completed ? "stop" : null,
127
+ },
128
+ ],
129
+ };
29
130
  }
30
131
  }
31
132
  //# sourceMappingURL=grpc-client.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"grpc-client.js","sourceRoot":"","sources":["../src/grpc-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAUH,MAAM,OAAO,UAAU;IACtB,YAAY,OAAyB;QACpC,uDAAuD;QACvD,2EAA2E;QAC3E,oFAAoF;QACpF,iDAAiD;QACjD,MAAM,IAAI,KAAK,CACd,2EAA2E;YAC1E,sFAAsF,CACvF,CAAC;IACH,CAAC;IAED,KAAK,CAAC,oBAAoB,CACzB,QAA+B;QAE/B,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,CAAC,0BAA0B,CAChC,QAA+B;QAE/B,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,UAAU;QACf,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;IACzC,CAAC;CACD"}
1
+ {"version":3,"file":"grpc-client.js","sourceRoot":"","sources":["../src/grpc-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AACtC,OAAO,KAAK,WAAW,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AASpD,MAAM,OAAO,UAAU;IAGO;IAFrB,MAAM,CAAM;IAEpB,YAA6B,MAAwB;QAAxB,WAAM,GAAN,MAAM,CAAk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CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI;iBAC9C;aACD;SACD,CAAC;IACH,CAAC;CACD"}
package/package.json CHANGED
@@ -1,65 +1,66 @@
1
1
  {
2
- "name": "@ancatag/n-r",
3
- "version": "0.2.0",
4
- "description": "Official Node.js/TypeScript SDK for Nova AI API with route-config-based orchestration",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "exports": {
8
- ".": {
9
- "import": "./dist/index.js",
10
- "require": "./dist/index.js",
11
- "types": "./dist/index.d.ts"
12
- }
13
- },
14
- "files": [
15
- "dist",
16
- "README.md"
17
- ],
18
- "scripts": {
19
- "build": "tsc",
20
- "dev": "tsc --watch",
21
- "clean": "rm -rf dist",
22
- "type-check": "tsc --noEmit",
23
- "test": "vitest run",
24
- "test:watch": "vitest",
25
- "test:cov": "vitest run --coverage",
26
- "prepublishOnly": "pnpm clean && pnpm build",
27
- "publish:npm": "npm publish --access public"
28
- },
29
- "keywords": [
30
- "nova",
31
- "ai",
32
- "sdk",
33
- "chat",
34
- "completions",
35
- "openai-compatible",
36
- "route-config",
37
- "caching",
38
- "rag",
39
- "cost-optimization"
40
- ],
41
- "author": "",
42
- "license": "ISC",
43
- "repository": {
44
- "type": "git",
45
- "url": "git+https://github.com/sayanmohsin/nova-route.git",
46
- "directory": "packages/sdk"
47
- },
48
- "publishConfig": {
49
- "access": "public"
50
- },
51
- "engines": {
52
- "node": ">=18.0.0"
53
- },
54
- "devDependencies": {
55
- "@types/node": "^25.0.3",
56
- "@vitest/coverage-v8": "^4.0.16",
57
- "typescript": "^5.9.3",
58
- "vitest": "^4.0.16"
59
- },
60
- "type": "module",
61
- "optionalDependencies": {
62
- "@grpc/grpc-js": "^1.14.3",
63
- "@grpc/proto-loader": "^0.8.0"
64
- }
2
+ "name": "@ancatag/n-r",
3
+ "version": "0.2.2",
4
+ "description": "Official Node.js/TypeScript SDK for Nova AI API with route-config-based orchestration",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "import": "./dist/index.js",
10
+ "require": "./dist/index.js",
11
+ "types": "./dist/index.d.ts"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "README.md"
17
+ ],
18
+ "scripts": {
19
+ "build": "tsc",
20
+ "dev": "tsc --watch",
21
+ "clean": "rm -rf dist",
22
+ "type-check": "tsc --noEmit",
23
+ "test": "vitest run",
24
+ "test:watch": "vitest",
25
+ "test:cov": "vitest run --coverage",
26
+ "prepublishOnly": "pnpm clean && pnpm build",
27
+ "publish:npm": "npm publish --access public"
28
+ },
29
+ "keywords": [
30
+ "nova",
31
+ "ai",
32
+ "sdk",
33
+ "chat",
34
+ "completions",
35
+ "openai-compatible",
36
+ "route-config",
37
+ "caching",
38
+ "rag",
39
+ "cost-optimization"
40
+ ],
41
+ "author": "",
42
+ "license": "ISC",
43
+ "repository": {
44
+ "type": "git",
45
+ "url": "git+https://github.com/sayanmohsin/nova-route.git",
46
+ "directory": "packages/sdk"
47
+ },
48
+ "publishConfig": {
49
+ "access": "public"
50
+ },
51
+ "engines": {
52
+ "node": ">=18.0.0"
53
+ },
54
+ "devDependencies": {
55
+ "@types/node": "^25.0.6",
56
+ "@vitest/coverage-v8": "^4.0.16",
57
+ "typescript": "^5.9.3",
58
+ "vitest": "^4.0.16"
59
+ },
60
+ "type": "module",
61
+ "dependencies": {
62
+ "@grpc/grpc-js": "^1.14.3",
63
+ "@grpc/proto-loader": "^0.8.0",
64
+ "@nova-ai/proto": "workspace:*"
65
+ }
65
66
  }