@p-sw/brainbox 0.1.0 → 0.1.1

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.
Files changed (92) hide show
  1. package/dist/index.js +5312 -0
  2. package/package.json +7 -4
  3. package/scripts/smoke_providers.ts +0 -176
  4. package/src/brain/index.ts +0 -936
  5. package/src/brain/manager.ts +0 -144
  6. package/src/brain/memory.ts +0 -99
  7. package/src/brain/messageHistory.ts +0 -26
  8. package/src/brain/schedule.ts +0 -11
  9. package/src/brain/types.ts +0 -26
  10. package/src/channel/base.ts +0 -527
  11. package/src/channel/discord.ts +0 -227
  12. package/src/channel/telegram.ts +0 -150
  13. package/src/commands/auth.tsx +0 -306
  14. package/src/commands/brain.ts +0 -119
  15. package/src/commands/daemon/commands.ts +0 -56
  16. package/src/commands/daemon/pairingCommand.ts +0 -15
  17. package/src/commands/daemon/restartCommand.ts +0 -17
  18. package/src/commands/daemon.ts +0 -168
  19. package/src/commands/index.ts +0 -16
  20. package/src/commands/model.tsx +0 -138
  21. package/src/commands/onboard.tsx +0 -473
  22. package/src/commands/pairing.ts +0 -32
  23. package/src/commands/restart.ts +0 -24
  24. package/src/config/file/auth.ts +0 -105
  25. package/src/config/file/root.ts +0 -37
  26. package/src/config/index.ts +0 -21
  27. package/src/config/loader.ts +0 -115
  28. package/src/index.ts +0 -61
  29. package/src/provider/index.ts +0 -122
  30. package/src/provider/llm.ts +0 -191
  31. package/src/provider/promptLoader.ts +0 -36
  32. package/src/provider/providers/302ai.ts +0 -17
  33. package/src/provider/providers/MiniMax.ts +0 -17
  34. package/src/provider/providers/anthropic.ts +0 -257
  35. package/src/provider/providers/azure_cognitive.ts +0 -40
  36. package/src/provider/providers/azure_openai.ts +0 -49
  37. package/src/provider/providers/baseten.ts +0 -17
  38. package/src/provider/providers/bedrock.ts +0 -312
  39. package/src/provider/providers/cerebras.ts +0 -17
  40. package/src/provider/providers/cloudflare_gateway.ts +0 -34
  41. package/src/provider/providers/cloudflare_workers.ts +0 -178
  42. package/src/provider/providers/copilot.ts +0 -22
  43. package/src/provider/providers/cortecs.ts +0 -17
  44. package/src/provider/providers/deepinfra.ts +0 -17
  45. package/src/provider/providers/deepseek.ts +0 -17
  46. package/src/provider/providers/digitalocean.ts +0 -17
  47. package/src/provider/providers/fireworks.ts +0 -17
  48. package/src/provider/providers/gitlab_duo.ts +0 -184
  49. package/src/provider/providers/gmi.ts +0 -17
  50. package/src/provider/providers/groq.ts +0 -17
  51. package/src/provider/providers/helicone.ts +0 -17
  52. package/src/provider/providers/huggingface.ts +0 -17
  53. package/src/provider/providers/ionet.ts +0 -17
  54. package/src/provider/providers/llamacpp.ts +0 -17
  55. package/src/provider/providers/llmgateway.ts +0 -17
  56. package/src/provider/providers/lmstudio.ts +0 -17
  57. package/src/provider/providers/mistral.ts +0 -17
  58. package/src/provider/providers/moonshot.ts +0 -17
  59. package/src/provider/providers/nebius.ts +0 -17
  60. package/src/provider/providers/nvidia.ts +0 -17
  61. package/src/provider/providers/ollama.ts +0 -17
  62. package/src/provider/providers/ollama_cloud.ts +0 -17
  63. package/src/provider/providers/openai.ts +0 -17
  64. package/src/provider/providers/openai_compatible.ts +0 -293
  65. package/src/provider/providers/openrouter.ts +0 -175
  66. package/src/provider/providers/ovhcloud.ts +0 -17
  67. package/src/provider/providers/sap_aicore.ts +0 -22
  68. package/src/provider/providers/scaleway.ts +0 -17
  69. package/src/provider/providers/snowflake_cortex.ts +0 -207
  70. package/src/provider/providers/stackit.ts +0 -17
  71. package/src/provider/providers/together.ts +0 -17
  72. package/src/provider/providers/venice.ts +0 -17
  73. package/src/provider/providers/vercel.ts +0 -17
  74. package/src/provider/providers/vertex.ts +0 -229
  75. package/src/provider/providers/xai.ts +0 -17
  76. package/src/provider/providers/zai.ts +0 -17
  77. package/src/provider/providers/zenmux.ts +0 -17
  78. package/src/provider/schema.ts +0 -143
  79. package/src/ui/TextInput.tsx +0 -114
  80. package/src/utils/daemonClient.ts +0 -85
  81. package/src/utils/logger.ts +0 -204
  82. package/tsconfig.json +0 -34
  83. /package/{prompts → dist/prompts}/daily_schedule.md +0 -0
  84. /package/{prompts → dist/prompts}/memoir.md +0 -0
  85. /package/{prompts → dist/prompts}/monthly_schedule.md +0 -0
  86. /package/{prompts → dist/prompts}/objectifier.md +0 -0
  87. /package/{prompts → dist/prompts}/persona_base_system_prompt.md +0 -0
  88. /package/{prompts → dist/prompts}/persona_base_system_prompt_fixed.md +0 -0
  89. /package/{prompts → dist/prompts}/persona_init.md +0 -0
  90. /package/{prompts → dist/prompts}/schedule_availability.md +0 -0
  91. /package/{prompts → dist/prompts}/send_message.md +0 -0
  92. /package/{prompts → dist/prompts}/start_conversation.md +0 -0
