-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
interfaces.ts
63 lines (53 loc) · 1.48 KB
/
interfaces.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import { PluginInitReturn } from "@/creatorSettings/creatorSettings.type";
import { StyleLibrary } from "@/features/reactJS/interfaces";
import { IPluginOptions as GeneralOptions } from "@/features/general/interfaces";
import { IOpenAIOptions } from "./models/openAI/openai.types";
import { MergeDeep } from "type-fest";
type ModelsOptions = MergeDeep<
IOpenAIOptions,
IOpenAIOptions,
{ arrayMergeMode: "spread" }
>;
export interface IPluginOptions extends ModelsOptions {
compDescription?: string;
styleLibrary?: StyleLibrary;
isTS?: boolean;
aiTool?: AITools;
aiCreateStorybook?: boolean;
aiCreateTest?: boolean;
}
export interface ISettings extends IPluginOptions {
templateName: string;
templateFolder: string;
}
export type OutAnswers = {
AI: PluginInitReturn<ISettings>;
general: PluginInitReturn<GeneralOptions>;
};
export const defaultSettings: ISettings = {
templateName: "main",
templateFolder: "AI",
};
export enum AITools {
openAI = "openAI",
ollama = "ollama",
}
export interface IModelReturn {
callAgent: callAgentFn;
}
export type callAgentFn = (options: callAgentFnOptions) => Promise<string>;
export type callAgentFnOptions = {
componentName: string;
componentDescription: string;
styleLibrary: string;
modelName: string;
isTypescript: boolean;
};
export type callAgentWithCodeFnOptions = {
componentName: string;
componentDescription: string;
styleLibrary: string;
modelName: string;
isTypescript: boolean;
componentCode: string;
};