@ancatag/n-r 0.1.0 → 0.1.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.
@@ -5,6 +5,9 @@
5
5
  * OpenChat uses REST transport only, so this is not implemented.
6
6
  *
7
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.
8
11
  */
9
12
  import type { ChatCompletionRequest, ChatCompletionResponse, ChatCompletionChunk, Model, NovaClientConfig } from './types.js';
10
13
  export declare class GrpcClient {
@@ -1 +1 @@
1
- {"version":3,"file":"grpc-client.d.ts","sourceRoot":"","sources":["../src/grpc-client.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACX,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,KAAK,EACL,gBAAgB,EAChB,MAAM,YAAY,CAAC;AAEpB,qBAAa,UAAU;gBACV,MAAM,EAAE,gBAAgB;IAO9B,oBAAoB,CACzB,OAAO,EAAE,qBAAqB,GAC5B,OAAO,CAAC,sBAAsB,CAAC;IAI3B,0BAA0B,CAChC,OAAO,EAAE,qBAAqB,GAC5B,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":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EACX,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,KAAK,EACL,gBAAgB,EAChB,MAAM,YAAY,CAAC;AAEpB,qBAAa,UAAU;gBACV,MAAM,EAAE,gBAAgB;IAW9B,oBAAoB,CACzB,OAAO,EAAE,qBAAqB,GAC5B,OAAO,CAAC,sBAAsB,CAAC;IAI3B,0BAA0B,CAChC,OAAO,EAAE,qBAAqB,GAC5B,cAAc,CAAC,mBAAmB,EAAE,IAAI,EAAE,OAAO,CAAC;IAI/C,UAAU,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;CAGpC"}
@@ -5,11 +5,18 @@
5
5
  * OpenChat uses REST transport only, so this is not implemented.
6
6
  *
7
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.
8
11
  */
9
12
  export class GrpcClient {
10
13
  constructor(config) {
11
- // Stub implementation - gRPC not used by OpenChat
12
- throw new Error('gRPC transport is not implemented. Use transport: "rest" instead.');
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.');
13
20
  }
14
21
  async createChatCompletion(request) {
15
22
  throw new Error('gRPC not implemented');
@@ -1 +1 @@
1
- {"version":3,"file":"grpc-client.js","sourceRoot":"","sources":["../src/grpc-client.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAUH,MAAM,OAAO,UAAU;IACtB,YAAY,MAAwB;QACnC,kDAAkD;QAClD,MAAM,IAAI,KAAK,CACd,mEAAmE,CACnE,CAAC;IACH,CAAC;IAED,KAAK,CAAC,oBAAoB,CACzB,OAA8B;QAE9B,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,CAAC,0BAA0B,CAChC,OAA8B;QAE9B,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;;;;;;;;;;GAUG;AAUH,MAAM,OAAO,UAAU;IACtB,YAAY,MAAwB;QACnC,uDAAuD;QACvD,2EAA2E;QAC3E,oFAAoF;QACpF,iDAAiD;QACjD,MAAM,IAAI,KAAK,CACd,2EAA2E;YAC3E,sFAAsF,CACtF,CAAC;IACH,CAAC;IAED,KAAK,CAAC,oBAAoB,CACzB,OAA8B;QAE9B,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,CAAC,0BAA0B,CAChC,OAA8B;QAE9B,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,UAAU;QACf,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;IACzC,CAAC;CACD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ancatag/n-r",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Official Node.js/TypeScript SDK for Nova AI API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -49,8 +49,9 @@
49
49
  "@types/node": "^20.11.30"
50
50
  },
51
51
  "type": "module",
52
- "dependencies": {
52
+ "dependencies": {},
53
+ "optionalDependencies": {
53
54
  "@grpc/grpc-js": "^1.14.3",
54
55
  "@grpc/proto-loader": "^0.8.0"
55
56
  }
56
- }
57
+ }