@gaiot/apis
Version:
aiot apis
112 lines (111 loc) • 2.29 kB
TypeScript
export declare enum OCRServiceId {
common = "A100",
idcard = "A104",
bankcard = "A108",
page = "A112",
rmwatermark = "A115",
seal = "A116",
rmseal = "A117",
table = "A118"
}
export interface OCRMinioParams {
image?: string;
url?: string;
options?: {
use_rotate: boolean;
};
modelStore?: number;
}
export interface OCRPvcBatchParams {
confThres?: number;
pages: IPageList[];
modelStore?: number;
}
export interface IPageList {
pagNo?: number;
image?: string;
textItems?: IBbox[];
}
export interface IBbox {
bbox: [x: number, y: number][];
}
export interface OCRResult {
words?: string;
confidence?: number;
box: [x: number, y: number][];
type?: string;
catagoryId?: string;
}
export interface OCRBatchResult {
pages: IPageList[];
}
export interface DetectionParam {
instances: [{
image: {
b64: string;
};
}];
}
export interface IDetectionResult {
prediction: IPrediction[];
}
export interface IPrediction {
box: [x: number, y: number][];
label: string;
score: number;
}
export declare enum IChatRole {
User = "user",
Assistant = "assistant",
System = "system"
}
export interface IChatHistory {
role: string;
content: any;
created?: number;
isLoading?: boolean;
reasoningContent?: string;
state?: string;
}
export interface IChatCompletion {
model: string;
messages: IChatHistory[];
stream?: boolean;
temperature: number;
max_tokens?: number;
top_p?: number;
top_k?: number;
repetition_penalty?: number;
}
export interface IChatResult {
model: string;
choices: {
index: number;
message: IChatHistory;
finish_reason: string;
}[];
created?: number;
usage: {
prompt_tokens: number;
completion_tokens: number;
total_tokens: number;
};
}
export interface IEmbedding {
input: string[];
model: string;
}
export interface IEmbeddingResult {
data: {
embeddings: number[];
index: number;
object: string;
}[];
model: string;
object: string;
score_weight: number;
usage: {
prompt_tokens: number;
total_tokens: number;
};
}