@scout9/app 1.0.0-alpha.0.4.7 → 1.0.0-alpha.0.4.9
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/dist/{dev-0ea31ed3.cjs → dev-51604173.cjs} +193 -76
- package/dist/{index-2ea90dd1.cjs → index-2aa6f869.cjs} +22 -21
- package/dist/index.cjs +4 -4
- package/dist/{macros-e4105c56.cjs → macros-c9b4654d.cjs} +1 -1
- package/dist/{multipart-parser-78f6b861.cjs → multipart-parser-24b2e9b9.cjs} +4 -4
- package/dist/schemas.cjs +1 -1
- package/dist/{spirits-5c9243a1.cjs → spirits-8225c9fd.cjs} +2 -2
- package/dist/spirits.cjs +1 -1
- package/dist/testing-tools.cjs +3 -3
- package/package.json +1 -1
- package/src/core/index.js +0 -4
- package/src/public.d.ts +1 -1
- package/src/runtime/client/api.js +3 -1
- package/src/runtime/macros/builder.js +6 -3
- package/src/runtime/schemas/conversation.js +1 -0
- package/src/testing-tools/dev.js +1 -1
- package/src/testing-tools/spirits.js +2 -2
- package/types/index.d.ts +598 -598
- package/types/index.d.ts.map +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Utility runtime class
|
|
2
|
+
* Utility runtime class for entity APIs methods
|
|
3
|
+
* @deprecated this is only valid for entity APIs, not workflow templates
|
|
3
4
|
* @template T
|
|
4
5
|
*/
|
|
5
6
|
export class EventResponse {
|
|
@@ -56,3 +57,4 @@ export class EventResponse {
|
|
|
56
57
|
|
|
57
58
|
}
|
|
58
59
|
|
|
60
|
+
|
|
@@ -44,7 +44,8 @@ export async function did(prompt) {
|
|
|
44
44
|
const {value} = (await (new Scout9Api(new Configuration({apiKey: process.env.SCOUT9_API_KEY}))).did(processPayload({
|
|
45
45
|
prompt,
|
|
46
46
|
convoId,
|
|
47
|
-
event
|
|
47
|
+
event,
|
|
48
|
+
cache: !event.context?.__no_cache
|
|
48
49
|
}))
|
|
49
50
|
.then(handleAxiosResponse)
|
|
50
51
|
.catch((err) => {
|
|
@@ -76,7 +77,8 @@ export async function does(prompt, relation = 'customer') {
|
|
|
76
77
|
prompt,
|
|
77
78
|
convoId,
|
|
78
79
|
role: relation,
|
|
79
|
-
event
|
|
80
|
+
event,
|
|
81
|
+
cache: !event.context?.__no_cache
|
|
80
82
|
})
|
|
81
83
|
)
|
|
82
84
|
.then(handleAxiosResponse)
|
|
@@ -122,7 +124,8 @@ export async function context(prompt, examples) {
|
|
|
122
124
|
prompt,
|
|
123
125
|
examples,
|
|
124
126
|
convoId,
|
|
125
|
-
event
|
|
127
|
+
event,
|
|
128
|
+
cache: !event.context?.__no_cache
|
|
126
129
|
}))
|
|
127
130
|
.then(handleAxiosResponse)
|
|
128
131
|
.catch((err) => {
|
package/src/testing-tools/dev.js
CHANGED
|
@@ -123,7 +123,7 @@ export class Scout9Test {
|
|
|
123
123
|
this._cwd = cwd;
|
|
124
124
|
this._src = src;
|
|
125
125
|
this._mode = mode;
|
|
126
|
-
this.context = context || {};
|
|
126
|
+
this.context = {...(context || {}), __no_cache: true};
|
|
127
127
|
this.conversation = conversation;
|
|
128
128
|
if (api) {
|
|
129
129
|
this._api = api;
|
|
@@ -470,10 +470,10 @@ export const Spirits = {
|
|
|
470
470
|
addInstruction(instruction.content, previousLockAttempt, instruction.id);
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
|
-
} else if (typeof instructions === 'object' && 'content' in instructions
|
|
473
|
+
} else if (typeof instructions === 'object' && 'content' in instructions) {
|
|
474
474
|
addInstruction(instructions.content, previousLockAttempt, instructions.id);
|
|
475
475
|
} else {
|
|
476
|
-
throw new Error(
|
|
476
|
+
throw new Error(`SpiritsError: instructions must be a string or array or {content: "<instruction>"}, got: ${JSON.stringify(instructions)}`);
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
479
|
|