at-shared-types 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai/engine.d.ts +86 -0
- package/dist/ai/index.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/package.json +12 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export interface AIGenerateTextOptions {
|
|
2
|
+
engineID?: string;
|
|
3
|
+
type?: string;
|
|
4
|
+
model?: string;
|
|
5
|
+
temperature?: number;
|
|
6
|
+
maxTokens?: number;
|
|
7
|
+
systemPrompt?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface AIGenerateTextResult {
|
|
10
|
+
text: string;
|
|
11
|
+
raw?: any;
|
|
12
|
+
engineID: string;
|
|
13
|
+
}
|
|
14
|
+
export type ATChatMessageContent = string | null;
|
|
15
|
+
/**
|
|
16
|
+
* Internal representation — can include nulls for assistant messages, etc.
|
|
17
|
+
*/
|
|
18
|
+
export type AIChatMessage = {
|
|
19
|
+
role: "system";
|
|
20
|
+
content: ATChatMessageContent;
|
|
21
|
+
} | {
|
|
22
|
+
role: "user";
|
|
23
|
+
content: ATChatMessageContent;
|
|
24
|
+
} | {
|
|
25
|
+
role: "assistant";
|
|
26
|
+
content: ATChatMessageContent;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Provider-safe variant (no null content, matches what OpenAI expects)
|
|
30
|
+
*/
|
|
31
|
+
export type AIChatInputMessage = {
|
|
32
|
+
role: "system";
|
|
33
|
+
content: Exclude<ATChatMessageContent, null>;
|
|
34
|
+
} | {
|
|
35
|
+
role: "user";
|
|
36
|
+
content: Exclude<ATChatMessageContent, null>;
|
|
37
|
+
} | {
|
|
38
|
+
role: "assistant";
|
|
39
|
+
content: Exclude<ATChatMessageContent, null>;
|
|
40
|
+
};
|
|
41
|
+
export type AIChatOptionsResponseFormat = {
|
|
42
|
+
type: "text";
|
|
43
|
+
} | {
|
|
44
|
+
type: "json";
|
|
45
|
+
jsonSchema?: Record<string, any>;
|
|
46
|
+
};
|
|
47
|
+
export interface AIChatOptions {
|
|
48
|
+
model?: string;
|
|
49
|
+
temperature?: number;
|
|
50
|
+
maxTokens?: number;
|
|
51
|
+
engineID?: string;
|
|
52
|
+
responseFormat?: AIChatOptionsResponseFormat;
|
|
53
|
+
}
|
|
54
|
+
export interface AIChatResponse {
|
|
55
|
+
message: AIChatMessage;
|
|
56
|
+
usage?: {
|
|
57
|
+
tokens?: number;
|
|
58
|
+
};
|
|
59
|
+
raw?: any;
|
|
60
|
+
debug?: any;
|
|
61
|
+
}
|
|
62
|
+
export interface AIIntent {
|
|
63
|
+
capabilityID: string;
|
|
64
|
+
params?: object;
|
|
65
|
+
confidence?: number;
|
|
66
|
+
reason?: string;
|
|
67
|
+
}
|
|
68
|
+
export interface AICapability {
|
|
69
|
+
id: string;
|
|
70
|
+
description: string;
|
|
71
|
+
}
|
|
72
|
+
export interface AIChatWithIntentOptions extends AIChatOptions {
|
|
73
|
+
capabilities?: AICapability[];
|
|
74
|
+
}
|
|
75
|
+
export interface AIChatWithIntentResponse extends AIChatResponse {
|
|
76
|
+
intents?: AIIntent[];
|
|
77
|
+
}
|
|
78
|
+
export interface AIEmbedOptions {
|
|
79
|
+
model?: string;
|
|
80
|
+
engineID?: string;
|
|
81
|
+
}
|
|
82
|
+
export interface AIEmbedResponse {
|
|
83
|
+
embeddings: number[] | number[][];
|
|
84
|
+
model: string;
|
|
85
|
+
engineID: string;
|
|
86
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./engine";
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ai/index";
|