supercompat 1.5.1 → 2.1.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/index.cjs +2236 -1718
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +66 -57
- package/dist/index.d.ts +66 -57
- package/dist/index.js +2224 -1709
- package/dist/index.js.map +1 -1
- package/dist/supercompat.cjs +123 -1
- package/dist/supercompat.cjs.map +1 -1
- package/dist/supercompat.d.cts +6 -4
- package/dist/supercompat.d.ts +6 -4
- package/dist/supercompat.js +111 -1
- package/dist/supercompat.js.map +1 -1
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +2 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/prisma.cjs.map +1 -1
- package/dist/types/prisma.d.cts +2 -0
- package/dist/types/prisma.d.ts +2 -0
- package/dist/types/prisma.js.map +1 -1
- package/package.json +11 -8
package/dist/index.d.cts
CHANGED
|
@@ -1,64 +1,57 @@
|
|
|
1
1
|
export { supercompat } from './supercompat.cjs';
|
|
2
|
-
import * as openai_resources_chat_completions from 'openai/resources/chat/completions';
|
|
3
2
|
import OpenAI from 'openai';
|
|
4
|
-
import
|
|
3
|
+
import Mistral from '@mistralai/mistralai';
|
|
5
4
|
import Anthropic from '@anthropic-ai/sdk';
|
|
6
5
|
import { MessageWithRun, StorageAdapterArgs } from './types/index.cjs';
|
|
7
|
-
import * as
|
|
8
|
-
import * as
|
|
9
|
-
import * as
|
|
10
|
-
import * as
|
|
11
|
-
import * as
|
|
12
|
-
import * as
|
|
13
|
-
import * as openai_resources_beta_threads_threads from 'openai/resources/beta/threads/threads';
|
|
14
|
-
import * as openai_core from 'openai/core';
|
|
6
|
+
import * as openai_streaming_mjs from 'openai/streaming.mjs';
|
|
7
|
+
import * as openai_resources_beta_assistants_mjs from 'openai/resources/beta/assistants.mjs';
|
|
8
|
+
import * as openai_resources_beta_threads_runs_runs_mjs from 'openai/resources/beta/threads/runs/runs.mjs';
|
|
9
|
+
import * as openai_resources_beta_threads_messages_mjs from 'openai/resources/beta/threads/messages.mjs';
|
|
10
|
+
import * as openai_resources_beta_threads_threads_mjs from 'openai/resources/beta/threads/threads.mjs';
|
|
11
|
+
import * as openai_core_mjs from 'openai/core.mjs';
|
|
15
12
|
import { PrismaClient } from '@prisma/client';
|
|
16
13
|
|
|
14
|
+
declare const groqClientAdapter: ({ groq, }: {
|
|
15
|
+
groq: any;
|
|
16
|
+
}) => {
|
|
17
|
+
'^/v1/chat/completions$': {
|
|
18
|
+
post: (_url: string, options: any) => Promise<Response>;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
declare const openaiClientAdapter: ({ openai, }: {
|
|
23
|
+
openai: OpenAI;
|
|
24
|
+
}) => {
|
|
25
|
+
'^/v1/chat/completions$': {
|
|
26
|
+
post: (_url: string, options: any) => Promise<Response>;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
|
|
17
30
|
declare const mistralClientAdapter: ({ mistral, }: {
|
|
18
|
-
mistral:
|
|
31
|
+
mistral: Mistral;
|
|
19
32
|
}) => {
|
|
20
|
-
chat: {
|
|
21
|
-
|
|
22
|
-
create: (body: openai_resources_chat_completions.ChatCompletionCreateParamsBase, options?: OpenAI.RequestOptions<unknown> | undefined) => ReturnType<OpenAI.Chat.Completions['create']>;
|
|
23
|
-
};
|
|
33
|
+
'^/v1/chat/completions$': {
|
|
34
|
+
post: (_url: string, options: any) => Promise<Response>;
|
|
24
35
|
};
|
|
25
36
|
};
|
|
26
37
|
|
|
27
38
|
declare const perplexityClientAdapter: ({ perplexity, }: {
|
|
28
39
|
perplexity: OpenAI;
|
|
29
40
|
}) => {
|
|
30
|
-
chat: {
|
|
31
|
-
|
|
32
|
-
create: (body: openai_resources_chat_completions.ChatCompletionCreateParamsBase, options?: OpenAI.RequestOptions<unknown> | undefined) => ReturnType<OpenAI.Chat.Completions['create']>;
|
|
33
|
-
};
|
|
41
|
+
'^/v1/chat/completions$': {
|
|
42
|
+
post: (_url: string, options: any) => Promise<Response>;
|
|
34
43
|
};
|
|
35
44
|
};
|
|
36
45
|
|
|
37
46
|
declare const anthropicClientAdapter: ({ anthropic, }: {
|
|
38
47
|
anthropic: Anthropic;
|
|
39
48
|
}) => {
|
|
40
|
-
chat: {
|
|
41
|
-
|
|
42
|
-
create: (body: openai_resources_chat_completions.ChatCompletionCreateParamsBase, options?: OpenAI.RequestOptions<unknown> | undefined) => ReturnType<OpenAI.Chat.Completions['create']>;
|
|
43
|
-
};
|
|
49
|
+
'^/v1/chat/completions$': {
|
|
50
|
+
post: (_url: string, options: any) => Promise<Response>;
|
|
44
51
|
};
|
|
45
52
|
};
|
|
46
53
|
|
|
47
|
-
declare const completionsRunAdapter: ({
|
|
48
|
-
messagesHistoryLength?: number | undefined;
|
|
49
|
-
maxTokens?: number | undefined;
|
|
50
|
-
}) => ({ client, run, onEvent, getMessages, responseFormat, }: {
|
|
51
|
-
client: OpenAI;
|
|
52
|
-
run: OpenAI.Beta.Threads.Run;
|
|
53
|
-
onEvent: (event: OpenAI.Beta.AssistantStreamEvent) => Promise<any>;
|
|
54
|
-
getMessages: () => Promise<MessageWithRun[]>;
|
|
55
|
-
responseFormat?: OpenAI.Beta.Threads.AssistantResponseFormatOption | null | undefined;
|
|
56
|
-
}) => Promise<any>;
|
|
57
|
-
|
|
58
|
-
declare const anthropicRunAdapter: ({ messagesHistoryLength, maxTokens, }: {
|
|
59
|
-
messagesHistoryLength?: number | undefined;
|
|
60
|
-
maxTokens?: number | undefined;
|
|
61
|
-
}) => ({ client, run, onEvent, getMessages, }: {
|
|
54
|
+
declare const completionsRunAdapter: () => ({ client: clientAdapter, run, onEvent, getMessages, }: {
|
|
62
55
|
client: OpenAI;
|
|
63
56
|
run: OpenAI.Beta.Threads.Run;
|
|
64
57
|
onEvent: (event: OpenAI.Beta.AssistantStreamEvent) => Promise<any>;
|
|
@@ -68,25 +61,41 @@ declare const anthropicRunAdapter: ({ messagesHistoryLength, maxTokens, }: {
|
|
|
68
61
|
declare const prismaStorageAdapter: ({ prisma, }: {
|
|
69
62
|
prisma: PrismaClient;
|
|
70
63
|
}) => ({ runAdapter, }: StorageAdapterArgs) => {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
64
|
+
'^/v1/threads$': {
|
|
65
|
+
post: (options?: openai_core_mjs.RequestOptions<unknown> | undefined) => Promise<Response & {
|
|
66
|
+
json: () => Promise<{
|
|
67
|
+
(body?: openai_resources_beta_threads_threads_mjs.ThreadCreateParams | undefined, options?: openai_core_mjs.RequestOptions<unknown> | undefined): openai_core_mjs.APIPromise<openai_resources_beta_threads_threads_mjs.Thread>;
|
|
68
|
+
(options?: openai_core_mjs.RequestOptions<unknown> | undefined): openai_core_mjs.APIPromise<openai_resources_beta_threads_threads_mjs.Thread>;
|
|
69
|
+
}>;
|
|
70
|
+
}>;
|
|
71
|
+
};
|
|
72
|
+
'^/v1/threads/([^/]+)/messages$': {
|
|
73
|
+
post: (urlString: string, options: any) => Promise<Response & {
|
|
74
|
+
json: () => Promise<openai_core_mjs.APIPromise<openai_resources_beta_threads_messages_mjs.Message>>;
|
|
75
|
+
}>;
|
|
76
|
+
get: (urlString: string) => Promise<Response & {
|
|
77
|
+
json: () => Promise<openai_core_mjs.APIPromise<openai_resources_beta_threads_messages_mjs.Message>>;
|
|
78
|
+
}>;
|
|
79
|
+
};
|
|
80
|
+
'^/v1/threads/([^/]+)/runs$': {
|
|
81
|
+
get: (urlString: string) => Promise<Response & {
|
|
82
|
+
json: () => Promise<openai_core_mjs.APIPromise<openai_resources_beta_threads_messages_mjs.Message>>;
|
|
83
|
+
}>;
|
|
84
|
+
post: (urlString: string, options: any) => Promise<Response & {
|
|
85
|
+
json: () => Promise<openai_core_mjs.APIPromise<openai_resources_beta_threads_runs_runs_mjs.Run | openai_streaming_mjs.Stream<openai_resources_beta_assistants_mjs.AssistantStreamEvent>>>;
|
|
86
|
+
}>;
|
|
87
|
+
};
|
|
88
|
+
'^/v1/threads/([^/]+)/runs/([^/]+)$': {
|
|
89
|
+
get: (urlString: string) => Promise<Response & {
|
|
90
|
+
json: () => Promise<openai_core_mjs.APIPromise<openai_resources_beta_threads_runs_runs_mjs.Run>>;
|
|
91
|
+
}>;
|
|
92
|
+
};
|
|
93
|
+
'^/v1/threads/([^/]+)/runs/([^/]+)/steps$': {
|
|
94
|
+
get: (urlString: string) => Promise<Response>;
|
|
95
|
+
};
|
|
96
|
+
'^/v1/threads/([^/]+)/runs/([^/]+)/submit_tool_outputs$': {
|
|
97
|
+
post: (urlString: string, options: any) => Promise<Response>;
|
|
89
98
|
};
|
|
90
99
|
};
|
|
91
100
|
|
|
92
|
-
export { anthropicClientAdapter,
|
|
101
|
+
export { anthropicClientAdapter, completionsRunAdapter, groqClientAdapter, mistralClientAdapter, openaiClientAdapter, perplexityClientAdapter, prismaStorageAdapter };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,64 +1,57 @@
|
|
|
1
1
|
export { supercompat } from './supercompat.js';
|
|
2
|
-
import * as openai_resources_chat_completions from 'openai/resources/chat/completions';
|
|
3
2
|
import OpenAI from 'openai';
|
|
4
|
-
import
|
|
3
|
+
import Mistral from '@mistralai/mistralai';
|
|
5
4
|
import Anthropic from '@anthropic-ai/sdk';
|
|
6
5
|
import { MessageWithRun, StorageAdapterArgs } from './types/index.js';
|
|
7
|
-
import * as
|
|
8
|
-
import * as
|
|
9
|
-
import * as
|
|
10
|
-
import * as
|
|
11
|
-
import * as
|
|
12
|
-
import * as
|
|
13
|
-
import * as openai_resources_beta_threads_threads from 'openai/resources/beta/threads/threads';
|
|
14
|
-
import * as openai_core from 'openai/core';
|
|
6
|
+
import * as openai_streaming_mjs from 'openai/streaming.mjs';
|
|
7
|
+
import * as openai_resources_beta_assistants_mjs from 'openai/resources/beta/assistants.mjs';
|
|
8
|
+
import * as openai_resources_beta_threads_runs_runs_mjs from 'openai/resources/beta/threads/runs/runs.mjs';
|
|
9
|
+
import * as openai_resources_beta_threads_messages_mjs from 'openai/resources/beta/threads/messages.mjs';
|
|
10
|
+
import * as openai_resources_beta_threads_threads_mjs from 'openai/resources/beta/threads/threads.mjs';
|
|
11
|
+
import * as openai_core_mjs from 'openai/core.mjs';
|
|
15
12
|
import { PrismaClient } from '@prisma/client';
|
|
16
13
|
|
|
14
|
+
declare const groqClientAdapter: ({ groq, }: {
|
|
15
|
+
groq: any;
|
|
16
|
+
}) => {
|
|
17
|
+
'^/v1/chat/completions$': {
|
|
18
|
+
post: (_url: string, options: any) => Promise<Response>;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
declare const openaiClientAdapter: ({ openai, }: {
|
|
23
|
+
openai: OpenAI;
|
|
24
|
+
}) => {
|
|
25
|
+
'^/v1/chat/completions$': {
|
|
26
|
+
post: (_url: string, options: any) => Promise<Response>;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
|
|
17
30
|
declare const mistralClientAdapter: ({ mistral, }: {
|
|
18
|
-
mistral:
|
|
31
|
+
mistral: Mistral;
|
|
19
32
|
}) => {
|
|
20
|
-
chat: {
|
|
21
|
-
|
|
22
|
-
create: (body: openai_resources_chat_completions.ChatCompletionCreateParamsBase, options?: OpenAI.RequestOptions<unknown> | undefined) => ReturnType<OpenAI.Chat.Completions['create']>;
|
|
23
|
-
};
|
|
33
|
+
'^/v1/chat/completions$': {
|
|
34
|
+
post: (_url: string, options: any) => Promise<Response>;
|
|
24
35
|
};
|
|
25
36
|
};
|
|
26
37
|
|
|
27
38
|
declare const perplexityClientAdapter: ({ perplexity, }: {
|
|
28
39
|
perplexity: OpenAI;
|
|
29
40
|
}) => {
|
|
30
|
-
chat: {
|
|
31
|
-
|
|
32
|
-
create: (body: openai_resources_chat_completions.ChatCompletionCreateParamsBase, options?: OpenAI.RequestOptions<unknown> | undefined) => ReturnType<OpenAI.Chat.Completions['create']>;
|
|
33
|
-
};
|
|
41
|
+
'^/v1/chat/completions$': {
|
|
42
|
+
post: (_url: string, options: any) => Promise<Response>;
|
|
34
43
|
};
|
|
35
44
|
};
|
|
36
45
|
|
|
37
46
|
declare const anthropicClientAdapter: ({ anthropic, }: {
|
|
38
47
|
anthropic: Anthropic;
|
|
39
48
|
}) => {
|
|
40
|
-
chat: {
|
|
41
|
-
|
|
42
|
-
create: (body: openai_resources_chat_completions.ChatCompletionCreateParamsBase, options?: OpenAI.RequestOptions<unknown> | undefined) => ReturnType<OpenAI.Chat.Completions['create']>;
|
|
43
|
-
};
|
|
49
|
+
'^/v1/chat/completions$': {
|
|
50
|
+
post: (_url: string, options: any) => Promise<Response>;
|
|
44
51
|
};
|
|
45
52
|
};
|
|
46
53
|
|
|
47
|
-
declare const completionsRunAdapter: ({
|
|
48
|
-
messagesHistoryLength?: number | undefined;
|
|
49
|
-
maxTokens?: number | undefined;
|
|
50
|
-
}) => ({ client, run, onEvent, getMessages, responseFormat, }: {
|
|
51
|
-
client: OpenAI;
|
|
52
|
-
run: OpenAI.Beta.Threads.Run;
|
|
53
|
-
onEvent: (event: OpenAI.Beta.AssistantStreamEvent) => Promise<any>;
|
|
54
|
-
getMessages: () => Promise<MessageWithRun[]>;
|
|
55
|
-
responseFormat?: OpenAI.Beta.Threads.AssistantResponseFormatOption | null | undefined;
|
|
56
|
-
}) => Promise<any>;
|
|
57
|
-
|
|
58
|
-
declare const anthropicRunAdapter: ({ messagesHistoryLength, maxTokens, }: {
|
|
59
|
-
messagesHistoryLength?: number | undefined;
|
|
60
|
-
maxTokens?: number | undefined;
|
|
61
|
-
}) => ({ client, run, onEvent, getMessages, }: {
|
|
54
|
+
declare const completionsRunAdapter: () => ({ client: clientAdapter, run, onEvent, getMessages, }: {
|
|
62
55
|
client: OpenAI;
|
|
63
56
|
run: OpenAI.Beta.Threads.Run;
|
|
64
57
|
onEvent: (event: OpenAI.Beta.AssistantStreamEvent) => Promise<any>;
|
|
@@ -68,25 +61,41 @@ declare const anthropicRunAdapter: ({ messagesHistoryLength, maxTokens, }: {
|
|
|
68
61
|
declare const prismaStorageAdapter: ({ prisma, }: {
|
|
69
62
|
prisma: PrismaClient;
|
|
70
63
|
}) => ({ runAdapter, }: StorageAdapterArgs) => {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
64
|
+
'^/v1/threads$': {
|
|
65
|
+
post: (options?: openai_core_mjs.RequestOptions<unknown> | undefined) => Promise<Response & {
|
|
66
|
+
json: () => Promise<{
|
|
67
|
+
(body?: openai_resources_beta_threads_threads_mjs.ThreadCreateParams | undefined, options?: openai_core_mjs.RequestOptions<unknown> | undefined): openai_core_mjs.APIPromise<openai_resources_beta_threads_threads_mjs.Thread>;
|
|
68
|
+
(options?: openai_core_mjs.RequestOptions<unknown> | undefined): openai_core_mjs.APIPromise<openai_resources_beta_threads_threads_mjs.Thread>;
|
|
69
|
+
}>;
|
|
70
|
+
}>;
|
|
71
|
+
};
|
|
72
|
+
'^/v1/threads/([^/]+)/messages$': {
|
|
73
|
+
post: (urlString: string, options: any) => Promise<Response & {
|
|
74
|
+
json: () => Promise<openai_core_mjs.APIPromise<openai_resources_beta_threads_messages_mjs.Message>>;
|
|
75
|
+
}>;
|
|
76
|
+
get: (urlString: string) => Promise<Response & {
|
|
77
|
+
json: () => Promise<openai_core_mjs.APIPromise<openai_resources_beta_threads_messages_mjs.Message>>;
|
|
78
|
+
}>;
|
|
79
|
+
};
|
|
80
|
+
'^/v1/threads/([^/]+)/runs$': {
|
|
81
|
+
get: (urlString: string) => Promise<Response & {
|
|
82
|
+
json: () => Promise<openai_core_mjs.APIPromise<openai_resources_beta_threads_messages_mjs.Message>>;
|
|
83
|
+
}>;
|
|
84
|
+
post: (urlString: string, options: any) => Promise<Response & {
|
|
85
|
+
json: () => Promise<openai_core_mjs.APIPromise<openai_resources_beta_threads_runs_runs_mjs.Run | openai_streaming_mjs.Stream<openai_resources_beta_assistants_mjs.AssistantStreamEvent>>>;
|
|
86
|
+
}>;
|
|
87
|
+
};
|
|
88
|
+
'^/v1/threads/([^/]+)/runs/([^/]+)$': {
|
|
89
|
+
get: (urlString: string) => Promise<Response & {
|
|
90
|
+
json: () => Promise<openai_core_mjs.APIPromise<openai_resources_beta_threads_runs_runs_mjs.Run>>;
|
|
91
|
+
}>;
|
|
92
|
+
};
|
|
93
|
+
'^/v1/threads/([^/]+)/runs/([^/]+)/steps$': {
|
|
94
|
+
get: (urlString: string) => Promise<Response>;
|
|
95
|
+
};
|
|
96
|
+
'^/v1/threads/([^/]+)/runs/([^/]+)/submit_tool_outputs$': {
|
|
97
|
+
post: (urlString: string, options: any) => Promise<Response>;
|
|
89
98
|
};
|
|
90
99
|
};
|
|
91
100
|
|
|
92
|
-
export { anthropicClientAdapter,
|
|
101
|
+
export { anthropicClientAdapter, completionsRunAdapter, groqClientAdapter, mistralClientAdapter, openaiClientAdapter, perplexityClientAdapter, prismaStorageAdapter };
|