@aituber-onair/core 0.16.1 → 0.17.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.
- package/README.md +0 -2
- package/dist/constants/index.d.ts +0 -5
- package/dist/constants/index.js +0 -5
- package/dist/constants/index.js.map +1 -1
- package/dist/core/AITuberOnAirCore.d.ts +3 -3
- package/dist/core/AITuberOnAirCore.js +8 -4
- package/dist/core/AITuberOnAirCore.js.map +1 -1
- package/dist/core/ChatProcessor.d.ts +1 -4
- package/dist/core/ChatProcessor.js +1 -3
- package/dist/core/ChatProcessor.js.map +1 -1
- package/dist/core/MemoryManager.d.ts +2 -1
- package/dist/core/MemoryManager.js.map +1 -1
- package/dist/core/ToolExecutor.d.ts +28 -2
- package/dist/core/ToolExecutor.js +88 -0
- package/dist/core/ToolExecutor.js.map +1 -1
- package/dist/index.d.ts +5 -12
- package/dist/index.js +21 -8
- package/dist/index.js.map +1 -1
- package/dist/services/chat/providers/claude/ClaudeSummarizer.d.ts +1 -1
- package/dist/services/chat/providers/claude/ClaudeSummarizer.js +1 -2
- package/dist/services/chat/providers/claude/ClaudeSummarizer.js.map +1 -1
- package/dist/services/chat/providers/gemini/GeminiSummarizer.d.ts +1 -1
- package/dist/services/chat/providers/gemini/GeminiSummarizer.js +1 -2
- package/dist/services/chat/providers/gemini/GeminiSummarizer.js.map +1 -1
- package/dist/services/chat/providers/openai/OpenAISummarizer.d.ts +1 -1
- package/dist/services/chat/providers/openai/OpenAISummarizer.js +2 -3
- package/dist/services/chat/providers/openai/OpenAISummarizer.js.map +1 -1
- package/dist/types/index.d.ts +0 -3
- package/dist/types/index.js +0 -4
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +1 -4
- package/dist/utils/index.js +2 -4
- package/dist/utils/index.js.map +1 -1
- package/package.json +2 -1
- package/dist/constants/chat.d.ts +0 -17
- package/dist/constants/chat.js +0 -18
- package/dist/constants/chat.js.map +0 -1
- package/dist/constants/claude.d.ts +0 -8
- package/dist/constants/claude.js +0 -17
- package/dist/constants/claude.js.map +0 -1
- package/dist/constants/gemini.d.ts +0 -10
- package/dist/constants/gemini.js +0 -23
- package/dist/constants/gemini.js.map +0 -1
- package/dist/constants/openai.d.ts +0 -12
- package/dist/constants/openai.js +0 -25
- package/dist/constants/openai.js.map +0 -1
- package/dist/constants/prompts.d.ts +0 -2
- package/dist/constants/prompts.js +0 -13
- package/dist/constants/prompts.js.map +0 -1
- package/dist/services/chat/ChatService.d.ts +0 -50
- package/dist/services/chat/ChatService.js +0 -2
- package/dist/services/chat/ChatService.js.map +0 -1
- package/dist/services/chat/ChatServiceFactory.d.ts +0 -38
- package/dist/services/chat/ChatServiceFactory.js +0 -61
- package/dist/services/chat/ChatServiceFactory.js.map +0 -1
- package/dist/services/chat/providers/ChatServiceProvider.d.ts +0 -48
- package/dist/services/chat/providers/ChatServiceProvider.js +0 -2
- package/dist/services/chat/providers/ChatServiceProvider.js.map +0 -1
- package/dist/services/chat/providers/claude/ClaudeChatService.d.ts +0 -139
- package/dist/services/chat/providers/claude/ClaudeChatService.js +0 -493
- package/dist/services/chat/providers/claude/ClaudeChatService.js.map +0 -1
- package/dist/services/chat/providers/claude/ClaudeChatServiceProvider.d.ts +0 -39
- package/dist/services/chat/providers/claude/ClaudeChatServiceProvider.js +0 -62
- package/dist/services/chat/providers/claude/ClaudeChatServiceProvider.js.map +0 -1
- package/dist/services/chat/providers/gemini/GeminiChatService.d.ts +0 -71
- package/dist/services/chat/providers/gemini/GeminiChatService.js +0 -537
- package/dist/services/chat/providers/gemini/GeminiChatService.js.map +0 -1
- package/dist/services/chat/providers/gemini/GeminiChatServiceProvider.d.ts +0 -39
- package/dist/services/chat/providers/gemini/GeminiChatServiceProvider.js +0 -61
- package/dist/services/chat/providers/gemini/GeminiChatServiceProvider.js.map +0 -1
- package/dist/services/chat/providers/openai/OpenAIChatService.d.ts +0 -107
- package/dist/services/chat/providers/openai/OpenAIChatService.js +0 -530
- package/dist/services/chat/providers/openai/OpenAIChatService.js.map +0 -1
- package/dist/services/chat/providers/openai/OpenAIChatServiceProvider.d.ts +0 -39
- package/dist/services/chat/providers/openai/OpenAIChatServiceProvider.js +0 -66
- package/dist/services/chat/providers/openai/OpenAIChatServiceProvider.js.map +0 -1
- package/dist/types/chat.d.ts +0 -54
- package/dist/types/chat.js +0 -5
- package/dist/types/chat.js.map +0 -1
- package/dist/types/mcp.d.ts +0 -36
- package/dist/types/mcp.js +0 -5
- package/dist/types/mcp.js.map +0 -1
- package/dist/types/toolChat.d.ts +0 -41
- package/dist/types/toolChat.js +0 -2
- package/dist/types/toolChat.js.map +0 -1
- package/dist/utils/chatServiceHttpClient.d.ts +0 -46
- package/dist/utils/chatServiceHttpClient.js +0 -126
- package/dist/utils/chatServiceHttpClient.js.map +0 -1
- package/dist/utils/emotionParser.d.ts +0 -45
- package/dist/utils/emotionParser.js +0 -55
- package/dist/utils/emotionParser.js.map +0 -1
- package/dist/utils/screenplay.d.ts +0 -19
- package/dist/utils/screenplay.js +0 -36
- package/dist/utils/screenplay.js.map +0 -1
- package/dist/utils/streamTextAccumulator.d.ts +0 -24
- package/dist/utils/streamTextAccumulator.js +0 -43
- package/dist/utils/streamTextAccumulator.js.map +0 -1
package/dist/types/index.js
CHANGED
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,kCAAkC;AAClC,cAAc,UAAU,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,kCAAkC;AAClC,cAAc,UAAU,CAAC"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -2,8 +2,5 @@
|
|
|
2
2
|
* Export utility functions
|
|
3
3
|
*/
|
|
4
4
|
export * from './screenshot';
|
|
5
|
-
export * from './screenplay';
|
|
6
5
|
export * from './storage';
|
|
7
|
-
export
|
|
8
|
-
export * from './streamTextAccumulator';
|
|
9
|
-
export * from './chatServiceHttpClient';
|
|
6
|
+
export { textToScreenplay, textsToScreenplay, screenplayToText, } from '@aituber-onair/chat';
|
package/dist/utils/index.js
CHANGED
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
* Export utility functions
|
|
3
3
|
*/
|
|
4
4
|
export * from './screenshot';
|
|
5
|
-
export * from './screenplay';
|
|
6
5
|
export * from './storage';
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export * from './chatServiceHttpClient';
|
|
6
|
+
// Re-export screenplay utilities from chat package
|
|
7
|
+
export { textToScreenplay, textsToScreenplay, screenplayToText, } from '@aituber-onair/chat';
|
|
10
8
|
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,cAAc,CAAC;AAC7B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAE1B,mDAAmD;AACnD,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,qBAAqB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aituber-onair/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.1",
|
|
4
4
|
"description": "Core library for AITuber OnAir providing voice synthesis and chat processing",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"author": "shinshin86 (https://github.com/shinshin86)",
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"dependencies": {
|
|
24
|
+
"@aituber-onair/chat": "^0.2.1",
|
|
24
25
|
"@aituber-onair/voice": "^0.3.0"
|
|
25
26
|
},
|
|
26
27
|
"peerDependencies": {
|
package/dist/constants/chat.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare const CHAT_RESPONSE_LENGTH: {
|
|
2
|
-
readonly VERY_SHORT: "veryShort";
|
|
3
|
-
readonly SHORT: "short";
|
|
4
|
-
readonly MEDIUM: "medium";
|
|
5
|
-
readonly LONG: "long";
|
|
6
|
-
};
|
|
7
|
-
export declare const MAX_TOKENS_BY_LENGTH: {
|
|
8
|
-
readonly veryShort: 40;
|
|
9
|
-
readonly short: 100;
|
|
10
|
-
readonly medium: 200;
|
|
11
|
-
readonly long: 300;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Default max tokens for AI providers when not specified
|
|
15
|
-
*/
|
|
16
|
-
export declare const DEFAULT_MAX_TOKENS = 1000;
|
|
17
|
-
export type ChatResponseLength = (typeof CHAT_RESPONSE_LENGTH)[keyof typeof CHAT_RESPONSE_LENGTH];
|
package/dist/constants/chat.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// chat response length
|
|
2
|
-
export const CHAT_RESPONSE_LENGTH = {
|
|
3
|
-
VERY_SHORT: 'veryShort',
|
|
4
|
-
SHORT: 'short',
|
|
5
|
-
MEDIUM: 'medium',
|
|
6
|
-
LONG: 'long',
|
|
7
|
-
};
|
|
8
|
-
export const MAX_TOKENS_BY_LENGTH = {
|
|
9
|
-
[CHAT_RESPONSE_LENGTH.VERY_SHORT]: 40,
|
|
10
|
-
[CHAT_RESPONSE_LENGTH.SHORT]: 100,
|
|
11
|
-
[CHAT_RESPONSE_LENGTH.MEDIUM]: 200,
|
|
12
|
-
[CHAT_RESPONSE_LENGTH.LONG]: 300,
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Default max tokens for AI providers when not specified
|
|
16
|
-
*/
|
|
17
|
-
export const DEFAULT_MAX_TOKENS = 1000;
|
|
18
|
-
//# sourceMappingURL=chat.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat.js","sourceRoot":"","sources":["../../src/constants/chat.ts"],"names":[],"mappings":"AAAA,uBAAuB;AACvB,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,UAAU,EAAE,WAAW;IACvB,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;CACJ,CAAC;AAEX,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,CAAC,oBAAoB,CAAC,UAAU,CAAC,EAAE,EAAE;IACrC,CAAC,oBAAoB,CAAC,KAAK,CAAC,EAAE,GAAG;IACjC,CAAC,oBAAoB,CAAC,MAAM,CAAC,EAAE,GAAG;IAClC,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,GAAG;CACxB,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare const ENDPOINT_CLAUDE_API = "https://api.anthropic.com/v1/messages";
|
|
2
|
-
export declare const MODEL_CLAUDE_3_HAIKU = "claude-3-haiku-20240307";
|
|
3
|
-
export declare const MODEL_CLAUDE_3_5_HAIKU = "claude-3-5-haiku-20241022";
|
|
4
|
-
export declare const MODEL_CLAUDE_3_5_SONNET = "claude-3-5-sonnet-20241022";
|
|
5
|
-
export declare const MODEL_CLAUDE_3_7_SONNET = "claude-3-7-sonnet-20250219";
|
|
6
|
-
export declare const MODEL_CLAUDE_4_SONNET = "claude-4-sonnet-20250514";
|
|
7
|
-
export declare const MODEL_CLAUDE_4_OPUS = "claude-4-opus-20250514";
|
|
8
|
-
export declare const CLAUDE_VISION_SUPPORTED_MODELS: string[];
|
package/dist/constants/claude.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export const ENDPOINT_CLAUDE_API = 'https://api.anthropic.com/v1/messages';
|
|
2
|
-
// claude model
|
|
3
|
-
export const MODEL_CLAUDE_3_HAIKU = 'claude-3-haiku-20240307';
|
|
4
|
-
export const MODEL_CLAUDE_3_5_HAIKU = 'claude-3-5-haiku-20241022';
|
|
5
|
-
export const MODEL_CLAUDE_3_5_SONNET = 'claude-3-5-sonnet-20241022';
|
|
6
|
-
export const MODEL_CLAUDE_3_7_SONNET = 'claude-3-7-sonnet-20250219';
|
|
7
|
-
export const MODEL_CLAUDE_4_SONNET = 'claude-4-sonnet-20250514';
|
|
8
|
-
export const MODEL_CLAUDE_4_OPUS = 'claude-4-opus-20250514';
|
|
9
|
-
export const CLAUDE_VISION_SUPPORTED_MODELS = [
|
|
10
|
-
MODEL_CLAUDE_3_HAIKU,
|
|
11
|
-
MODEL_CLAUDE_3_5_HAIKU,
|
|
12
|
-
MODEL_CLAUDE_3_5_SONNET,
|
|
13
|
-
MODEL_CLAUDE_3_7_SONNET,
|
|
14
|
-
MODEL_CLAUDE_4_SONNET,
|
|
15
|
-
MODEL_CLAUDE_4_OPUS,
|
|
16
|
-
];
|
|
17
|
-
//# sourceMappingURL=claude.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"claude.js","sourceRoot":"","sources":["../../src/constants/claude.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAAG,uCAAuC,CAAC;AAE3E,eAAe;AACf,MAAM,CAAC,MAAM,oBAAoB,GAAG,yBAAyB,CAAC;AAC9D,MAAM,CAAC,MAAM,sBAAsB,GAAG,2BAA2B,CAAC;AAClE,MAAM,CAAC,MAAM,uBAAuB,GAAG,4BAA4B,CAAC;AACpE,MAAM,CAAC,MAAM,uBAAuB,GAAG,4BAA4B,CAAC;AACpE,MAAM,CAAC,MAAM,qBAAqB,GAAG,0BAA0B,CAAC;AAChE,MAAM,CAAC,MAAM,mBAAmB,GAAG,wBAAwB,CAAC;AAE5D,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,oBAAoB;IACpB,sBAAsB;IACtB,uBAAuB;IACvB,uBAAuB;IACvB,qBAAqB;IACrB,mBAAmB;CACpB,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const ENDPOINT_GEMINI_API = "https://generativelanguage.googleapis.com";
|
|
2
|
-
export declare const MODEL_GEMINI_2_5_PRO = "gemini-2.5-pro";
|
|
3
|
-
export declare const MODEL_GEMINI_2_5_FLASH = "gemini-2.5-flash";
|
|
4
|
-
export declare const MODEL_GEMINI_2_5_FLASH_LITE = "gemini-2.5-flash-lite";
|
|
5
|
-
export declare const MODEL_GEMINI_2_5_FLASH_LITE_PREVIEW_06_17 = "gemini-2.5-flash-lite-preview-06-17";
|
|
6
|
-
export declare const MODEL_GEMINI_2_0_FLASH = "gemini-2.0-flash";
|
|
7
|
-
export declare const MODEL_GEMINI_2_0_FLASH_LITE = "gemini-2.0-flash-lite";
|
|
8
|
-
export declare const MODEL_GEMINI_1_5_FLASH = "gemini-1.5-flash";
|
|
9
|
-
export declare const MODEL_GEMINI_1_5_PRO = "gemini-1.5-pro";
|
|
10
|
-
export declare const GEMINI_VISION_SUPPORTED_MODELS: string[];
|
package/dist/constants/gemini.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
// API Endpoints
|
|
2
|
-
export const ENDPOINT_GEMINI_API = 'https://generativelanguage.googleapis.com';
|
|
3
|
-
// gemini model
|
|
4
|
-
export const MODEL_GEMINI_2_5_PRO = 'gemini-2.5-pro';
|
|
5
|
-
export const MODEL_GEMINI_2_5_FLASH = 'gemini-2.5-flash';
|
|
6
|
-
export const MODEL_GEMINI_2_5_FLASH_LITE = 'gemini-2.5-flash-lite';
|
|
7
|
-
export const MODEL_GEMINI_2_5_FLASH_LITE_PREVIEW_06_17 = 'gemini-2.5-flash-lite-preview-06-17';
|
|
8
|
-
export const MODEL_GEMINI_2_0_FLASH = 'gemini-2.0-flash';
|
|
9
|
-
export const MODEL_GEMINI_2_0_FLASH_LITE = 'gemini-2.0-flash-lite';
|
|
10
|
-
export const MODEL_GEMINI_1_5_FLASH = 'gemini-1.5-flash';
|
|
11
|
-
export const MODEL_GEMINI_1_5_PRO = 'gemini-1.5-pro';
|
|
12
|
-
// Vision support for Gemini models
|
|
13
|
-
export const GEMINI_VISION_SUPPORTED_MODELS = [
|
|
14
|
-
MODEL_GEMINI_2_5_PRO,
|
|
15
|
-
MODEL_GEMINI_2_5_FLASH,
|
|
16
|
-
MODEL_GEMINI_2_5_FLASH_LITE,
|
|
17
|
-
MODEL_GEMINI_2_5_FLASH_LITE_PREVIEW_06_17,
|
|
18
|
-
MODEL_GEMINI_2_0_FLASH,
|
|
19
|
-
MODEL_GEMINI_2_0_FLASH_LITE,
|
|
20
|
-
MODEL_GEMINI_1_5_FLASH,
|
|
21
|
-
MODEL_GEMINI_1_5_PRO,
|
|
22
|
-
];
|
|
23
|
-
//# sourceMappingURL=gemini.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gemini.js","sourceRoot":"","sources":["../../src/constants/gemini.ts"],"names":[],"mappings":"AAAA,gBAAgB;AAChB,MAAM,CAAC,MAAM,mBAAmB,GAAG,2CAA2C,CAAC;AAE/E,eAAe;AACf,MAAM,CAAC,MAAM,oBAAoB,GAAG,gBAAgB,CAAC;AACrD,MAAM,CAAC,MAAM,sBAAsB,GAAG,kBAAkB,CAAC;AACzD,MAAM,CAAC,MAAM,2BAA2B,GAAG,uBAAuB,CAAC;AACnE,MAAM,CAAC,MAAM,yCAAyC,GACpD,qCAAqC,CAAC;AACxC,MAAM,CAAC,MAAM,sBAAsB,GAAG,kBAAkB,CAAC;AACzD,MAAM,CAAC,MAAM,2BAA2B,GAAG,uBAAuB,CAAC;AACnE,MAAM,CAAC,MAAM,sBAAsB,GAAG,kBAAkB,CAAC;AACzD,MAAM,CAAC,MAAM,oBAAoB,GAAG,gBAAgB,CAAC;AAErD,mCAAmC;AACnC,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,oBAAoB;IACpB,sBAAsB;IACtB,2BAA2B;IAC3B,yCAAyC;IACzC,sBAAsB;IACtB,2BAA2B;IAC3B,sBAAsB;IACtB,oBAAoB;CACrB,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const ENDPOINT_OPENAI_CHAT_COMPLETIONS_API = "https://api.openai.com/v1/chat/completions";
|
|
2
|
-
export declare const ENDPOINT_OPENAI_RESPONSES_API = "https://api.openai.com/v1/responses";
|
|
3
|
-
export declare const MODEL_GPT_4_1 = "gpt-4.1";
|
|
4
|
-
export declare const MODEL_GPT_4_1_MINI = "gpt-4.1-mini";
|
|
5
|
-
export declare const MODEL_GPT_4_1_NANO = "gpt-4.1-nano";
|
|
6
|
-
export declare const MODEL_GPT_4O_MINI = "gpt-4o-mini";
|
|
7
|
-
export declare const MODEL_GPT_4O = "gpt-4o";
|
|
8
|
-
export declare const MODEL_O3_MINI = "o3-mini";
|
|
9
|
-
export declare const MODEL_O1_MINI = "o1-mini";
|
|
10
|
-
export declare const MODEL_O1 = "o1";
|
|
11
|
-
export declare const MODEL_GPT_4_5_PREVIEW = "gpt-4.5-preview";
|
|
12
|
-
export declare const VISION_SUPPORTED_MODELS: string[];
|
package/dist/constants/openai.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export const ENDPOINT_OPENAI_CHAT_COMPLETIONS_API = 'https://api.openai.com/v1/chat/completions';
|
|
2
|
-
export const ENDPOINT_OPENAI_RESPONSES_API = 'https://api.openai.com/v1/responses';
|
|
3
|
-
// gpt model
|
|
4
|
-
export const MODEL_GPT_4_1 = 'gpt-4.1';
|
|
5
|
-
export const MODEL_GPT_4_1_MINI = 'gpt-4.1-mini';
|
|
6
|
-
export const MODEL_GPT_4_1_NANO = 'gpt-4.1-nano';
|
|
7
|
-
export const MODEL_GPT_4O_MINI = 'gpt-4o-mini';
|
|
8
|
-
export const MODEL_GPT_4O = 'gpt-4o';
|
|
9
|
-
export const MODEL_O3_MINI = 'o3-mini';
|
|
10
|
-
export const MODEL_O1_MINI = 'o1-mini';
|
|
11
|
-
export const MODEL_O1 = 'o1';
|
|
12
|
-
// deprecated
|
|
13
|
-
export const MODEL_GPT_4_5_PREVIEW = 'gpt-4.5-preview';
|
|
14
|
-
// Vision support for models
|
|
15
|
-
export const VISION_SUPPORTED_MODELS = [
|
|
16
|
-
MODEL_GPT_4_1,
|
|
17
|
-
MODEL_GPT_4_1_MINI,
|
|
18
|
-
MODEL_GPT_4_1_NANO,
|
|
19
|
-
MODEL_GPT_4O_MINI,
|
|
20
|
-
MODEL_GPT_4O,
|
|
21
|
-
MODEL_GPT_4_5_PREVIEW,
|
|
22
|
-
MODEL_O1,
|
|
23
|
-
// MODEL_O3_MINI and MODEL_O1_MINI are not included as they don't support vision
|
|
24
|
-
];
|
|
25
|
-
//# sourceMappingURL=openai.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"openai.js","sourceRoot":"","sources":["../../src/constants/openai.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oCAAoC,GAC/C,4CAA4C,CAAC;AAC/C,MAAM,CAAC,MAAM,6BAA6B,GACxC,qCAAqC,CAAC;AAExC,YAAY;AACZ,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC;AACvC,MAAM,CAAC,MAAM,kBAAkB,GAAG,cAAc,CAAC;AACjD,MAAM,CAAC,MAAM,kBAAkB,GAAG,cAAc,CAAC;AAEjD,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAAC;AAC/C,MAAM,CAAC,MAAM,YAAY,GAAG,QAAQ,CAAC;AACrC,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC;AAEvC,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC;AACvC,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAC;AAE7B,aAAa;AACb,MAAM,CAAC,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEvD,4BAA4B;AAC5B,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,aAAa;IACb,kBAAkB;IAClB,kBAAkB;IAClB,iBAAiB;IACjB,YAAY;IACZ,qBAAqB;IACrB,QAAQ;IACR,gFAAgF;CACjF,CAAC"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export declare const DEFAULT_VISION_PROMPT = "You are a friendly AI avatar. Comment on the situation based on the broadcast screen.";
|
|
2
|
-
export declare const DEFAULT_SUMMARY_PROMPT_TEMPLATE = "You are a skilled summarizing assistant. \nAnalyze the following conversation and produce a summary in the **same language** as the majority of the conversation:\n- Summaries should highlight key points\n- Stay concise (around {maxLength} characters if possible)\n- No redundant expressions\n\nIf the conversation is in Japanese, summarize in Japanese.\nIf it's in English, summarize in English.\nIf it's in another language, summarize in that language.\n";
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// Default prompts
|
|
2
|
-
export const DEFAULT_VISION_PROMPT = 'You are a friendly AI avatar. Comment on the situation based on the broadcast screen.';
|
|
3
|
-
export const DEFAULT_SUMMARY_PROMPT_TEMPLATE = `You are a skilled summarizing assistant.
|
|
4
|
-
Analyze the following conversation and produce a summary in the **same language** as the majority of the conversation:
|
|
5
|
-
- Summaries should highlight key points
|
|
6
|
-
- Stay concise (around {maxLength} characters if possible)
|
|
7
|
-
- No redundant expressions
|
|
8
|
-
|
|
9
|
-
If the conversation is in Japanese, summarize in Japanese.
|
|
10
|
-
If it's in English, summarize in English.
|
|
11
|
-
If it's in another language, summarize in that language.
|
|
12
|
-
`;
|
|
13
|
-
//# sourceMappingURL=prompts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../src/constants/prompts.ts"],"names":[],"mappings":"AAAA,kBAAkB;AAClB,MAAM,CAAC,MAAM,qBAAqB,GAChC,uFAAuF,CAAC;AAC1F,MAAM,CAAC,MAAM,+BAA+B,GAAG;;;;;;;;;CAS9C,CAAC"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Message, MessageWithVision } from '../../types';
|
|
2
|
-
import { ToolChatCompletion } from '../../types/toolChat';
|
|
3
|
-
/**
|
|
4
|
-
* Chat service interface
|
|
5
|
-
* Abstracts interaction with AI models
|
|
6
|
-
*/
|
|
7
|
-
export interface ChatService {
|
|
8
|
-
/**
|
|
9
|
-
* Get the model name
|
|
10
|
-
* @returns Model name
|
|
11
|
-
*/
|
|
12
|
-
getModel(): string;
|
|
13
|
-
/**
|
|
14
|
-
* Get the vision model name
|
|
15
|
-
* @returns Vision model name
|
|
16
|
-
*/
|
|
17
|
-
getVisionModel(): string;
|
|
18
|
-
/**
|
|
19
|
-
* Process chat messages
|
|
20
|
-
* @param messages Array of messages to send
|
|
21
|
-
* @param onPartialResponse Callback to receive each part of streaming response
|
|
22
|
-
* @param onCompleteResponse Callback to execute when response is complete
|
|
23
|
-
*/
|
|
24
|
-
processChat(messages: Message[], onPartialResponse: (text: string) => void, onCompleteResponse: (text: string) => Promise<void>): Promise<void>;
|
|
25
|
-
/**
|
|
26
|
-
* Process chat messages with images
|
|
27
|
-
* @param messages Array of messages to send (including images)
|
|
28
|
-
* @param onPartialResponse Callback to receive each part of streaming response
|
|
29
|
-
* @param onCompleteResponse Callback to execute when response is complete
|
|
30
|
-
*/
|
|
31
|
-
processVisionChat(messages: MessageWithVision[], onPartialResponse: (text: string) => void, onCompleteResponse: (text: string) => Promise<void>): Promise<void>;
|
|
32
|
-
/**
|
|
33
|
-
* Process chat messages with tools
|
|
34
|
-
* @param messages Array of messages to send
|
|
35
|
-
* @param stream Whether to use streaming
|
|
36
|
-
* @param onPartialResponse Callback for partial responses
|
|
37
|
-
* @param maxTokens Maximum tokens for response (optional)
|
|
38
|
-
* @returns Tool chat completion
|
|
39
|
-
*/
|
|
40
|
-
chatOnce(messages: Message[], stream: boolean, onPartialResponse: (text: string) => void, maxTokens?: number): Promise<ToolChatCompletion>;
|
|
41
|
-
/**
|
|
42
|
-
* Process chat messages with tools and images
|
|
43
|
-
* @param messages Array of messages to send (including images)
|
|
44
|
-
* @param stream Whether to use streaming
|
|
45
|
-
* @param onPartialResponse Callback for partial responses
|
|
46
|
-
* @param maxTokens Maximum tokens for response (optional)
|
|
47
|
-
* @returns Tool chat completion
|
|
48
|
-
*/
|
|
49
|
-
visionChatOnce(messages: MessageWithVision[], stream: boolean, onPartialResponse: (text: string) => void, maxTokens?: number): Promise<ToolChatCompletion>;
|
|
50
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChatService.js","sourceRoot":"","sources":["../../../src/services/chat/ChatService.ts"],"names":[],"mappings":""}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { ChatService } from './ChatService';
|
|
2
|
-
import { ChatServiceOptions, ChatServiceProvider } from './providers/ChatServiceProvider';
|
|
3
|
-
/**
|
|
4
|
-
* Chat service factory
|
|
5
|
-
* Manages and creates various AI providers
|
|
6
|
-
*/
|
|
7
|
-
export declare class ChatServiceFactory {
|
|
8
|
-
/** Map of registered providers */
|
|
9
|
-
private static providers;
|
|
10
|
-
/**
|
|
11
|
-
* Register a new provider
|
|
12
|
-
* @param provider Provider instance
|
|
13
|
-
*/
|
|
14
|
-
static registerProvider(provider: ChatServiceProvider): void;
|
|
15
|
-
/**
|
|
16
|
-
* Create a chat service with the specified provider name and options
|
|
17
|
-
* @param providerName Provider name
|
|
18
|
-
* @param options Service options
|
|
19
|
-
* @returns Created ChatService instance
|
|
20
|
-
*/
|
|
21
|
-
static createChatService(providerName: string, options: ChatServiceOptions): ChatService;
|
|
22
|
-
/**
|
|
23
|
-
* Get registered providers
|
|
24
|
-
* @returns Provider map
|
|
25
|
-
*/
|
|
26
|
-
static getProviders(): Map<string, ChatServiceProvider>;
|
|
27
|
-
/**
|
|
28
|
-
* Get array of available provider names
|
|
29
|
-
* @returns Array of provider names
|
|
30
|
-
*/
|
|
31
|
-
static getAvailableProviders(): string[];
|
|
32
|
-
/**
|
|
33
|
-
* Get models supported by the specified provider
|
|
34
|
-
* @param providerName Provider name
|
|
35
|
-
* @returns Array of supported models, empty array if provider doesn't exist
|
|
36
|
-
*/
|
|
37
|
-
static getSupportedModels(providerName: string): string[];
|
|
38
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { OpenAIChatServiceProvider } from './providers/openai/OpenAIChatServiceProvider';
|
|
2
|
-
import { GeminiChatServiceProvider } from './providers/gemini/GeminiChatServiceProvider';
|
|
3
|
-
import { ClaudeChatServiceProvider } from './providers/claude/ClaudeChatServiceProvider';
|
|
4
|
-
/**
|
|
5
|
-
* Chat service factory
|
|
6
|
-
* Manages and creates various AI providers
|
|
7
|
-
*/
|
|
8
|
-
export class ChatServiceFactory {
|
|
9
|
-
/**
|
|
10
|
-
* Register a new provider
|
|
11
|
-
* @param provider Provider instance
|
|
12
|
-
*/
|
|
13
|
-
static registerProvider(provider) {
|
|
14
|
-
this.providers.set(provider.getProviderName(), provider);
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Create a chat service with the specified provider name and options
|
|
18
|
-
* @param providerName Provider name
|
|
19
|
-
* @param options Service options
|
|
20
|
-
* @returns Created ChatService instance
|
|
21
|
-
*/
|
|
22
|
-
static createChatService(providerName, options) {
|
|
23
|
-
const provider = this.providers.get(providerName);
|
|
24
|
-
if (!provider) {
|
|
25
|
-
throw new Error(`Unknown chat provider: ${providerName}`);
|
|
26
|
-
}
|
|
27
|
-
return provider.createChatService(options);
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Get registered providers
|
|
31
|
-
* @returns Provider map
|
|
32
|
-
*/
|
|
33
|
-
static getProviders() {
|
|
34
|
-
return this.providers;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Get array of available provider names
|
|
38
|
-
* @returns Array of provider names
|
|
39
|
-
*/
|
|
40
|
-
static getAvailableProviders() {
|
|
41
|
-
return Array.from(this.providers.keys());
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Get models supported by the specified provider
|
|
45
|
-
* @param providerName Provider name
|
|
46
|
-
* @returns Array of supported models, empty array if provider doesn't exist
|
|
47
|
-
*/
|
|
48
|
-
static getSupportedModels(providerName) {
|
|
49
|
-
const provider = this.providers.get(providerName);
|
|
50
|
-
return provider ? provider.getSupportedModels() : [];
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
/** Map of registered providers */
|
|
54
|
-
ChatServiceFactory.providers = new Map();
|
|
55
|
-
// Register OpenAI as a provider
|
|
56
|
-
ChatServiceFactory.registerProvider(new OpenAIChatServiceProvider());
|
|
57
|
-
// Register Gemini as a provider
|
|
58
|
-
ChatServiceFactory.registerProvider(new GeminiChatServiceProvider());
|
|
59
|
-
// Register Claude as a provider
|
|
60
|
-
ChatServiceFactory.registerProvider(new ClaudeChatServiceProvider());
|
|
61
|
-
//# sourceMappingURL=ChatServiceFactory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChatServiceFactory.js","sourceRoot":"","sources":["../../../src/services/chat/ChatServiceFactory.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AACzF,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AACzF,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AAEzF;;;GAGG;AACH,MAAM,OAAO,kBAAkB;IAI7B;;;OAGG;IACH,MAAM,CAAC,gBAAgB,CAAC,QAA6B;QACnD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,eAAe,EAAE,EAAE,QAAQ,CAAC,CAAC;IAC3D,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,iBAAiB,CACtB,YAAoB,EACpB,OAA2B;QAE3B,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAClD,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,0BAA0B,YAAY,EAAE,CAAC,CAAC;QAC5D,CAAC;QACD,OAAO,QAAQ,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,YAAY;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,qBAAqB;QAC1B,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC;IAC3C,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,YAAoB;QAC5C,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAClD,OAAO,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACvD,CAAC;;AApDD,kCAAkC;AACnB,4BAAS,GAAqC,IAAI,GAAG,EAAE,CAAC;AAsDzE,gCAAgC;AAChC,kBAAkB,CAAC,gBAAgB,CAAC,IAAI,yBAAyB,EAAE,CAAC,CAAC;AACrE,gCAAgC;AAChC,kBAAkB,CAAC,gBAAgB,CAAC,IAAI,yBAAyB,EAAE,CAAC,CAAC;AACrE,gCAAgC;AAChC,kBAAkB,CAAC,gBAAgB,CAAC,IAAI,yBAAyB,EAAE,CAAC,CAAC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { ChatService } from '../ChatService';
|
|
2
|
-
/**
|
|
3
|
-
* Options for chat service providers
|
|
4
|
-
*/
|
|
5
|
-
export interface ChatServiceOptions {
|
|
6
|
-
/** API Key */
|
|
7
|
-
apiKey: string;
|
|
8
|
-
/** Model name */
|
|
9
|
-
model?: string;
|
|
10
|
-
/** Vision model name (for image processing) */
|
|
11
|
-
visionModel?: string;
|
|
12
|
-
/** API endpoint type (chat/completions or responses (OpenAI only)) */
|
|
13
|
-
endpoint?: string;
|
|
14
|
-
/** Additional provider-specific options */
|
|
15
|
-
[key: string]: any;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Chat service provider interface
|
|
19
|
-
* Abstraction for various AI API providers (OpenAI, Gemini, Claude, etc.)
|
|
20
|
-
*/
|
|
21
|
-
export interface ChatServiceProvider {
|
|
22
|
-
/**
|
|
23
|
-
* Create a chat service instance
|
|
24
|
-
* @param options Service options
|
|
25
|
-
* @returns ChatService implementation
|
|
26
|
-
*/
|
|
27
|
-
createChatService(options: ChatServiceOptions): ChatService;
|
|
28
|
-
/**
|
|
29
|
-
* Get the provider name
|
|
30
|
-
* @returns Provider name
|
|
31
|
-
*/
|
|
32
|
-
getProviderName(): string;
|
|
33
|
-
/**
|
|
34
|
-
* Get the list of supported models
|
|
35
|
-
* @returns Array of supported models
|
|
36
|
-
*/
|
|
37
|
-
getSupportedModels(): string[];
|
|
38
|
-
/**
|
|
39
|
-
* Get the default model
|
|
40
|
-
* @returns Default model name
|
|
41
|
-
*/
|
|
42
|
-
getDefaultModel(): string;
|
|
43
|
-
/**
|
|
44
|
-
* Check if the provider supports vision (image processing)
|
|
45
|
-
* @returns Support status
|
|
46
|
-
*/
|
|
47
|
-
supportsVision(): boolean;
|
|
48
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChatServiceProvider.js","sourceRoot":"","sources":["../../../../src/services/chat/providers/ChatServiceProvider.ts"],"names":[],"mappings":""}
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import { ChatService } from '../../ChatService';
|
|
2
|
-
import { Message, MessageWithVision, ToolChatCompletion, ToolDefinition, MCPServerConfig } from '../../../../types';
|
|
3
|
-
export interface ClaudeToolResultBlock {
|
|
4
|
-
type: 'tool_result';
|
|
5
|
-
tool_use_id: string;
|
|
6
|
-
content: string;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Claude implementation of ChatService
|
|
10
|
-
*/
|
|
11
|
-
export declare class ClaudeChatService implements ChatService {
|
|
12
|
-
/** Provider name */
|
|
13
|
-
readonly provider: string;
|
|
14
|
-
private apiKey;
|
|
15
|
-
private model;
|
|
16
|
-
private visionModel;
|
|
17
|
-
private tools;
|
|
18
|
-
private mcpServers;
|
|
19
|
-
/**
|
|
20
|
-
* Constructor
|
|
21
|
-
* @param apiKey Anthropic API key
|
|
22
|
-
* @param model Name of the model to use
|
|
23
|
-
* @param visionModel Name of the vision model
|
|
24
|
-
* @param tools Array of tool definitions
|
|
25
|
-
* @param mcpServers Array of MCP server configurations (optional)
|
|
26
|
-
* @throws Error if the vision model doesn't support vision capabilities
|
|
27
|
-
*/
|
|
28
|
-
constructor(apiKey: string, model?: string, visionModel?: string, tools?: ToolDefinition[], mcpServers?: MCPServerConfig[]);
|
|
29
|
-
/**
|
|
30
|
-
* Get the current model name
|
|
31
|
-
* @returns Model name
|
|
32
|
-
*/
|
|
33
|
-
getModel(): string;
|
|
34
|
-
/**
|
|
35
|
-
* Get the current vision model name
|
|
36
|
-
* @returns Vision model name
|
|
37
|
-
*/
|
|
38
|
-
getVisionModel(): string;
|
|
39
|
-
/**
|
|
40
|
-
* Get configured MCP servers
|
|
41
|
-
* @returns Array of MCP server configurations
|
|
42
|
-
*/
|
|
43
|
-
getMCPServers(): MCPServerConfig[];
|
|
44
|
-
/**
|
|
45
|
-
* Add MCP server configuration
|
|
46
|
-
* @param serverConfig MCP server configuration
|
|
47
|
-
*/
|
|
48
|
-
addMCPServer(serverConfig: MCPServerConfig): void;
|
|
49
|
-
/**
|
|
50
|
-
* Remove MCP server by name
|
|
51
|
-
* @param serverName Name of the server to remove
|
|
52
|
-
*/
|
|
53
|
-
removeMCPServer(serverName: string): void;
|
|
54
|
-
/**
|
|
55
|
-
* Check if MCP servers are configured
|
|
56
|
-
* @returns True if MCP servers are configured
|
|
57
|
-
*/
|
|
58
|
-
hasMCPServers(): boolean;
|
|
59
|
-
/**
|
|
60
|
-
* Process chat messages
|
|
61
|
-
* @param messages Array of messages to send
|
|
62
|
-
* @param onPartialResponse Callback to receive each part of streaming response
|
|
63
|
-
* @param onCompleteResponse Callback to execute when response is complete
|
|
64
|
-
*/
|
|
65
|
-
processChat(messages: Message[], onPartialResponse: (text: string) => void, onCompleteResponse: (text: string) => Promise<void>): Promise<void>;
|
|
66
|
-
/**
|
|
67
|
-
* Process chat messages with images
|
|
68
|
-
* @param messages Array of messages to send (including images)
|
|
69
|
-
* @param onPartialResponse Callback to receive each part of streaming response
|
|
70
|
-
* @param onCompleteResponse Callback to execute when response is complete
|
|
71
|
-
*/
|
|
72
|
-
processVisionChat(messages: MessageWithVision[], onPartialResponse: (text: string) => void, onCompleteResponse: (text: string) => Promise<void>): Promise<void>;
|
|
73
|
-
/**
|
|
74
|
-
* Convert AITuber OnAir messages to Claude format
|
|
75
|
-
* @param messages Array of messages
|
|
76
|
-
* @returns Claude formatted messages
|
|
77
|
-
*/
|
|
78
|
-
private convertMessagesToClaudeFormat;
|
|
79
|
-
/**
|
|
80
|
-
* Convert AITuber OnAir vision messages to Claude format
|
|
81
|
-
* @param messages Array of vision messages
|
|
82
|
-
* @returns Claude formatted vision messages
|
|
83
|
-
*/
|
|
84
|
-
private convertVisionMessagesToClaudeFormat;
|
|
85
|
-
/**
|
|
86
|
-
* Map AITuber OnAir roles to Claude roles
|
|
87
|
-
* @param role AITuber OnAir role
|
|
88
|
-
* @returns Claude role
|
|
89
|
-
*/
|
|
90
|
-
private mapRoleToClaude;
|
|
91
|
-
/**
|
|
92
|
-
* Get MIME type from URL
|
|
93
|
-
* @param url Image URL
|
|
94
|
-
* @returns MIME type
|
|
95
|
-
*/
|
|
96
|
-
private getMimeTypeFromUrl;
|
|
97
|
-
/**
|
|
98
|
-
* Call Claude API
|
|
99
|
-
* @param messages Array of messages to send
|
|
100
|
-
* @param model Model name
|
|
101
|
-
* @param stream Whether to stream the response
|
|
102
|
-
* @param maxTokens Maximum tokens for response (optional)
|
|
103
|
-
* @returns Response
|
|
104
|
-
*/
|
|
105
|
-
private callClaude;
|
|
106
|
-
/**
|
|
107
|
-
* Parse stream response
|
|
108
|
-
* @param res Response
|
|
109
|
-
* @param onPartial Callback to receive each part of streaming response
|
|
110
|
-
* @returns ClaudeInternalCompletion
|
|
111
|
-
*/
|
|
112
|
-
private parseStream;
|
|
113
|
-
private parsePureStream;
|
|
114
|
-
private parseOneShot;
|
|
115
|
-
/**
|
|
116
|
-
* Process chat messages
|
|
117
|
-
* @param messages Array of messages to send
|
|
118
|
-
* @param stream Whether to stream the response
|
|
119
|
-
* @param onPartial Callback to receive each part of streaming response
|
|
120
|
-
* @param maxTokens Maximum tokens for response (optional)
|
|
121
|
-
* @returns ToolChatCompletion
|
|
122
|
-
*/
|
|
123
|
-
chatOnce(messages: Message[], stream?: boolean, onPartial?: (t: string) => void, maxTokens?: number): Promise<ToolChatCompletion>;
|
|
124
|
-
/**
|
|
125
|
-
* Process vision chat messages
|
|
126
|
-
* @param messages Array of messages to send
|
|
127
|
-
* @param stream Whether to stream the response
|
|
128
|
-
* @param onPartial Callback to receive each part of streaming response
|
|
129
|
-
* @param maxTokens Maximum tokens for response (optional)
|
|
130
|
-
* @returns ToolChatCompletion
|
|
131
|
-
*/
|
|
132
|
-
visionChatOnce(messages: MessageWithVision[], stream?: boolean, onPartial?: (t: string) => void, maxTokens?: number): Promise<ToolChatCompletion>;
|
|
133
|
-
/**
|
|
134
|
-
* Convert internal completion to standard ToolChatCompletion
|
|
135
|
-
* @param completion Internal completion result
|
|
136
|
-
* @returns Standard ToolChatCompletion
|
|
137
|
-
*/
|
|
138
|
-
private convertToStandardCompletion;
|
|
139
|
-
}
|