@chainai/core 1.0.1 → 1.0.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.
@@ -9,6 +9,20 @@ const principal_1 = require("@dfinity/principal");
9
9
  // IDL factory for NLP Edge canister
10
10
  const createNLPEdgeIdl = (idlFactory) => {
11
11
  const { IDL } = idlFactory;
12
+ // AIResponse type matches the canister's AIResponse record
13
+ const AIResponseType = IDL.Record({
14
+ 'intent': IDL.Text,
15
+ 'kind': IDL.Text,
16
+ 'response': IDL.Text,
17
+ 'toolData': IDL.Text,
18
+ 'confidence': IDL.Nat,
19
+ 'conversationId': IDL.Text,
20
+ });
21
+ // ChatResponse is Result<AIResponse, Text> = variant { ok: AIResponse; err: Text }
22
+ const ChatResponseType = IDL.Variant({
23
+ 'ok': AIResponseType,
24
+ 'err': IDL.Text,
25
+ });
12
26
  return IDL.Service({
13
27
  'chat': IDL.Func([IDL.Record({
14
28
  'message': IDL.Text,
@@ -16,7 +30,7 @@ const createNLPEdgeIdl = (idlFactory) => {
16
30
  'language': IDL.Opt(IDL.Text),
17
31
  'userContext': IDL.Opt(IDL.Text),
18
32
  'apiKey': IDL.Opt(IDL.Text),
19
- })], [IDL.Text], []),
33
+ })], [ChatResponseType], []),
20
34
  'health': IDL.Func([], [IDL.Text], ['query']),
21
35
  });
22
36
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chainai/core",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Core client library for Chain AI - Natural language blockchain assistant",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",