@xuda.io/ai_module 1.1.5198 → 1.1.5200
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/index.mjs +4 -4
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -4182,7 +4182,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4182
4182
|
await update_job('initiating conversation');
|
|
4183
4183
|
let prompt_suggestions = [];
|
|
4184
4184
|
|
|
4185
|
-
const suggestionsPromise = activate_prompt_suggestions ? get_chat_suggestions({ uid, ai_agents, conversation_item_id: out_conversation_item_save_ret.data.id }) : Promise.resolve(null);
|
|
4185
|
+
const suggestionsPromise = activate_prompt_suggestions ? get_chat_suggestions({ uid, ai_agents, conversation_item_id: out_conversation_item_save_ret.data.id, context: prompt }) : Promise.resolve(null);
|
|
4186
4186
|
|
|
4187
4187
|
conversation_doc.stat = 2;
|
|
4188
4188
|
conversation_doc.ts = Date.now();
|
|
@@ -10935,7 +10935,7 @@ export const open_ai_alive_check = async function () {};
|
|
|
10935
10935
|
// };
|
|
10936
10936
|
|
|
10937
10937
|
export const get_chat_suggestions = async function (req) {
|
|
10938
|
-
const { uid, conversation_item_id, no_of_suggestions = 3, ai_model = _conf.default_ai_model } = req;
|
|
10938
|
+
const { uid, conversation_item_id, no_of_suggestions = 3, ai_model = _conf.default_ai_model, context } = req;
|
|
10939
10939
|
let { ai_agents } = req;
|
|
10940
10940
|
|
|
10941
10941
|
try {
|
|
@@ -11026,11 +11026,11 @@ export const get_chat_suggestions = async function (req) {
|
|
|
11026
11026
|
|
|
11027
11027
|
Input: ${conversation_item_doc.prompt || conversation_doc.prompt}
|
|
11028
11028
|
|
|
11029
|
-
Output to Process: Use the previous response output as the content to analyze for next agents.
|
|
11029
|
+
Output to Process: ${context ? context : 'Use the previous response output as the content to analyze for next agents.'}
|
|
11030
11030
|
|
|
11031
11031
|
Agent Source: ${JSON.stringify(agents_docs)}
|
|
11032
11032
|
|
|
11033
|
-
Output: > Return a JSON array of exactly
|
|
11033
|
+
Output: > Return a JSON array of exactly ${no_of_suggestions} objects following this schema:
|
|
11034
11034
|
[{ "type":"string","agent_id": "string", "short_action": "string", "agent_description": "string" }]
|
|
11035
11035
|
|
|
11036
11036
|
## output example:
|