dba0245cb1
Server Actions + createStreamableValue kept failing in production; fetch-based text stream avoids RSC serialization issues and shows readable error messages. Co-authored-by: Cursor <cursoragent@cursor.com>
41 lines
852 B
TypeScript
41 lines
852 B
TypeScript
import type { BaziInput } from "@/lib/calc/bazi";
|
|
|
|
export interface LiuyaoAiInput {
|
|
question: string;
|
|
calcDate: string;
|
|
calcTime: string;
|
|
locationName: string;
|
|
longitude: number;
|
|
guaMark: string;
|
|
guaTitle: string;
|
|
guaResult: string;
|
|
guaChange: string;
|
|
}
|
|
|
|
export interface BaziAiInput {
|
|
input: BaziInput;
|
|
question: string;
|
|
birthPlaceName: string;
|
|
}
|
|
|
|
export interface CombinedAiInput {
|
|
birth: BaziInput;
|
|
birthPlaceName: string;
|
|
currentPlaceName: string;
|
|
currentLongitude: number;
|
|
calcDate: string;
|
|
calcTime: string;
|
|
question: string;
|
|
hexagram?: {
|
|
guaMark: string;
|
|
guaTitle: string;
|
|
guaResult: string;
|
|
guaChange: string;
|
|
};
|
|
}
|
|
|
|
export type AiRequestBody =
|
|
| { mode: "liuyao"; payload: LiuyaoAiInput }
|
|
| { mode: "bazi"; payload: BaziAiInput }
|
|
| { mode: "combined"; payload: CombinedAiInput };
|