fix(cli): stream

This commit is contained in:
Acbox
2026-02-07 01:37:36 +08:00
parent 29e6ddd1f9
commit a9596ab3a8
3 changed files with 82 additions and 77 deletions
+2
View File
@@ -23,6 +23,7 @@ const AgentModel = z.object({
export const chatModule = new Elysia({ prefix: '/chat' })
.use(bearerMiddleware)
.post('/', async ({ body, bearer }) => {
console.log('chat', body)
const authFetcher = createAuthFetcher(bearer)
const { ask } = createAgent({
model: body.model as ModelConfig,
@@ -45,6 +46,7 @@ export const chatModule = new Elysia({ prefix: '/chat' })
}),
})
.post('/stream', async function* ({ body, bearer }) {
console.log('stream', body)
try {
const authFetcher = createAuthFetcher(bearer)
const { stream } = createAgent({