We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f41ec4d commit 479306dCopy full SHA for 479306d
app/actions/chatActions.ts
@@ -15,7 +15,9 @@ const ChatSchema = z.object({
15
16
const genAI = new GoogleGenerativeAI(process.env.API_KEY!);
17
18
-export async function askAI(params: unknown): Promise<FormState> {
+type ChatParams = z.input<typeof ChatSchema>;
19
+
20
+export async function askAI(params: ChatParams): Promise<FormState> {
21
const parseResult = ChatSchema.safeParse(params);
22
23
if (!parseResult.success) {
@@ -41,5 +43,4 @@ export async function askAI(params: unknown): Promise<FormState> {
41
43
}
42
44
return { response: '', error: '予期せぬエラーが発生しました。' };
45
-}
-
46
+}
0 commit comments