@indra.ai/deva.services 0.0.122 → 0.0.123
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/feature/methods.js +21 -20
- package/package.json +2 -24
package/feature/methods.js
CHANGED
|
@@ -117,34 +117,35 @@ export default {
|
|
|
117
117
|
describe: this method provides a global ask method to all agents.
|
|
118
118
|
***************/
|
|
119
119
|
async ask(packet) {
|
|
120
|
-
this.zone('services', packet.id);
|
|
121
|
-
this.feature('services', packet.id);
|
|
122
|
-
this.context('ask', `${packet.q.agent.name}:${packet.id}`);
|
|
123
|
-
this.action('services', `ask:${packet.id}`);
|
|
120
|
+
this.zone('services', packet.id.uid);
|
|
121
|
+
this.feature('services', packet.id.uid);
|
|
122
|
+
this.context('ask', `${packet.q.agent.name}:${packet.id.uid}`);
|
|
123
|
+
this.action('services', `ask:${packet.id.uid}`);
|
|
124
|
+
this.state('services', `ask:${packet.id.uid}`);
|
|
124
125
|
const data = {};
|
|
125
126
|
const agent = this.agent();
|
|
126
127
|
const client = this.client();
|
|
127
128
|
const info = this.info();
|
|
128
129
|
|
|
129
|
-
this.state('get', `corpus:${packet.id}`);
|
|
130
|
-
const
|
|
130
|
+
this.state('get', `corpus:${packet.id.uid}`);
|
|
131
|
+
const _corpus = await this.help('corpus', info.dir);
|
|
132
|
+
const corpus = await this.question(`${this.askChr}feecting parse ${_corpus}`);
|
|
131
133
|
|
|
132
134
|
return new Promise((resolve, reject) => {
|
|
133
135
|
if (!this.vars.ask) return resolve('Ask not configured.');
|
|
134
136
|
|
|
135
|
-
|
|
136
|
-
this.
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
history: this.vars.ask.history.slice(-10),
|
|
145
|
-
memory: agent.key,
|
|
146
|
-
});
|
|
137
|
+
data.corpus = corpus.a.text;
|
|
138
|
+
this.state('get', 'ask:chat');
|
|
139
|
+
this.question(`${this.askChr}chat relay ${decodeURIComponent(packet.q.text)}`, {
|
|
140
|
+
client: buildProfile(client, 'client'),
|
|
141
|
+
agent: buildProfile(agent, 'agent'),
|
|
142
|
+
corpus: corpus.a.text,
|
|
143
|
+
max_tokens: this.vars.ask.max_tokens,
|
|
144
|
+
history: this.vars.ask.history.slice(-10),
|
|
145
|
+
memory: agent.key,
|
|
147
146
|
}).then(answer => {
|
|
147
|
+
console.log('CHAT RELAY ANSWER', Object.keys(answer));
|
|
148
|
+
|
|
148
149
|
data.chat = answer.a.data.chat;
|
|
149
150
|
const text = [
|
|
150
151
|
`::begin:${agent.key}:${answer.id}`,
|
|
@@ -163,11 +164,11 @@ export default {
|
|
|
163
164
|
content: this.lib.trimWords(answer.a.data.chat.text, 150),
|
|
164
165
|
});
|
|
165
166
|
|
|
166
|
-
this.state('parse', `ask:${packet.id}`);
|
|
167
|
+
this.state('parse', `ask:${packet.id.uid}`);
|
|
167
168
|
return this.question(`${this.askChr}feecting parse ${text.join('\n')}`);
|
|
168
169
|
}).then(feecting => {
|
|
169
170
|
data.feecting = feecting.a.data;
|
|
170
|
-
this.state('resolve', `ask:${packet.id}`);
|
|
171
|
+
this.state('resolve', `ask:${packet.id.uid}`);
|
|
171
172
|
return resolve({
|
|
172
173
|
text: feecting.a.text,
|
|
173
174
|
html: feecting.a.html,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "59232188337076320338",
|
|
3
3
|
"name": "@indra.ai/deva.services",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.123",
|
|
5
5
|
"license": "VLA:59232188337076320338 LICENSE.md",
|
|
6
6
|
"VLA": {
|
|
7
7
|
"uid": "59232188337076320338",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
},
|
|
60
60
|
"homepage": "https://indra.ai",
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@indra.ai/deva": "^1.
|
|
62
|
+
"@indra.ai/deva": "^1.11.0"
|
|
63
63
|
},
|
|
64
64
|
"data": {
|
|
65
65
|
"agent": {
|
|
@@ -121,29 +121,7 @@
|
|
|
121
121
|
"label": "👨🔧SERVICES",
|
|
122
122
|
"signature": "@Services"
|
|
123
123
|
},
|
|
124
|
-
"live": {
|
|
125
|
-
"profile": "services",
|
|
126
|
-
"max_tokens": 50,
|
|
127
|
-
"words": 25,
|
|
128
|
-
"history": [],
|
|
129
|
-
"max_chats": 10,
|
|
130
|
-
"page_token": ""
|
|
131
|
-
},
|
|
132
124
|
"ask": {
|
|
133
|
-
"max_tokens": 500,
|
|
134
|
-
"words": 200,
|
|
135
|
-
"history": []
|
|
136
|
-
},
|
|
137
|
-
"reply": {
|
|
138
|
-
"profile": "services",
|
|
139
|
-
"max_tokens": 300,
|
|
140
|
-
"words": 100,
|
|
141
|
-
"history": []
|
|
142
|
-
},
|
|
143
|
-
"comment": {
|
|
144
|
-
"profile": "services",
|
|
145
|
-
"max_tokens": 300,
|
|
146
|
-
"words": 100,
|
|
147
125
|
"history": []
|
|
148
126
|
},
|
|
149
127
|
"art": {
|