update
This commit is contained in:
37
prompts/test/import-sentence.ts
Normal file
37
prompts/test/import-sentence.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import { app } from './common.ts';
|
||||
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
|
||||
const sentence = path.join(process.cwd(), 'data', 'sentence-01-optimized.json');
|
||||
|
||||
const data = JSON.parse(fs.readFileSync(sentence, 'utf-8'));
|
||||
|
||||
async function run() {
|
||||
const sentences = data?.sentences || [];
|
||||
console.log(`Importing ${sentences.length} sentences...`);
|
||||
const res = await app.run({
|
||||
path: 'image-creator',
|
||||
// key: 'create-sentence-list',
|
||||
key: 'fix-sentences',
|
||||
payload: {
|
||||
data: sentences
|
||||
}
|
||||
});
|
||||
|
||||
console.log('Import sentence result:', res);
|
||||
}
|
||||
|
||||
// await run();
|
||||
|
||||
async function run2() {
|
||||
const sentences = data?.sentences || [];
|
||||
const res = await app.run({
|
||||
path: 'image-creator',
|
||||
key: 'perfect-sentence',
|
||||
});
|
||||
|
||||
console.log('Import sentence result:', res);
|
||||
}
|
||||
|
||||
await run2();
|
||||
Reference in New Issue
Block a user