@@ -1,34 +0,0 @@
1
- import { OpenAICompatibleExecutor } from "./openai_compatible";
2
- import { readAuthString } from "../llm";
3
-
4
- export class CloudflareGatewayExecutor extends OpenAICompatibleExecutor {
5
- constructor(opts: {
6
- apiKey: string;
7
- conversationModel: string;
8
- identityModel: string;
9
- auth?: Record<string, unknown>;
10
- }) {
11
- const accountId = readAuthString(
12
- opts.auth,
13
- "accountId",
14
- "CLOUDFLARE_ACCOUNT_ID",
15
- );
16
- const gatewayId = readAuthString(
17
- opts.auth,
18
- "gatewayId",
19
- "CLOUDFLARE_GATEWAY_ID",
20
- );
21
- const baseURL =
22
- accountId && gatewayId
23
- ? `https://gateway.ai.cloudflare.com/v1/${accountId}/${gatewayId}/openai`
24
- : readAuthString(opts.auth, "baseURL", "CLOUDFLARE_AI_GATEWAY_URL") ||
25
- "https://gateway.ai.cloudflare.com/v1";
26
- super({
27
- providerName: "cloudflare-gateway",
28
- baseURL,
29
- apiKey: opts.apiKey,
30
- conversationModel: opts.conversationModel,
31
- identityModel: opts.identityModel,
32
- });
33
- }
34
- }
@@ -1,178 +0,0 @@
1
- import { logger } from "@/utils/logger";
2
- import {
3
- LLMExecutor,
4
- defaultReasoningEffort,
5
- readAuthString,
6
- type CallOptions,
7
- type ChatChoice,
8
- type ChatMessages,
9
- type ChatWithToolsOptions,
10
- type ToolCall,
11
- } from "../llm";
12
-
13
- type ChatMessageWire =
14
- | { role: "system" | "user"; content: string }
15
- | { role: "assistant"; content: string }
16
- | { role: "tool"; content: string; tool_call_id: string };
17
-
18
- type CloudflareResponse = {
19
- result?: {
20
- response?: string;
21
- tool_calls?: Array<{
22
- name?: string;
23
- arguments?: unknown;
24
- }>;
25
- };
26
- errors?: Array<{ message: string }>;
27
- success?: boolean;
28
- };
29
-
30
- function toCloudflareMessage(m: ChatMessages): ChatMessageWire {
31
- if (m.role === "assistant") {
32
- return { role: "assistant", content: m.content ?? "" };
33
- }
34
- if (m.role === "tool") {
35
- return { role: "tool", content: m.content, tool_call_id: m.toolCallId };
36
- }
37
- return { role: m.role, content: m.content };
38
- }
39
-
40
- export class CloudflareWorkersExecutor extends LLMExecutor {
41
- readonly providerName = "cloudflare-workers";
42
- readonly models: { conversation: string; identity: string };
43
-
44
- private readonly apiKey: string;
45
- private readonly baseURL: string;
46
-
47
- constructor(opts: {
48
- apiKey: string;
49
- conversationModel: string;
50
- identityModel: string;
51
- auth?: Record<string, unknown>;
52
- }) {
53
- super();
54
- this.models = {
55
- conversation: opts.conversationModel,
56
- identity: opts.identityModel,
57
- };
58
- this.apiKey = opts.apiKey;
59
- const accountId = readAuthString(
60
- opts.auth,
61
- "accountId",
62
- "CLOUDFLARE_ACCOUNT_ID",
63
- );
64
- this.baseURL = accountId
65
- ? `https://api.cloudflare.com/client/v4/accounts/${accountId}/ai/run`
66
- : "https://api.cloudflare.com/client/v4/accounts/__cf_account_id__/ai/run";
67
- }
68
-
69
- private async run(
70
- model: string,
71
- body: Record<string, unknown>,
72
- ): Promise<CloudflareResponse> {
73
- const url = `${this.baseURL}/${encodeURIComponent(model)}`;
74
- const res = await fetch(url, {
75
- method: "POST",
76
- headers: {
77
- Authorization: `Bearer ${this.apiKey}`,
78
- "Content-Type": "application/json",
79
- },
80
- body: JSON.stringify(body),
81
- });
82
- if (!res.ok) {
83
- const text = await res.text().catch(() => "");
84
- throw new Error(
85
- `cloudflare-workers request failed: ${res.status} ${res.statusText} body=${text.slice(0, 500)}`,
86
- );
87
- }
88
- return (await res.json()) as CloudflareResponse;
89
- }
90
-
91
- async call<T>(model: string, options: CallOptions): Promise<T> {
92
- const jsonMode = "jsonSchemaName" in options;
93
- const reasoning = defaultReasoningEffort(
94
- options.reasoningEffort,
95
- model,
96
- this.models.identity,
97
- );
98
- const log = logger.child("llm:cloudflare-workers");
99
- log.debug(
100
- `call: model=${model} jsonSchema=${jsonMode ? options.jsonSchemaName : "-"} msgLen=${options.message.length}`,
101
- );
102
- const messages: ChatMessageWire[] = [
103
- { role: "system", content: options.instruction },
104
- { role: "user", content: options.message },
105
- ];
106
- const body: Record<string, unknown> = { messages };
107
- if (jsonMode) {
108
- body["response_format"] = {
109
- type: "json_schema",
110
- schema: options.jsonSchema,
111
- };
112
- }
113
- if (reasoning !== "none") {
114
- body["reasoning_effort"] = reasoning;
115
- }
116
- const data = await this.run(model, body);
117
- if (data.errors && data.errors.length > 0) {
118
- throw new Error(
119
- `cloudflare-workers API error: ${data.errors.map((e) => e.message).join("; ")}`,
120
- );
121
- }
122
- const content = data.result?.response ?? "";
123
- if (!content) {
124
- throw new Error("Empty response from model");
125
- }
126
- return (jsonMode ? JSON.parse(content) : content) as T;
127
- }
128
-
129
- async chatWithTools(
130
- model: string,
131
- options: ChatWithToolsOptions,
132
- ): Promise<ChatChoice> {
133
- const reasoning = defaultReasoningEffort(
134
- options.reasoningEffort,
135
- model,
136
- this.models.identity,
137
- );
138
- const log = logger.child("llm:cloudflare-workers");
139
- log.debug(
140
- `chatWithTools: model=${model} msgs=${options.messages.length} tools=${options.tools.length}`,
141
- );
142
- const messages: ChatMessageWire[] = [
143
- { role: "system", content: options.instruction },
144
- ...options.messages.map(toCloudflareMessage),
145
- ];
146
- const body: Record<string, unknown> = {
147
- messages,
148
- tools: options.tools.map((t) => ({
149
- name: t.name,
150
- description: t.description,
151
- parameters: t.parameters,
152
- })),
153
- };
154
- if (reasoning !== "none") {
155
- body["reasoning_effort"] = reasoning;
156
- }
157
- const data = await this.run(model, body);
158
- if (data.errors && data.errors.length > 0) {
159
- throw new Error(
160
- `cloudflare-workers API error: ${data.errors.map((e) => e.message).join("; ")}`,
161
- );
162
- }
163
- const content = data.result?.response ?? "";
164
- const toolCalls: ToolCall[] | undefined = data.result?.tool_calls?.map(
165
- (c, idx) => ({
166
- id: `call_${idx}`,
167
- function: {
168
- name: c.name ?? "",
169
- arguments:
170
- typeof c.arguments === "string"
171
- ? c.arguments
172
- : JSON.stringify(c.arguments ?? {}),
173
- },
174
- }),
175
- );
176
- return { message: { content: content || undefined, toolCalls } };
177
- }
178
- }
@@ -1,22 +0,0 @@
1
- import { OpenAICompatibleExecutor } from "./openai_compatible";
2
-
3
- export class CopilotExecutor extends OpenAICompatibleExecutor {
4
- constructor(opts: {
5
- apiKey: string;
6
- conversationModel: string;
7
- identityModel: string;
8
- }) {
9
- super({
10
- providerName: "copilot",
11
- baseURL: "https://api.githubcopilot.com",
12
- apiKey: opts.apiKey,
13
- conversationModel: opts.conversationModel,
14
- identityModel: opts.identityModel,
15
- defaultHeaders: {
16
- "Editor-Version": "vscode/1.85.1",
17
- "Editor-Plugin-Version": "copilot-chat/0.12.0",
18
- "Copilot-Integration-Id": "vscode-chat",
19
- },
20
- });
21
- }
22
- }
@@ -1,17 +0,0 @@
1
- import { OpenAICompatibleExecutor } from "./openai_compatible";
2
-
3
- export class CortecsExecutor extends OpenAICompatibleExecutor {
4
- constructor(opts: {
5
- apiKey: string;
6
- conversationModel: string;
7
- identityModel: string;
8
- }) {
9
- super({
10
- providerName: "cortecs",
11
- baseURL: "https://api.cortecs.ai/v1",
12
- apiKey: opts.apiKey,
13
- conversationModel: opts.conversationModel,
14
- identityModel: opts.identityModel,
15
- });
16
- }
17
- }
@@ -1,17 +0,0 @@
1
- import { OpenAICompatibleExecutor } from "./openai_compatible";
2
-
3
- export class DeepInfraExecutor extends OpenAICompatibleExecutor {
4
- constructor(opts: {
5
- apiKey: string;
6
- conversationModel: string;
7
- identityModel: string;
8
- }) {
9
- super({
10
- providerName: "deepinfra",
11
- baseURL: "https://api.deepinfra.com/v1/openai",
12
- apiKey: opts.apiKey,
13
- conversationModel: opts.conversationModel,
14
- identityModel: opts.identityModel,
15
- });
16
- }
17
- }
@@ -1,17 +0,0 @@
1
- import { OpenAICompatibleExecutor } from "./openai_compatible";
2
-
3
- export class DeepSeekExecutor extends OpenAICompatibleExecutor {
4
- constructor(opts: {
5
- apiKey: string;
6
- conversationModel: string;
7
- identityModel: string;
8
- }) {
9
- super({
10
- providerName: "deepseek",
11
- baseURL: "https://api.deepseek.com/v1",
12
- apiKey: opts.apiKey,
13
- conversationModel: opts.conversationModel,
14
- identityModel: opts.identityModel,
15
- });
16
- }
17
- }
@@ -1,17 +0,0 @@
1
- import { OpenAICompatibleExecutor } from "./openai_compatible";
2
-
3
- export class DigitalOceanExecutor extends OpenAICompatibleExecutor {
4
- constructor(opts: {
5
- apiKey: string;
6
- conversationModel: string;
7
- identityModel: string;
8
- }) {
9
- super({
10
- providerName: "digitalocean",
11
- baseURL: "https://api.digitalocean.com/v2/gen-ai/openai/v1",
12
- apiKey: opts.apiKey,
13
- conversationModel: opts.conversationModel,
14
- identityModel: opts.identityModel,
15
- });
16
- }
17
- }
@@ -1,17 +0,0 @@
1
- import { OpenAICompatibleExecutor } from "./openai_compatible";
2
-
3
- export class FireworksExecutor extends OpenAICompatibleExecutor {
4
- constructor(opts: {
5
- apiKey: string;
6
- conversationModel: string;
7
- identityModel: string;
8
- }) {
9
- super({
10
- providerName: "fireworks",
11
- baseURL: "https://api.fireworks.ai/inference/v1",
12
- apiKey: opts.apiKey,
13
- conversationModel: opts.conversationModel,
14
- identityModel: opts.identityModel,
15
- });
16
- }
17
- }
@@ -1,184 +0,0 @@
1
- import { logger } from "@/utils/logger";
2
- import { z } from "zod";
3
- import {
4
- LLMExecutor,
5
- readAuthString,
6
- type CallOptions,
7
- type ChatChoice,
8
- type ChatFunctionTool,
9
- type ChatMessages,
10
- type ChatWithToolsOptions,
11
- type ToolCall,
12
- } from "../llm";
13
-
14
- const GitLabAuthSchema = z
15
- .object({
16
- baseURL: z.string().optional(),
17
- })
18
- .loose();
19
-
20
- type MessageWire =
21
- | { role: "system" | "user"; content: string }
22
- | {
23
- role: "assistant";
24
- content: string | null;
25
- tool_calls?: Array<{
26
- id: string;
27
- type: "function";
28
- function: { name: string; arguments: string };
29
- }>;
30
- }
31
- | { role: "tool"; content: string; tool_call_id: string };
32
-
33
- type DuoResponse = {
34
- choices?: Array<{
35
- message?: {
36
- content?: string | null;
37
- tool_calls?: Array<{
38
- id: string;
39
- type: "function";
40
- function: { name: string; arguments: string };
41
- }>;
42
- };
43
- }>;
44
- error?: { message?: string };
45
- };
46
-
47
- function toMessage(m: ChatMessages): MessageWire {
48
- if (m.role === "assistant") {
49
- return {
50
- role: "assistant",
51
- content: m.content ?? null,
52
- tool_calls: m.toolCalls?.map((c) => ({
53
- id: c.id,
54
- type: "function",
55
- function: { name: c.function.name, arguments: c.function.arguments },
56
- })),
57
- };
58
- }
59
- if (m.role === "tool") {
60
- return { role: "tool", content: m.content, tool_call_id: m.toolCallId };
61
- }
62
- return { role: m.role, content: m.content };
63
- }
64
-
65
- function toTool(t: ChatFunctionTool) {
66
- return {
67
- type: "function" as const,
68
- function: {
69
- name: t.name,
70
- description: t.description ?? "",
71
- parameters: t.parameters ?? {},
72
- },
73
- };
74
- }
75
-
76
- export class GitLabDuoExecutor extends LLMExecutor {
77
- readonly providerName = "gitlab-duo";
78
- readonly models: { conversation: string; identity: string };
79
-
80
- private readonly apiKey: string;
81
- private readonly baseURL: string;
82
-
83
- constructor(opts: {
84
- apiKey: string;
85
- conversationModel: string;
86
- identityModel: string;
87
- auth?: Record<string, unknown>;
88
- }) {
89
- super();
90
- this.models = {
91
- conversation: opts.conversationModel,
92
- identity: opts.identityModel,
93
- };
94
- this.apiKey = opts.apiKey;
95
- const parsed = GitLabAuthSchema.safeParse(opts.auth ?? {});
96
- const extra = parsed.success ? parsed.data : {};
97
- this.baseURL = (
98
- extra.baseURL ??
99
- readAuthString(opts.auth, "baseURL", "GITLAB_BASE_URL") ??
100
- "https://gitlab.com/api/v4/ai/llm/proxy"
101
- ).replace(/\/+$/, "");
102
- }
103
-
104
- private async send(body: Record<string, unknown>): Promise<DuoResponse> {
105
- const res = await fetch(this.baseURL, {
106
- method: "POST",
107
- headers: {
108
- Authorization: `Bearer ${this.apiKey}`,
109
- "Content-Type": "application/json",
110
- },
111
- body: JSON.stringify(body),
112
- });
113
- if (!res.ok) {
114
- const text = await res.text().catch(() => "");
115
- throw new Error(
116
- `gitlab-duo request failed: ${res.status} ${res.statusText} body=${text.slice(0, 500)}`,
117
- );
118
- }
119
- return (await res.json()) as DuoResponse;
120
- }
121
-
122
- async call<T>(model: string, options: CallOptions): Promise<T> {
123
- const jsonMode = "jsonSchemaName" in options;
124
- const log = logger.child("llm:gitlab-duo");
125
- log.debug(
126
- `call: model=${model} jsonSchema=${jsonMode ? options.jsonSchemaName : "-"} msgLen=${options.message.length}`,
127
- );
128
- const body: Record<string, unknown> = {
129
- model,
130
- messages: [
131
- { role: "system", content: options.instruction },
132
- { role: "user", content: options.message },
133
- ],
134
- };
135
- const data = await this.send(body);
136
- if (data.error) {
137
- throw new Error(
138
- `gitlab-duo API error: ${data.error.message ?? "unknown"}`,
139
- );
140
- }
141
- const content = data.choices?.[0]?.message?.content ?? "";
142
- if (!content) {
143
- throw new Error("Empty response from model");
144
- }
145
- return (jsonMode ? JSON.parse(content) : content) as T;
146
- }
147
-
148
- async chatWithTools(
149
- model: string,
150
- options: ChatWithToolsOptions,
151
- ): Promise<ChatChoice> {
152
- const log = logger.child("llm:gitlab-duo");
153
- log.debug(
154
- `chatWithTools: model=${model} msgs=${options.messages.length} tools=${options.tools.length}`,
155
- );
156
- const body: Record<string, unknown> = {
157
- model,
158
- messages: [
159
- { role: "system", content: options.instruction },
160
- ...options.messages.map(toMessage),
161
- ],
162
- tools: options.tools.map(toTool),
163
- };
164
- const data = await this.send(body);
165
- if (data.error) {
166
- throw new Error(
167
- `gitlab-duo API error: ${data.error.message ?? "unknown"}`,
168
- );
169
- }
170
- const choice = data.choices?.[0];
171
- const toolCalls: ToolCall[] | undefined = choice?.message?.tool_calls?.map(
172
- (c) => ({
173
- id: c.id,
174
- function: { name: c.function.name, arguments: c.function.arguments },
175
- }),
176
- );
177
- return {
178
- message: {
179
- content: choice?.message?.content ?? undefined,
180
- toolCalls,
181
- },
182
- };
183
- }
184
- }
@@ -1,17 +0,0 @@
1
- import { OpenAICompatibleExecutor } from "./openai_compatible";
2
-
3
- export class GmiExecutor extends OpenAICompatibleExecutor {
4
- constructor(opts: {
5
- apiKey: string;
6
- conversationModel: string;
7
- identityModel: string;
8
- }) {
9
- super({
10
- providerName: "gmi",
11
- baseURL: "https://api.gmi-serving.com/v1",
12
- apiKey: opts.apiKey,
13
- conversationModel: opts.conversationModel,
14
- identityModel: opts.identityModel,
15
- });
16
- }
17
- }
@@ -1,17 +0,0 @@
1
- import { OpenAICompatibleExecutor } from "./openai_compatible";
2
-
3
- export class GroqExecutor extends OpenAICompatibleExecutor {
4
- constructor(opts: {
5
- apiKey: string;
6
- conversationModel: string;
7
- identityModel: string;
8
- }) {
9
- super({
10
- providerName: "groq",
11
- baseURL: "https://api.groq.com/openai/v1",
12
- apiKey: opts.apiKey,
13
- conversationModel: opts.conversationModel,
14
- identityModel: opts.identityModel,
15
- });
16
- }
17
- }
@@ -1,17 +0,0 @@
1
- import { OpenAICompatibleExecutor } from "./openai_compatible";
2
-
3
- export class HeliconeExecutor extends OpenAICompatibleExecutor {
4
- constructor(opts: {
5
- apiKey: string;
6
- conversationModel: string;
7
- identityModel: string;
8
- }) {
9
- super({
10
- providerName: "helicone",
11
- baseURL: "https://oai.helicone.ai/v1",
12
- apiKey: opts.apiKey,
13
- conversationModel: opts.conversationModel,
14
- identityModel: opts.identityModel,
15
- });
16
- }
17
- }
@@ -1,17 +0,0 @@
1
- import { OpenAICompatibleExecutor } from "./openai_compatible";
2
-
3
- export class HuggingFaceExecutor extends OpenAICompatibleExecutor {
4
- constructor(opts: {
5
- apiKey: string;
6
- conversationModel: string;
7
- identityModel: string;
8
- }) {
9
- super({
10
- providerName: "huggingface",
11
- baseURL: "https://router.huggingface.co/v1",
12
- apiKey: opts.apiKey,
13
- conversationModel: opts.conversationModel,
14
- identityModel: opts.identityModel,
15
- });
16
- }
17
- }
@@ -1,17 +0,0 @@
1
- import { OpenAICompatibleExecutor } from "./openai_compatible";
2
-
3
- export class IoNetExecutor extends OpenAICompatibleExecutor {
4
- constructor(opts: {
5
- apiKey: string;
6
- conversationModel: string;
7
- identityModel: string;
8
- }) {
9
- super({
10
- providerName: "ionet",
11
- baseURL: "https://api.intelligence.io.solutions/api/v1",
12
- apiKey: opts.apiKey,
13
- conversationModel: opts.conversationModel,
14
- identityModel: opts.identityModel,
15
- });
16
- }
17
- }
@@ -1,17 +0,0 @@
1
- import { OpenAICompatibleExecutor } from "./openai_compatible";
2
-
3
- export class LlamaCppExecutor extends OpenAICompatibleExecutor {
4
- constructor(opts: {
5
- apiKey: string;
6
- conversationModel: string;
7
- identityModel: string;
8
- }) {
9
- super({
10
- providerName: "llamacpp",
11
- baseURL: "http://127.0.0.1:8080/v1",
12
- apiKey: opts.apiKey || "llama.cpp",
13
- conversationModel: opts.conversationModel,
14
- identityModel: opts.identityModel,
15
- });
16
- }
17
- }
@@ -1,17 +0,0 @@
1
- import { OpenAICompatibleExecutor } from "./openai_compatible";
2
-
3
- export class LlmGatewayExecutor extends OpenAICompatibleExecutor {
4
- constructor(opts: {
5
- apiKey: string;
6
- conversationModel: string;
7
- identityModel: string;
8
- }) {
9
- super({
10
- providerName: "llmgateway",
11
- baseURL: "https://api.llmgateway.io/v1",
12
- apiKey: opts.apiKey,
13
- conversationModel: opts.conversationModel,
14
- identityModel: opts.identityModel,
15
- });
16
- }
17
- }
@@ -1,17 +0,0 @@
1
- import { OpenAICompatibleExecutor } from "./openai_compatible";
2
-
3
- export class LmStudioExecutor extends OpenAICompatibleExecutor {
4
- constructor(opts: {
5
- apiKey: string;
6
- conversationModel: string;
7
- identityModel: string;
8
- }) {
9
- super({
10
- providerName: "lmstudio",
11
- baseURL: "http://127.0.0.1:1234/v1",
12
- apiKey: opts.apiKey || "lm-studio",
13
- conversationModel: opts.conversationModel,
14
- identityModel: opts.identityModel,
15
- });
16
- }
17
- }
@@ -1,17 +0,0 @@
1
- import { OpenAICompatibleExecutor } from "./openai_compatible";
2
-
3
- export class MistralExecutor extends OpenAICompatibleExecutor {
4
- constructor(opts: {
5
- apiKey: string;
6
- conversationModel: string;
7
- identityModel: string;
8
- }) {
9
- super({
10
- providerName: "mistral",
11
- baseURL: "https://api.mistral.ai/v1",
12
- apiKey: opts.apiKey,
13
- conversationModel: opts.conversationModel,
14
- identityModel: opts.identityModel,
15
- });
16
- }
17
- }