@xuda.io/ai_module 1.1.5265 → 1.1.5267
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 +8 -8
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -11049,8 +11049,8 @@ export const get_chat_suggestions = async function (req) {
|
|
|
11049
11049
|
const conversation_item_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, conversation_item_id);
|
|
11050
11050
|
const conversation_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, conversation_item_doc.conversation_id);
|
|
11051
11051
|
|
|
11052
|
-
if (conversation_item_doc.
|
|
11053
|
-
exclude_agents = conversation_item_doc.
|
|
11052
|
+
if (conversation_item_doc.prompt_suggestions) {
|
|
11053
|
+
exclude_agents = conversation_item_doc.prompt_suggestions.map((agent) => agent.agent_id);
|
|
11054
11054
|
}
|
|
11055
11055
|
|
|
11056
11056
|
const get_agents = async function () {
|
|
@@ -11135,7 +11135,7 @@ export const get_chat_suggestions = async function (req) {
|
|
|
11135
11135
|
// Format Compatibility: Analyze the ## Prompt Response. If it contains code, data structures, or specific document types (like HTML), prioritize agents whose agent_instructions or agent_name or agent instructions involve processing, transforming, or styling that specific format.
|
|
11136
11136
|
|
|
11137
11137
|
// Workflow Continuity: Choose agents that represent a logical "next step" in a development or content creation pipeline (e.g., if code was generated, suggest an agent that deploys, converts, or styles it).
|
|
11138
|
-
|
|
11138
|
+
// Input: ${conversation_item_doc.prompt || conversation_doc.prompt}
|
|
11139
11139
|
// Contextual Relevance: Balance the selection with the ## User Info and ## Prompt Category to ensure the agents match the user's industry and intent.
|
|
11140
11140
|
debugger;
|
|
11141
11141
|
const prompt = `
|
|
@@ -11155,9 +11155,7 @@ export const get_chat_suggestions = async function (req) {
|
|
|
11155
11155
|
Input Context:
|
|
11156
11156
|
|
|
11157
11157
|
User Profile: ${JSON.stringify(account_doc.account_info)}
|
|
11158
|
-
Prompt Category: ${conversation_doc?.category_info?.category}
|
|
11159
|
-
Input: ${conversation_item_doc.prompt || conversation_doc.prompt}
|
|
11160
|
-
|
|
11158
|
+
Prompt Category: ${conversation_doc?.category_info?.category}
|
|
11161
11159
|
|
|
11162
11160
|
Agent Source: ${JSON.stringify(agents_docs)}
|
|
11163
11161
|
|
|
@@ -11169,7 +11167,7 @@ export const get_chat_suggestions = async function (req) {
|
|
|
11169
11167
|
|
|
11170
11168
|
`;
|
|
11171
11169
|
|
|
11172
|
-
|
|
11170
|
+
let opt = {
|
|
11173
11171
|
uid,
|
|
11174
11172
|
prompt,
|
|
11175
11173
|
model: ai_model,
|
|
@@ -11177,7 +11175,9 @@ export const get_chat_suggestions = async function (req) {
|
|
|
11177
11175
|
metadata: { conversation_item_id, func: 'get_chat_suggestions' },
|
|
11178
11176
|
account_profile_info,
|
|
11179
11177
|
response_id: conversation_item_doc.conversation_item_reference_id,
|
|
11180
|
-
}
|
|
11178
|
+
};
|
|
11179
|
+
|
|
11180
|
+
const chat_ret = await submit_chat_gpt_prompt(opt);
|
|
11181
11181
|
try {
|
|
11182
11182
|
const ret = JSON5.parse(chat_ret.data);
|
|
11183
11183
|
return ret.agents;
|