@shenghuabi/openai 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.
@@ -0,0 +1,7 @@
1
+ import { ChatMessageListOutputType } from './message.define';
2
+ export declare class ChatHistoryService {
3
+ #private;
4
+ /** 外部监听更新用 */
5
+ update$$: import("static-injector").Signal<number>;
6
+ save(messages: ChatMessageListOutputType, options: any, config: any): void;
7
+ }
@@ -0,0 +1 @@
1
+ export declare const ThinkList: string[];
@@ -0,0 +1,129 @@
1
+ import * as v from 'valibot';
2
+ export declare const ChatCompletionContentPartStr: v.ObjectSchema<{
3
+ readonly text: v.StringSchema<undefined>;
4
+ readonly type: v.OptionalSchema<v.LiteralSchema<"text", undefined>, "text">;
5
+ }, undefined>;
6
+ export type ChatCompletionContentPartStrType = v.InferOutput<typeof ChatCompletionContentPartStr>;
7
+ export declare const ChatCompletionContentPartImage: v.ObjectSchema<{
8
+ readonly image_url: v.ObjectSchema<{
9
+ readonly url: v.StringSchema<undefined>;
10
+ readonly detail: v.OptionalSchema<v.PicklistSchema<["auto", "low", "high"], undefined>, undefined>;
11
+ }, undefined>;
12
+ readonly type: v.OptionalSchema<v.LiteralSchema<"image_url", undefined>, "image_url">;
13
+ }, undefined>;
14
+ export type ChatCompletionContentPartImageType = v.InferOutput<typeof ChatCompletionContentPartImage>;
15
+ export declare const ChatCompletionContentPart: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
16
+ readonly text: v.StringSchema<undefined>;
17
+ readonly type: v.OptionalSchema<v.LiteralSchema<"text", undefined>, "text">;
18
+ }, undefined>, v.ObjectSchema<{
19
+ readonly image_url: v.ObjectSchema<{
20
+ readonly url: v.StringSchema<undefined>;
21
+ readonly detail: v.OptionalSchema<v.PicklistSchema<["auto", "low", "high"], undefined>, undefined>;
22
+ }, undefined>;
23
+ readonly type: v.OptionalSchema<v.LiteralSchema<"image_url", undefined>, "image_url">;
24
+ }, undefined>], undefined>, undefined>;
25
+ export declare const SystemChatCompletionContent: v.ArraySchema<v.ObjectSchema<{
26
+ readonly text: v.StringSchema<undefined>;
27
+ readonly type: v.OptionalSchema<v.LiteralSchema<"text", undefined>, "text">;
28
+ }, undefined>, undefined>;
29
+ export declare const UserChatCompletionContent: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
30
+ readonly text: v.StringSchema<undefined>;
31
+ readonly type: v.OptionalSchema<v.LiteralSchema<"text", undefined>, "text">;
32
+ }, undefined>, v.ObjectSchema<{
33
+ readonly image_url: v.ObjectSchema<{
34
+ readonly url: v.StringSchema<undefined>;
35
+ readonly detail: v.OptionalSchema<v.PicklistSchema<["auto", "low", "high"], undefined>, undefined>;
36
+ }, undefined>;
37
+ readonly type: v.OptionalSchema<v.LiteralSchema<"image_url", undefined>, "image_url">;
38
+ }, undefined>], undefined>, undefined>;
39
+ export type UserChatCompletionContentType = v.InferOutput<typeof UserChatCompletionContent>;
40
+ export declare const AssistantChatCompletionContent: v.ArraySchema<v.ObjectSchema<{
41
+ readonly text: v.StringSchema<undefined>;
42
+ readonly type: v.OptionalSchema<v.LiteralSchema<"text", undefined>, "text">;
43
+ }, undefined>, undefined>;
44
+ export declare const SystemChatMessage: v.ObjectSchema<{
45
+ readonly role: v.OptionalSchema<v.LiteralSchema<"system", undefined>, "system">;
46
+ readonly content: v.ArraySchema<v.ObjectSchema<{
47
+ readonly text: v.StringSchema<undefined>;
48
+ readonly type: v.OptionalSchema<v.LiteralSchema<"text", undefined>, "text">;
49
+ }, undefined>, undefined>;
50
+ }, undefined>;
51
+ export type SystemChatMessageType = v.InferOutput<typeof SystemChatMessage>;
52
+ export declare const UserChatMessage: v.ObjectSchema<{
53
+ readonly role: v.OptionalSchema<v.LiteralSchema<"user", undefined>, "user">;
54
+ readonly content: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
55
+ readonly text: v.StringSchema<undefined>;
56
+ readonly type: v.OptionalSchema<v.LiteralSchema<"text", undefined>, "text">;
57
+ }, undefined>, v.ObjectSchema<{
58
+ readonly image_url: v.ObjectSchema<{
59
+ readonly url: v.StringSchema<undefined>;
60
+ readonly detail: v.OptionalSchema<v.PicklistSchema<["auto", "low", "high"], undefined>, undefined>;
61
+ }, undefined>;
62
+ readonly type: v.OptionalSchema<v.LiteralSchema<"image_url", undefined>, "image_url">;
63
+ }, undefined>], undefined>, undefined>;
64
+ }, undefined>;
65
+ export type UserChatMessageType = v.InferOutput<typeof UserChatMessage>;
66
+ export declare const AssistantChatMessage: v.ObjectSchema<{
67
+ readonly role: v.OptionalSchema<v.LiteralSchema<"assistant", undefined>, "assistant">;
68
+ readonly content: v.ArraySchema<v.ObjectSchema<{
69
+ readonly text: v.StringSchema<undefined>;
70
+ readonly type: v.OptionalSchema<v.LiteralSchema<"text", undefined>, "text">;
71
+ }, undefined>, undefined>;
72
+ readonly thinkContent: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
73
+ }, undefined>;
74
+ export type AssistantChatMessageType = v.InferOutput<typeof AssistantChatMessage>;
75
+ export declare const ChatMessageItemDefine: v.UnionSchema<[v.ObjectSchema<{
76
+ readonly role: v.OptionalSchema<v.LiteralSchema<"system", undefined>, "system">;
77
+ readonly content: v.ArraySchema<v.ObjectSchema<{
78
+ readonly text: v.StringSchema<undefined>;
79
+ readonly type: v.OptionalSchema<v.LiteralSchema<"text", undefined>, "text">;
80
+ }, undefined>, undefined>;
81
+ }, undefined>, v.ObjectSchema<{
82
+ readonly role: v.OptionalSchema<v.LiteralSchema<"user", undefined>, "user">;
83
+ readonly content: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
84
+ readonly text: v.StringSchema<undefined>;
85
+ readonly type: v.OptionalSchema<v.LiteralSchema<"text", undefined>, "text">;
86
+ }, undefined>, v.ObjectSchema<{
87
+ readonly image_url: v.ObjectSchema<{
88
+ readonly url: v.StringSchema<undefined>;
89
+ readonly detail: v.OptionalSchema<v.PicklistSchema<["auto", "low", "high"], undefined>, undefined>;
90
+ }, undefined>;
91
+ readonly type: v.OptionalSchema<v.LiteralSchema<"image_url", undefined>, "image_url">;
92
+ }, undefined>], undefined>, undefined>;
93
+ }, undefined>, v.ObjectSchema<{
94
+ readonly role: v.OptionalSchema<v.LiteralSchema<"assistant", undefined>, "assistant">;
95
+ readonly content: v.ArraySchema<v.ObjectSchema<{
96
+ readonly text: v.StringSchema<undefined>;
97
+ readonly type: v.OptionalSchema<v.LiteralSchema<"text", undefined>, "text">;
98
+ }, undefined>, undefined>;
99
+ readonly thinkContent: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
100
+ }, undefined>], undefined>;
101
+ export type ChatMessageItemType = v.InferOutput<typeof ChatMessageItemDefine>;
102
+ export declare const ChatMessageListDefine: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
103
+ readonly role: v.OptionalSchema<v.LiteralSchema<"system", undefined>, "system">;
104
+ readonly content: v.ArraySchema<v.ObjectSchema<{
105
+ readonly text: v.StringSchema<undefined>;
106
+ readonly type: v.OptionalSchema<v.LiteralSchema<"text", undefined>, "text">;
107
+ }, undefined>, undefined>;
108
+ }, undefined>, v.ObjectSchema<{
109
+ readonly role: v.OptionalSchema<v.LiteralSchema<"user", undefined>, "user">;
110
+ readonly content: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
111
+ readonly text: v.StringSchema<undefined>;
112
+ readonly type: v.OptionalSchema<v.LiteralSchema<"text", undefined>, "text">;
113
+ }, undefined>, v.ObjectSchema<{
114
+ readonly image_url: v.ObjectSchema<{
115
+ readonly url: v.StringSchema<undefined>;
116
+ readonly detail: v.OptionalSchema<v.PicklistSchema<["auto", "low", "high"], undefined>, undefined>;
117
+ }, undefined>;
118
+ readonly type: v.OptionalSchema<v.LiteralSchema<"image_url", undefined>, "image_url">;
119
+ }, undefined>], undefined>, undefined>;
120
+ }, undefined>, v.ObjectSchema<{
121
+ readonly role: v.OptionalSchema<v.LiteralSchema<"assistant", undefined>, "assistant">;
122
+ readonly content: v.ArraySchema<v.ObjectSchema<{
123
+ readonly text: v.StringSchema<undefined>;
124
+ readonly type: v.OptionalSchema<v.LiteralSchema<"text", undefined>, "text">;
125
+ }, undefined>, undefined>;
126
+ readonly thinkContent: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
127
+ }, undefined>], undefined>, undefined>;
128
+ export type ChatMessageListOutputType = v.InferOutput<typeof ChatMessageListDefine>;
129
+ export type ChatMessageListInputType = v.InferOutput<typeof ChatMessageListDefine>;
@@ -0,0 +1,8 @@
1
+ import { ChatHistoryService } from './chat.history.service';
2
+ import { ChatProviderService } from './service';
3
+ export declare const OPENAI_MODULE: {
4
+ provider: (typeof ChatHistoryService | typeof ChatProviderService)[];
5
+ token: {
6
+ OpenAIConfigToken: import("static-injector").InjectionToken<import("static-injector").Signal<import("./type").OpenAIConfig>>;
7
+ };
8
+ };