feat: you can summary screen shot directly
This commit is contained in:
Vendored
+4
@@ -37,6 +37,10 @@ export function SaveRegionToRemote(arg1:main.CaptureResult):Promise<void>;
|
||||
|
||||
export function ShowWindow():Promise<void>;
|
||||
|
||||
export function SummarizeNativeRegion(arg1:main.CaptureResult):Promise<void>;
|
||||
|
||||
export function SummarizeRegion(arg1:main.CaptureResult):Promise<void>;
|
||||
|
||||
export function TestConnection(arg1:domain.S3Config):Promise<void>;
|
||||
|
||||
export function TestSSHConnection(arg1:domain.SSHConfig):Promise<void>;
|
||||
|
||||
@@ -70,6 +70,14 @@ export function ShowWindow() {
|
||||
return window['go']['main']['App']['ShowWindow']();
|
||||
}
|
||||
|
||||
export function SummarizeNativeRegion(arg1) {
|
||||
return window['go']['main']['App']['SummarizeNativeRegion'](arg1);
|
||||
}
|
||||
|
||||
export function SummarizeRegion(arg1) {
|
||||
return window['go']['main']['App']['SummarizeRegion'](arg1);
|
||||
}
|
||||
|
||||
export function TestConnection(arg1) {
|
||||
return window['go']['main']['App']['TestConnection'](arg1);
|
||||
}
|
||||
|
||||
@@ -53,6 +53,64 @@ export namespace application {
|
||||
|
||||
export namespace domain {
|
||||
|
||||
export class LLMProviderConfig {
|
||||
label: string;
|
||||
baseUrl: string;
|
||||
apiKey: string;
|
||||
model: string;
|
||||
maxTokens: number;
|
||||
temperature: number;
|
||||
timeoutSecs: number;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new LLMProviderConfig(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) source = JSON.parse(source);
|
||||
this.label = source["label"];
|
||||
this.baseUrl = source["baseUrl"];
|
||||
this.apiKey = source["apiKey"];
|
||||
this.model = source["model"];
|
||||
this.maxTokens = source["maxTokens"];
|
||||
this.temperature = source["temperature"];
|
||||
this.timeoutSecs = source["timeoutSecs"];
|
||||
}
|
||||
}
|
||||
export class LLMConfig {
|
||||
activeProvider: string;
|
||||
prompt: string;
|
||||
providers: Record<string, LLMProviderConfig>;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new LLMConfig(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) source = JSON.parse(source);
|
||||
this.activeProvider = source["activeProvider"];
|
||||
this.prompt = source["prompt"];
|
||||
this.providers = this.convertValues(source["providers"], LLMProviderConfig, true);
|
||||
}
|
||||
|
||||
convertValues(a: any, classs: any, asMap: boolean = false): any {
|
||||
if (!a) {
|
||||
return a;
|
||||
}
|
||||
if (a.slice && a.map) {
|
||||
return (a as any[]).map(elem => this.convertValues(elem, classs));
|
||||
} else if ("object" === typeof a) {
|
||||
if (asMap) {
|
||||
for (const key of Object.keys(a)) {
|
||||
a[key] = new classs(a[key]);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
return new classs(a);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
}
|
||||
export class SSHConfig {
|
||||
host: string;
|
||||
port: number;
|
||||
@@ -111,6 +169,7 @@ export namespace domain {
|
||||
hotkey: string;
|
||||
s3: S3Config;
|
||||
ssh: SSHConfig;
|
||||
llm: LLMConfig;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new AppConfig(source);
|
||||
@@ -121,6 +180,7 @@ export namespace domain {
|
||||
this.hotkey = source["hotkey"];
|
||||
this.s3 = this.convertValues(source["s3"], S3Config);
|
||||
this.ssh = this.convertValues(source["ssh"], SSHConfig);
|
||||
this.llm = this.convertValues(source["llm"], LLMConfig);
|
||||
}
|
||||
|
||||
convertValues(a: any, classs: any, asMap: boolean = false): any {
|
||||
@@ -142,6 +202,8 @@ export namespace domain {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user