@blocklet/pages-kit-agents 0.6.57 → 0.6.59

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.
@@ -2,11 +2,10 @@
2
2
 
3
3
  DEBUG=aigne:*
4
4
 
5
- OPENAI_API_KEY="" # Your OpenAI API key
6
- GEMINI_API_KEY=""
7
- CLAUDE_API_KEY=""
8
- XAI_API_KEY=""
9
- DEEPSEEK_API_KEY=""
5
+ BLOCKLET_AIGNE_API_URL="'https://hub.aigne.io" # AIGNE Hub URL
6
+ BLOCKLET_AIGNE_API_PROVIDER=""
7
+ BLOCKLET_AIGNE_API_MODEL=""
8
+ BLOCKLET_AIGNE_API_CREDENTIAL=""
10
9
 
11
10
  OPENAI_BASE_URL=https://openai.arcblock.io/v1
12
11
 
package/README.md CHANGED
@@ -5,6 +5,9 @@
5
5
  1. Setup the environment variables
6
6
 
7
7
  - `BLOCKLET_APP_URL`: The URL of the blocklet app
8
- - `OPENAI_API_KEY`: The OpenAI API key
8
+ - `BLOCKLET_AIGNE_API_URL`: The AIGNE Hub URL, default to `https://hub.aigne.io`
9
+ - `BLOCKLET_AIGNE_API_CREDENTIAL`: The AIGNE Hub API credential
10
+ - `BLOCKLET_AIGNE_API_PROVIDER`: The AIGNE Hub API provider
11
+ - `BLOCKLET_AIGNE_API_MODEL`: The AIGNE Hub API model
9
12
 
10
13
  2. Authenticate with the blocklet app
package/cli.ts CHANGED
@@ -183,7 +183,7 @@ const generatePageContent = async (
183
183
  logger.info(`[${modelName}] Step 2/3: Creating HTML output...`);
184
184
  }
185
185
 
186
- const model = getModel(REVIEW_MODEL_NAME);
186
+ const model = await getModel(REVIEW_MODEL_NAME);
187
187
  const engine = new AIGNE({
188
188
  model,
189
189
  });
@@ -51,7 +51,7 @@ async function generatePageContentMultiAgent(input) {
51
51
  throw new Error('Client disconnected');
52
52
  }
53
53
  let structurePlanMap = {};
54
- const model = (0, agent_utils_js_1.getModel)(modelName);
54
+ const model = await (0, agent_utils_js_1.getModel)(modelName);
55
55
  // 3-4 使用反思工作流生成页面结构
56
56
  const planningEngine = new core_1.AIGNE({
57
57
  model,
@@ -179,7 +179,7 @@ async function generateSingleSectionContent({ context, question, locale, section
179
179
  generatedSections: JSON.stringify(existingSections),
180
180
  };
181
181
  const sectionContentAgent = await (0, section_content_generator_js_1.createSectionContentAgent)(sectionContentInput);
182
- const model = (0, agent_utils_js_1.getModel)(modelName);
182
+ const model = await (0, agent_utils_js_1.getModel)(modelName);
183
183
  const engine = new core_1.AIGNE({
184
184
  model,
185
185
  });
@@ -6,13 +6,6 @@ const core_1 = require("@aigne/core");
6
6
  // import assert from 'node:assert';
7
7
  const zod_1 = require("zod");
8
8
  const utils_1 = require("../utils");
9
- // const { OPENAI_API_KEY } = process.env;
10
- // assert(OPENAI_API_KEY, 'Please set the OPENAI_API_KEY environment variable');
11
- // const memory = new DefaultMemory({
12
- // storage: {
13
- // url: 'file:./dbs/memory.db', // Path to store memory data, such as 'file:./memory.db'
14
- // },
15
- // });
16
9
  const agentInstructions = `
17
10
  你是一个专业的页面设计师,名叫小设。你的任务是根据整理好的用户需求,设计一个页面结构。
18
11
 
@@ -12,13 +12,6 @@ const node_path_1 = __importDefault(require("node:path"));
12
12
  const zod_1 = require("zod");
13
13
  const agent_utils_js_1 = require("../utils/agent-utils.js");
14
14
  const reflection_agent_js_1 = require("../workflow-agents/reflection-agent.js");
15
- // const { OPENAI_API_KEY } = process.env;
16
- // assert(OPENAI_API_KEY, 'Please set the OPENAI_API_KEY environment variable');
17
- // const memory = new DefaultMemory({
18
- // storage: {
19
- // url: 'file:./dbs/memory.db', // Path to store memory data, such as 'file:./memory.db'
20
- // },
21
- // });
22
15
  const pagesKitTemplateRule = node_fs_1.default.readFileSync(node_path_1.default.join(__dirname, '../prompts/pages-kit-template-rule.md'), 'utf-8');
23
16
  const contextRule = `
24
17
  ## 技术规范参考