jan/server/v1/index.ts
2023-12-04 20:46:42 +07:00

37 lines
713 B
TypeScript

import assistantsAPI from './assistants'
import chatCompletionAPI from './chat'
import modelsAPI from './models'
import threadsAPI from './threads'
import { FastifyInstance, FastifyPluginAsync } from 'fastify'
const router: FastifyPluginAsync = async (app: FastifyInstance, opts) => {
app.register(
assistantsAPI,
{
prefix: "/assistants"
}
)
app.register(
chatCompletionAPI,
{
prefix: "/chat/completion"
}
)
app.register(
modelsAPI,
{
prefix: "/models"
}
)
app.register(
threadsAPI,
{
prefix: "/threads"
}
)
}
export default router;