You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
657 B
TypeScript
23 lines
657 B
TypeScript
import { router, publicProcedure, Validator } from "../../trpc/server";
|
|
import { Type as T } from "@sinclair/typebox";
|
|
|
|
export const chat = router({
|
|
sendMessage: publicProcedure
|
|
.input(
|
|
Validator(
|
|
T.Object({
|
|
prompt: T.String(),
|
|
systemPrompt: T.String(),
|
|
parameters: T.Object({
|
|
temperature: T.Number(),
|
|
max_tokens: T.Number(),
|
|
}),
|
|
}),
|
|
),
|
|
)
|
|
.mutation(async ({ input: { prompt, systemPrompt, parameters } }) => {
|
|
console.log("Received new todo", { prompt, systemPrompt, parameters });
|
|
return { prompt, systemPrompt, parameters };
|
|
}),
|
|
});
|