@qbraid-core/chat 0.1.0 → 0.2.0

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.
package/README.md CHANGED
@@ -1,4 +1,9 @@
1
- # @qbraid-core/chat
1
+ <img align="right" width="100" alt="qbraid" src="https://qbraid-static.s3.amazonaws.com/logos/qbraid.png">
2
+
3
+ # [@qbraid-core/chat](https://qbraid.github.io/qbraid-core-js/modules/chat.html)
4
+
5
+ [![Stable][preview-stability]](https://qbraid.github.io/qbraid-core-js/#launch-stages)
6
+ [![npm](https://img.shields.io/npm/v/@qbraid-core/chat?color=blue)](https://npm.im/@qbraid-core/chat)
2
7
 
3
8
  Client for the qBraid AI Chat service.
4
9
 
@@ -19,3 +24,11 @@ const response = await client.createMessage('What is the Schrödinger equation?'
19
24
 
20
25
  console.log(response.content);
21
26
  ```
27
+
28
+ ## License
29
+
30
+ This software is proprietary and subject to the terms of the [qBraid Commercial Software License](https://qbraid.github.io/qbraid-core-js/#license).
31
+
32
+ [stable-stability]: https://img.shields.io/badge/stability-stable-green
33
+ [preview-stability]: https://img.shields.io/badge/stability-preview-orange
34
+ [deprecated-stability]: https://img.shields.io/badge/stability-deprecated-red
@@ -1,7 +1,7 @@
1
- import { Config, QbraidClient } from '@qbraid-core/base';
1
+ import { QbraidSession, QbraidClient } from '@qbraid-core/base';
2
2
  import { ChatModel, ChatResponse } from './types';
3
3
  export declare class ChatClient extends QbraidClient {
4
- constructor(config?: Config);
4
+ constructor(session?: QbraidSession);
5
5
  createMessage(prompt: string, model?: string): Promise<ChatResponse>;
6
6
  getModels(): Promise<ChatModel[]>;
7
7
  }
@@ -1,19 +1,22 @@
1
1
  "use strict";
2
+ // Copyright (c) 2025, qBraid Development Team
3
+ // All rights reserved.
2
4
  Object.defineProperty(exports, "__esModule", { value: true });
3
5
  exports.ChatClient = void 0;
4
6
  const base_1 = require("@qbraid-core/base");
5
7
  class ChatClient extends base_1.QbraidClient {
6
- constructor(config) {
7
- super(config);
8
+ constructor(session) {
9
+ super(session);
8
10
  }
9
11
  async createMessage(prompt, model = 'gpt-4o-mini') {
10
- const response = await this.session.request('POST', '/chat', {
11
- data: { prompt, model },
12
+ const response = await this.session.client.post('/chat', {
13
+ prompt,
14
+ model,
12
15
  });
13
16
  return response.data;
14
17
  }
15
18
  async getModels() {
16
- const response = await this.session.request('GET', '/chat/models');
19
+ const response = await this.session.client.get('/chat/models');
17
20
  return response.data;
18
21
  }
19
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":";;;AAAA,4CAAyD;AAGzD,MAAa,UAAW,SAAQ,mBAAY;IAC1C,YAAY,MAAe;QACzB,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,MAAc,EAAE,KAAK,GAAG,aAAa;QACvD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAe,MAAM,EAAE,OAAO,EAAE;YACzE,IAAI,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;SACxB,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,SAAS;QACb,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAc,KAAK,EAAE,cAAc,CAAC,CAAC;QAChF,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;CACF;AAhBD,gCAgBC"}
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":";AAAA,8CAA8C;AAC9C,uBAAuB;;;AAEvB,4CAAgE;AAIhE,MAAa,UAAW,SAAQ,mBAAY;IAC1C,YAAY,OAAuB;QACjC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,MAAc,EAAE,KAAK,GAAG,aAAa;QACvD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAe,OAAO,EAAE;YACrE,MAAM;YACN,KAAK;SACN,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,SAAS;QACb,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAc,cAAc,CAAC,CAAC;QAC5E,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;CACF;AAjBD,gCAiBC"}
package/dist/src/index.js CHANGED
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ // Copyright (c) 2025, qBraid Development Team
3
+ // All rights reserved.
2
4
  Object.defineProperty(exports, "__esModule", { value: true });
3
5
  exports.ChatClient = void 0;
4
6
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,mCAAsC;AAA7B,oGAAA,UAAU,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,8CAA8C;AAC9C,uBAAuB;;;AAEvB;;GAEG;AACH,mCAAsC;AAA7B,oGAAA,UAAU,OAAA"}
package/dist/src/types.js CHANGED
@@ -1,3 +1,5 @@
1
1
  "use strict";
2
+ // Copyright (c) 2025, qBraid Development Team
3
+ // All rights reserved.
2
4
  Object.defineProperty(exports, "__esModule", { value: true });
3
5
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";AAAA,8CAA8C;AAC9C,uBAAuB"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@qbraid-core/chat",
3
3
  "description": "Client for the qBraid AI Chat service.",
4
- "version": "0.1.0",
4
+ "version": "0.2.0",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
7
7
  "author": "qBraid Development Team",
@@ -32,10 +32,10 @@
32
32
  },
33
33
  "homepage": "https://qbraid.github.io/qbraid-core-js/modules/chat.html",
34
34
  "dependencies": {
35
- "@qbraid-core/base": "0.1.0"
35
+ "@qbraid-core/base": "0.2.0"
36
36
  },
37
37
  "scripts": {
38
- "clean": "rimraf dist && rimraf tsconfig.tsbuildinfo",
38
+ "clean": "rimraf dist tsconfig.tsbuildinfo src/*.d.ts src/*.js",
39
39
  "lint": "eslint src",
40
40
  "lint:fix": "eslint src --fix",
41
41
  "format": "prettier --write \"src/**/*.{ts,json}\"",