43 lines
869 B
TypeScript
43 lines
869 B
TypeScript
export namespace ai {
|
|
|
|
export class Message {
|
|
role: string;
|
|
content: string;
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new Message(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.role = source["role"];
|
|
this.content = source["content"];
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
export namespace backend {
|
|
|
|
export class ModelConfig {
|
|
key: string;
|
|
model: string;
|
|
in: number;
|
|
out: number;
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new ModelConfig(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.key = source["key"];
|
|
this.model = source["model"];
|
|
this.in = source["in"];
|
|
this.out = source["out"];
|
|
}
|
|
}
|
|
|
|
}
|
|
|