update
This commit is contained in:
@@ -3,8 +3,6 @@ import { useContextKey } from '@kevisual/context'
|
||||
import { useKey } from '@kevisual/use-config'
|
||||
import { CNB } from '../src/index.ts';
|
||||
import { CNBManager } from './modules/cnb-manager.ts'
|
||||
import { createOpenAICompatible } from '@ai-sdk/openai-compatible';
|
||||
|
||||
|
||||
export const cnbManager = new CNBManager()
|
||||
|
||||
@@ -21,9 +19,11 @@ try {
|
||||
cnb: new CNB({ token: token, cookie: cookie })
|
||||
})
|
||||
} catch (error) {
|
||||
|
||||
process.exit(1)
|
||||
}
|
||||
export const cnb = (await cnbManager.getCNB({ username: 'default' })).cnb
|
||||
await new Promise(resolve => setTimeout(resolve, 1000))
|
||||
export const cnbItem = await cnbManager.getCNB({ username: 'default' });
|
||||
export const cnb = cnbItem?.cnb;
|
||||
export const app = await useContextKey<App>('app', () => {
|
||||
return new App({})
|
||||
})
|
||||
|
||||
@@ -30,9 +30,14 @@ const main = async () => {
|
||||
payload: {
|
||||
messages
|
||||
}
|
||||
})
|
||||
}, { appId: app.appId })
|
||||
if (result.code === 200) {
|
||||
console.log('执行完成')
|
||||
let _message = result.data.message || []
|
||||
console.log('执行完成', JSON.stringify(_message, null, 2))
|
||||
process.exit(0)
|
||||
} else {
|
||||
console.log(result.message || '执行错误')
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user