modelfusion 0.92.0 → 0.93.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/README.md +19 -19
- package/core/api/ApiCallError.cjs +9 -1
- package/core/api/ApiCallError.d.ts +4 -1
- package/core/api/ApiCallError.js +9 -1
- package/model-function/{PromptFormat.d.ts → PromptTemplate.d.ts} +2 -2
- package/model-function/generate-image/ImageGenerationModel.d.ts +2 -2
- package/model-function/generate-image/{PromptFormatImageGenerationModel.cjs → PromptTemplateImageGenerationModel.cjs} +11 -11
- package/model-function/generate-image/PromptTemplateImageGenerationModel.d.ts +20 -0
- package/model-function/generate-image/{PromptFormatImageGenerationModel.js → PromptTemplateImageGenerationModel.js} +9 -9
- package/model-function/generate-structure/StructureFromTextGenerationModel.cjs +6 -6
- package/model-function/generate-structure/StructureFromTextGenerationModel.d.ts +4 -4
- package/model-function/generate-structure/StructureFromTextGenerationModel.js +6 -6
- package/model-function/generate-structure/{StructureFromTextPromptFormat.d.ts → StructureFromTextPromptTemplate.d.ts} +1 -1
- package/model-function/generate-structure/StructureFromTextStreamingModel.cjs +4 -4
- package/model-function/generate-structure/StructureFromTextStreamingModel.d.ts +2 -2
- package/model-function/generate-structure/StructureFromTextStreamingModel.js +4 -4
- package/model-function/generate-structure/index.cjs +1 -1
- package/model-function/generate-structure/index.d.ts +1 -1
- package/model-function/generate-structure/index.js +1 -1
- package/model-function/generate-structure/jsonStructurePrompt.d.ts +2 -2
- package/model-function/generate-text/{PromptFormatTextGenerationModel.cjs → PromptTemplateTextGenerationModel.cjs} +21 -21
- package/model-function/generate-text/PromptTemplateTextGenerationModel.d.ts +35 -0
- package/model-function/generate-text/{PromptFormatTextGenerationModel.js → PromptTemplateTextGenerationModel.js} +19 -19
- package/model-function/generate-text/PromptTemplateTextStreamingModel.cjs +38 -0
- package/model-function/generate-text/PromptTemplateTextStreamingModel.d.ts +16 -0
- package/model-function/generate-text/PromptTemplateTextStreamingModel.js +34 -0
- package/model-function/generate-text/TextGenerationModel.d.ts +3 -3
- package/model-function/generate-text/TextGenerationPromptTemplate.d.ts +11 -0
- package/model-function/generate-text/index.cjs +4 -4
- package/model-function/generate-text/index.d.ts +4 -4
- package/model-function/generate-text/index.js +4 -4
- package/model-function/generate-text/{prompt-format/AlpacaPromptFormat.cjs → prompt-template/AlpacaPromptTemplate.cjs} +5 -2
- package/model-function/generate-text/{prompt-format/AlpacaPromptFormat.d.ts → prompt-template/AlpacaPromptTemplate.d.ts} +5 -5
- package/model-function/generate-text/{prompt-format/AlpacaPromptFormat.js → prompt-template/AlpacaPromptTemplate.js} +5 -2
- package/model-function/generate-text/prompt-template/AlpacaPromptTemplate.test.cjs +31 -0
- package/model-function/generate-text/prompt-template/AlpacaPromptTemplate.test.js +29 -0
- package/model-function/generate-text/{prompt-format/ChatMLPromptFormat.cjs → prompt-template/ChatMLPromptTemplate.cjs} +5 -5
- package/model-function/generate-text/{prompt-format/ChatMLPromptFormat.d.ts → prompt-template/ChatMLPromptTemplate.d.ts} +7 -7
- package/model-function/generate-text/{prompt-format/ChatMLPromptFormat.js → prompt-template/ChatMLPromptTemplate.js} +5 -5
- package/model-function/generate-text/prompt-template/ChatMLPromptTemplate.test.cjs +49 -0
- package/model-function/generate-text/prompt-template/ChatMLPromptTemplate.test.js +47 -0
- package/model-function/generate-text/{prompt-format → prompt-template}/ChatPrompt.d.ts +1 -1
- package/model-function/generate-text/prompt-template/Content.js +1 -0
- package/model-function/generate-text/{prompt-format → prompt-template}/InstructionPrompt.d.ts +7 -0
- package/model-function/generate-text/prompt-template/InstructionPrompt.js +1 -0
- package/model-function/generate-text/{prompt-format/Llama2PromptFormat.cjs → prompt-template/Llama2PromptTemplate.cjs} +8 -7
- package/model-function/generate-text/{prompt-format/Llama2PromptFormat.d.ts → prompt-template/Llama2PromptTemplate.d.ts} +7 -6
- package/model-function/generate-text/{prompt-format/Llama2PromptFormat.js → prompt-template/Llama2PromptTemplate.js} +8 -7
- package/model-function/generate-text/prompt-template/Llama2PromptTemplate.test.cjs +49 -0
- package/model-function/generate-text/prompt-template/Llama2PromptTemplate.test.d.ts +1 -0
- package/model-function/generate-text/prompt-template/Llama2PromptTemplate.test.js +47 -0
- package/model-function/generate-text/{prompt-format/TextPromptFormat.cjs → prompt-template/TextPromptTemplate.cjs} +3 -0
- package/model-function/generate-text/{prompt-format/TextPromptFormat.d.ts → prompt-template/TextPromptTemplate.d.ts} +4 -4
- package/model-function/generate-text/{prompt-format/TextPromptFormat.js → prompt-template/TextPromptTemplate.js} +3 -0
- package/model-function/generate-text/prompt-template/TextPromptTemplate.test.cjs +49 -0
- package/model-function/generate-text/prompt-template/TextPromptTemplate.test.d.ts +1 -0
- package/model-function/generate-text/prompt-template/TextPromptTemplate.test.js +47 -0
- package/model-function/generate-text/{prompt-format/VicunaPromptFormat.d.ts → prompt-template/VicunaPromptTemplate.d.ts} +2 -2
- package/model-function/generate-text/prompt-template/VicunaPromptTemplate.test.cjs +21 -0
- package/model-function/generate-text/prompt-template/VicunaPromptTemplate.test.d.ts +1 -0
- package/model-function/generate-text/prompt-template/VicunaPromptTemplate.test.js +19 -0
- package/model-function/generate-text/{prompt-format → prompt-template}/index.cjs +6 -6
- package/model-function/generate-text/prompt-template/index.d.ts +10 -0
- package/model-function/generate-text/prompt-template/index.js +10 -0
- package/model-function/index.cjs +2 -2
- package/model-function/index.d.ts +2 -2
- package/model-function/index.js +2 -2
- package/model-provider/anthropic/{AnthropicPromptFormat.cjs → AnthropicPromptTemplate.cjs} +15 -8
- package/model-provider/anthropic/AnthropicPromptTemplate.d.ts +17 -0
- package/model-provider/anthropic/{AnthropicPromptFormat.js → AnthropicPromptTemplate.js} +15 -8
- package/model-provider/anthropic/AnthropicPromptTemplate.test.cjs +49 -0
- package/model-provider/anthropic/AnthropicPromptTemplate.test.d.ts +1 -0
- package/model-provider/anthropic/AnthropicPromptTemplate.test.js +47 -0
- package/model-provider/anthropic/AnthropicTextGenerationModel.cjs +12 -12
- package/model-provider/anthropic/AnthropicTextGenerationModel.d.ts +9 -9
- package/model-provider/anthropic/AnthropicTextGenerationModel.js +12 -12
- package/model-provider/anthropic/index.cjs +2 -2
- package/model-provider/anthropic/index.d.ts +1 -1
- package/model-provider/anthropic/index.js +1 -1
- package/model-provider/automatic1111/Automatic1111ImageGenerationModel.cjs +5 -5
- package/model-provider/automatic1111/Automatic1111ImageGenerationModel.d.ts +4 -4
- package/model-provider/automatic1111/Automatic1111ImageGenerationModel.js +5 -5
- package/model-provider/automatic1111/Automatic1111ImageGenerationPrompt.d.ts +2 -2
- package/model-provider/cohere/CohereTextGenerationModel.cjs +10 -10
- package/model-provider/cohere/CohereTextGenerationModel.d.ts +7 -7
- package/model-provider/cohere/CohereTextGenerationModel.js +10 -10
- package/model-provider/huggingface/HuggingFaceTextGenerationModel.cjs +4 -4
- package/model-provider/huggingface/HuggingFaceTextGenerationModel.d.ts +3 -3
- package/model-provider/huggingface/HuggingFaceTextGenerationModel.js +4 -4
- package/model-provider/llamacpp/{LlamaCppBakLLaVA1Format.cjs → LlamaCppBakLLaVA1PromptTemplate.cjs} +1 -1
- package/model-provider/llamacpp/LlamaCppBakLLaVA1PromptTemplate.d.ts +11 -0
- package/model-provider/llamacpp/{LlamaCppBakLLaVA1Format.js → LlamaCppBakLLaVA1PromptTemplate.js} +1 -1
- package/model-provider/llamacpp/LlamaCppTextGenerationModel.cjs +12 -12
- package/model-provider/llamacpp/LlamaCppTextGenerationModel.d.ts +7 -7
- package/model-provider/llamacpp/LlamaCppTextGenerationModel.js +12 -12
- package/model-provider/llamacpp/index.cjs +2 -2
- package/model-provider/llamacpp/index.d.ts +1 -1
- package/model-provider/llamacpp/index.js +1 -1
- package/model-provider/ollama/OllamaError.cjs +25 -24
- package/model-provider/ollama/OllamaError.d.ts +1 -11
- package/model-provider/ollama/OllamaError.js +24 -22
- package/model-provider/ollama/OllamaTextGenerationModel.cjs +47 -10
- package/model-provider/ollama/OllamaTextGenerationModel.d.ts +12 -8
- package/model-provider/ollama/OllamaTextGenerationModel.js +48 -11
- package/model-provider/ollama/OllamaTextGenerationModel.test.cjs +63 -0
- package/model-provider/ollama/OllamaTextGenerationModel.test.d.ts +1 -0
- package/model-provider/ollama/OllamaTextGenerationModel.test.js +61 -0
- package/model-provider/ollama/index.cjs +1 -3
- package/model-provider/ollama/index.d.ts +1 -1
- package/model-provider/ollama/index.js +0 -1
- package/model-provider/openai/OpenAICompletionModel.cjs +10 -10
- package/model-provider/openai/OpenAICompletionModel.d.ts +7 -7
- package/model-provider/openai/OpenAICompletionModel.js +10 -10
- package/model-provider/openai/OpenAIError.cjs +13 -29
- package/model-provider/openai/OpenAIError.d.ts +2 -11
- package/model-provider/openai/OpenAIError.js +11 -26
- package/model-provider/openai/OpenAIImageGenerationModel.cjs +4 -4
- package/model-provider/openai/OpenAIImageGenerationModel.d.ts +3 -3
- package/model-provider/openai/OpenAIImageGenerationModel.js +4 -4
- package/model-provider/openai/chat/OpenAIChatFunctionCallStructureGenerationModel.cjs +16 -16
- package/model-provider/openai/chat/OpenAIChatFunctionCallStructureGenerationModel.d.ts +14 -14
- package/model-provider/openai/chat/OpenAIChatFunctionCallStructureGenerationModel.js +16 -16
- package/model-provider/openai/chat/OpenAIChatMessage.d.ts +1 -1
- package/model-provider/openai/chat/OpenAIChatModel.cjs +15 -15
- package/model-provider/openai/chat/OpenAIChatModel.d.ts +12 -12
- package/model-provider/openai/chat/OpenAIChatModel.js +15 -15
- package/model-provider/openai/chat/{OpenAIChatPromptFormat.cjs → OpenAIChatPromptTemplate.cjs} +1 -1
- package/model-provider/openai/chat/OpenAIChatPromptTemplate.d.ts +20 -0
- package/model-provider/openai/chat/{OpenAIChatPromptFormat.js → OpenAIChatPromptTemplate.js} +1 -1
- package/model-provider/openai/index.cjs +2 -4
- package/model-provider/openai/index.d.ts +2 -2
- package/model-provider/openai/index.js +1 -2
- package/model-provider/openai-compatible/OpenAICompatibleChatModel.cjs +14 -14
- package/model-provider/openai-compatible/OpenAICompatibleChatModel.d.ts +11 -11
- package/model-provider/openai-compatible/OpenAICompatibleChatModel.js +14 -14
- package/model-provider/stability/StabilityImageGenerationModel.cjs +5 -5
- package/model-provider/stability/StabilityImageGenerationModel.d.ts +4 -4
- package/model-provider/stability/StabilityImageGenerationModel.js +5 -5
- package/model-provider/stability/StabilityImageGenerationPrompt.d.ts +2 -2
- package/model-provider/whispercpp/WhisperCppTranscriptionModel.cjs +5 -8
- package/model-provider/whispercpp/WhisperCppTranscriptionModel.js +5 -8
- package/package.json +5 -4
- package/tool/generate-tool-call/TextGenerationToolCallModel.d.ts +2 -2
- package/tool/generate-tool-calls-or-text/TextGenerationToolCallsOrGenerateTextModel.cjs +6 -6
- package/tool/generate-tool-calls-or-text/TextGenerationToolCallsOrGenerateTextModel.d.ts +4 -4
- package/tool/generate-tool-calls-or-text/TextGenerationToolCallsOrGenerateTextModel.js +6 -6
- package/util/AsyncQueue.test.cjs +20 -21
- package/util/AsyncQueue.test.js +9 -10
- package/util/isDeepEqualData.test.cjs +14 -15
- package/util/isDeepEqualData.test.js +14 -15
- package/util/runSafe.test.cjs +12 -13
- package/util/runSafe.test.js +6 -7
- package/model-function/generate-image/PromptFormatImageGenerationModel.d.ts +0 -20
- package/model-function/generate-text/PromptFormatTextGenerationModel.d.ts +0 -35
- package/model-function/generate-text/PromptFormatTextStreamingModel.cjs +0 -38
- package/model-function/generate-text/PromptFormatTextStreamingModel.d.ts +0 -16
- package/model-function/generate-text/PromptFormatTextStreamingModel.js +0 -34
- package/model-function/generate-text/TextGenerationPromptFormat.d.ts +0 -11
- package/model-function/generate-text/prompt-format/index.d.ts +0 -10
- package/model-function/generate-text/prompt-format/index.js +0 -10
- package/model-provider/anthropic/AnthropicPromptFormat.d.ts +0 -17
- package/model-provider/llamacpp/LlamaCppBakLLaVA1Format.d.ts +0 -11
- package/model-provider/openai/chat/OpenAIChatPromptFormat.d.ts +0 -20
- /package/model-function/{PromptFormat.cjs → PromptTemplate.cjs} +0 -0
- /package/model-function/{PromptFormat.js → PromptTemplate.js} +0 -0
- /package/model-function/generate-structure/{StructureFromTextPromptFormat.cjs → StructureFromTextPromptTemplate.cjs} +0 -0
- /package/model-function/generate-structure/{StructureFromTextPromptFormat.js → StructureFromTextPromptTemplate.js} +0 -0
- /package/model-function/generate-text/{TextGenerationPromptFormat.cjs → TextGenerationPromptTemplate.cjs} +0 -0
- /package/model-function/generate-text/{TextGenerationPromptFormat.js → TextGenerationPromptTemplate.js} +0 -0
- /package/model-function/generate-text/{prompt-format/Content.js → prompt-template/AlpacaPromptTemplate.test.d.ts} +0 -0
- /package/model-function/generate-text/{prompt-format/InstructionPrompt.js → prompt-template/ChatMLPromptTemplate.test.d.ts} +0 -0
- /package/model-function/generate-text/{prompt-format → prompt-template}/ChatPrompt.cjs +0 -0
- /package/model-function/generate-text/{prompt-format → prompt-template}/ChatPrompt.js +0 -0
- /package/model-function/generate-text/{prompt-format → prompt-template}/Content.cjs +0 -0
- /package/model-function/generate-text/{prompt-format → prompt-template}/Content.d.ts +0 -0
- /package/model-function/generate-text/{prompt-format → prompt-template}/InstructionPrompt.cjs +0 -0
- /package/model-function/generate-text/{prompt-format → prompt-template}/InvalidPromptError.cjs +0 -0
- /package/model-function/generate-text/{prompt-format → prompt-template}/InvalidPromptError.d.ts +0 -0
- /package/model-function/generate-text/{prompt-format → prompt-template}/InvalidPromptError.js +0 -0
- /package/model-function/generate-text/{prompt-format/VicunaPromptFormat.cjs → prompt-template/VicunaPromptTemplate.cjs} +0 -0
- /package/model-function/generate-text/{prompt-format/VicunaPromptFormat.js → prompt-template/VicunaPromptTemplate.js} +0 -0
- /package/model-function/generate-text/{prompt-format → prompt-template}/trimChatPrompt.cjs +0 -0
- /package/model-function/generate-text/{prompt-format → prompt-template}/trimChatPrompt.d.ts +0 -0
- /package/model-function/generate-text/{prompt-format → prompt-template}/trimChatPrompt.js +0 -0
@@ -0,0 +1,49 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const ChatMLPromptTemplate_js_1 = require("./ChatMLPromptTemplate.cjs");
|
4
|
+
describe("text prompt", () => {
|
5
|
+
it("should format prompt", () => {
|
6
|
+
const prompt = (0, ChatMLPromptTemplate_js_1.text)().format("prompt");
|
7
|
+
expect(prompt).toMatchSnapshot();
|
8
|
+
});
|
9
|
+
});
|
10
|
+
describe("instruction prompt", () => {
|
11
|
+
it("should format prompt with instruction", () => {
|
12
|
+
const prompt = (0, ChatMLPromptTemplate_js_1.instruction)().format({
|
13
|
+
instruction: "instruction",
|
14
|
+
});
|
15
|
+
expect(prompt).toMatchSnapshot();
|
16
|
+
});
|
17
|
+
it("should format prompt with system and instruction", () => {
|
18
|
+
const prompt = (0, ChatMLPromptTemplate_js_1.instruction)().format({
|
19
|
+
system: "system",
|
20
|
+
instruction: "instruction",
|
21
|
+
});
|
22
|
+
expect(prompt).toMatchSnapshot();
|
23
|
+
});
|
24
|
+
it("should format prompt with instruction and response prefix", () => {
|
25
|
+
const prompt = (0, ChatMLPromptTemplate_js_1.instruction)().format({
|
26
|
+
instruction: "instruction",
|
27
|
+
responsePrefix: "response prefix",
|
28
|
+
});
|
29
|
+
expect(prompt).toMatchSnapshot();
|
30
|
+
});
|
31
|
+
});
|
32
|
+
describe("chat prompt", () => {
|
33
|
+
it("should format prompt with user message", () => {
|
34
|
+
const prompt = (0, ChatMLPromptTemplate_js_1.chat)().format({
|
35
|
+
messages: [{ role: "user", content: "user message" }],
|
36
|
+
});
|
37
|
+
expect(prompt).toMatchSnapshot();
|
38
|
+
});
|
39
|
+
it("should format prompt with user-assistant-user messages", () => {
|
40
|
+
const prompt = (0, ChatMLPromptTemplate_js_1.chat)().format({
|
41
|
+
messages: [
|
42
|
+
{ role: "user", content: "1st user message" },
|
43
|
+
{ role: "assistant", content: "assistant message" },
|
44
|
+
{ role: "user", content: "2nd user message" },
|
45
|
+
],
|
46
|
+
});
|
47
|
+
expect(prompt).toMatchSnapshot();
|
48
|
+
});
|
49
|
+
});
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import { chat, instruction, text } from "./ChatMLPromptTemplate.js";
|
2
|
+
describe("text prompt", () => {
|
3
|
+
it("should format prompt", () => {
|
4
|
+
const prompt = text().format("prompt");
|
5
|
+
expect(prompt).toMatchSnapshot();
|
6
|
+
});
|
7
|
+
});
|
8
|
+
describe("instruction prompt", () => {
|
9
|
+
it("should format prompt with instruction", () => {
|
10
|
+
const prompt = instruction().format({
|
11
|
+
instruction: "instruction",
|
12
|
+
});
|
13
|
+
expect(prompt).toMatchSnapshot();
|
14
|
+
});
|
15
|
+
it("should format prompt with system and instruction", () => {
|
16
|
+
const prompt = instruction().format({
|
17
|
+
system: "system",
|
18
|
+
instruction: "instruction",
|
19
|
+
});
|
20
|
+
expect(prompt).toMatchSnapshot();
|
21
|
+
});
|
22
|
+
it("should format prompt with instruction and response prefix", () => {
|
23
|
+
const prompt = instruction().format({
|
24
|
+
instruction: "instruction",
|
25
|
+
responsePrefix: "response prefix",
|
26
|
+
});
|
27
|
+
expect(prompt).toMatchSnapshot();
|
28
|
+
});
|
29
|
+
});
|
30
|
+
describe("chat prompt", () => {
|
31
|
+
it("should format prompt with user message", () => {
|
32
|
+
const prompt = chat().format({
|
33
|
+
messages: [{ role: "user", content: "user message" }],
|
34
|
+
});
|
35
|
+
expect(prompt).toMatchSnapshot();
|
36
|
+
});
|
37
|
+
it("should format prompt with user-assistant-user messages", () => {
|
38
|
+
const prompt = chat().format({
|
39
|
+
messages: [
|
40
|
+
{ role: "user", content: "1st user message" },
|
41
|
+
{ role: "assistant", content: "assistant message" },
|
42
|
+
{ role: "user", content: "2nd user message" },
|
43
|
+
],
|
44
|
+
});
|
45
|
+
expect(prompt).toMatchSnapshot();
|
46
|
+
});
|
47
|
+
});
|
@@ -9,7 +9,7 @@ import { MultiModalInput } from "./Content.js";
|
|
9
9
|
*
|
10
10
|
* You can use a ChatPrompt without an final user message when you e.g. want to display the current state of a conversation.
|
11
11
|
*
|
12
|
-
* The type checking is done at runtime when you submit a chat prompt to a model with a prompt
|
12
|
+
* The type checking is done at runtime when you submit a chat prompt to a model with a prompt template.
|
13
13
|
*
|
14
14
|
* @example
|
15
15
|
* ```ts
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
package/model-function/generate-text/{prompt-format → prompt-template}/InstructionPrompt.d.ts
RENAMED
@@ -37,4 +37,11 @@ export interface TextInstructionPrompt {
|
|
37
37
|
* The text instruction for the model.
|
38
38
|
*/
|
39
39
|
instruction: string;
|
40
|
+
/**
|
41
|
+
* Response prefix that will be injected in the prompt at the beginning of the response.
|
42
|
+
* This is useful for guiding the model by starting its response with a specific text.
|
43
|
+
*
|
44
|
+
* Note: Not all models support this feature. E.g. it is not supported by OpenAI chat models.
|
45
|
+
*/
|
46
|
+
responsePrefix?: string;
|
40
47
|
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -4,9 +4,9 @@ exports.chat = exports.instruction = exports.text = void 0;
|
|
4
4
|
const ChatPrompt_js_1 = require("./ChatPrompt.cjs");
|
5
5
|
// see https://github.com/facebookresearch/llama/blob/6c7fe276574e78057f917549435a2554000a876d/llama/generation.py#L44
|
6
6
|
const BEGIN_SEGMENT = "<s>";
|
7
|
-
const END_SEGMENT = "</s>";
|
8
|
-
const BEGIN_INSTRUCTION = "[INST]";
|
9
|
-
const END_INSTRUCTION = "[/INST]";
|
7
|
+
const END_SEGMENT = " </s>";
|
8
|
+
const BEGIN_INSTRUCTION = "[INST] ";
|
9
|
+
const END_INSTRUCTION = " [/INST] ";
|
10
10
|
const BEGIN_SYSTEM = "<<SYS>>\n";
|
11
11
|
const END_SYSTEM = "\n<</SYS>>\n\n";
|
12
12
|
/**
|
@@ -36,8 +36,9 @@ exports.text = text;
|
|
36
36
|
* <s>[INST] <<SYS>>
|
37
37
|
* ${ system prompt }
|
38
38
|
* <</SYS>>
|
39
|
-
*
|
40
|
-
*
|
39
|
+
* ${ instruction }
|
40
|
+
* [/INST]
|
41
|
+
* ${ response prefix }
|
41
42
|
* ```
|
42
43
|
*
|
43
44
|
* @see https://www.philschmid.de/llama-2#how-to-prompt-llama-2-chat
|
@@ -47,8 +48,8 @@ function instruction() {
|
|
47
48
|
stopSequences: [END_SEGMENT],
|
48
49
|
format(prompt) {
|
49
50
|
return `${BEGIN_SEGMENT}${BEGIN_INSTRUCTION}${prompt.system != null
|
50
|
-
?
|
51
|
-
: ""}${prompt.instruction}${END_INSTRUCTION}
|
51
|
+
? `${BEGIN_SYSTEM}${prompt.system}${END_SYSTEM}`
|
52
|
+
: ""}${prompt.instruction}${END_INSTRUCTION}${prompt.responsePrefix ?? ""}`;
|
52
53
|
},
|
53
54
|
};
|
54
55
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { TextGenerationPromptTemplate } from "../TextGenerationPromptTemplate.js";
|
2
2
|
import { TextChatPrompt } from "./ChatPrompt.js";
|
3
3
|
import { TextInstructionPrompt } from "./InstructionPrompt.js";
|
4
4
|
/**
|
@@ -11,7 +11,7 @@ import { TextInstructionPrompt } from "./InstructionPrompt.js";
|
|
11
11
|
*
|
12
12
|
* @see https://www.philschmid.de/llama-2#how-to-prompt-llama-2-chat
|
13
13
|
*/
|
14
|
-
export declare function text():
|
14
|
+
export declare function text(): TextGenerationPromptTemplate<string, string>;
|
15
15
|
/**
|
16
16
|
* Formats an instruction prompt as a Llama 2 prompt.
|
17
17
|
*
|
@@ -20,13 +20,14 @@ export declare function text(): TextGenerationPromptFormat<string, string>;
|
|
20
20
|
* <s>[INST] <<SYS>>
|
21
21
|
* ${ system prompt }
|
22
22
|
* <</SYS>>
|
23
|
-
*
|
24
|
-
*
|
23
|
+
* ${ instruction }
|
24
|
+
* [/INST]
|
25
|
+
* ${ response prefix }
|
25
26
|
* ```
|
26
27
|
*
|
27
28
|
* @see https://www.philschmid.de/llama-2#how-to-prompt-llama-2-chat
|
28
29
|
*/
|
29
|
-
export declare function instruction():
|
30
|
+
export declare function instruction(): TextGenerationPromptTemplate<TextInstructionPrompt, string>;
|
30
31
|
/**
|
31
32
|
* Formats a chat prompt as a Llama 2 prompt.
|
32
33
|
*
|
@@ -39,4 +40,4 @@ export declare function instruction(): TextGenerationPromptFormat<TextInstructio
|
|
39
40
|
* ${ user msg 1 } [/INST] ${ model response 1 } </s><s>[INST] ${ user msg 2 } [/INST] ${ model response 2 } </s><s>[INST] ${ user msg 3 } [/INST]
|
40
41
|
* ```
|
41
42
|
*/
|
42
|
-
export declare function chat():
|
43
|
+
export declare function chat(): TextGenerationPromptTemplate<TextChatPrompt, string>;
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { validateChatPrompt } from "./ChatPrompt.js";
|
2
2
|
// see https://github.com/facebookresearch/llama/blob/6c7fe276574e78057f917549435a2554000a876d/llama/generation.py#L44
|
3
3
|
const BEGIN_SEGMENT = "<s>";
|
4
|
-
const END_SEGMENT = "</s>";
|
5
|
-
const BEGIN_INSTRUCTION = "[INST]";
|
6
|
-
const END_INSTRUCTION = "[/INST]";
|
4
|
+
const END_SEGMENT = " </s>";
|
5
|
+
const BEGIN_INSTRUCTION = "[INST] ";
|
6
|
+
const END_INSTRUCTION = " [/INST] ";
|
7
7
|
const BEGIN_SYSTEM = "<<SYS>>\n";
|
8
8
|
const END_SYSTEM = "\n<</SYS>>\n\n";
|
9
9
|
/**
|
@@ -32,8 +32,9 @@ export function text() {
|
|
32
32
|
* <s>[INST] <<SYS>>
|
33
33
|
* ${ system prompt }
|
34
34
|
* <</SYS>>
|
35
|
-
*
|
36
|
-
*
|
35
|
+
* ${ instruction }
|
36
|
+
* [/INST]
|
37
|
+
* ${ response prefix }
|
37
38
|
* ```
|
38
39
|
*
|
39
40
|
* @see https://www.philschmid.de/llama-2#how-to-prompt-llama-2-chat
|
@@ -43,8 +44,8 @@ export function instruction() {
|
|
43
44
|
stopSequences: [END_SEGMENT],
|
44
45
|
format(prompt) {
|
45
46
|
return `${BEGIN_SEGMENT}${BEGIN_INSTRUCTION}${prompt.system != null
|
46
|
-
?
|
47
|
-
: ""}${prompt.instruction}${END_INSTRUCTION}
|
47
|
+
? `${BEGIN_SYSTEM}${prompt.system}${END_SYSTEM}`
|
48
|
+
: ""}${prompt.instruction}${END_INSTRUCTION}${prompt.responsePrefix ?? ""}`;
|
48
49
|
},
|
49
50
|
};
|
50
51
|
}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const Llama2PromptTemplate_js_1 = require("./Llama2PromptTemplate.cjs");
|
4
|
+
describe("text prompt", () => {
|
5
|
+
it("should format prompt", () => {
|
6
|
+
const prompt = (0, Llama2PromptTemplate_js_1.text)().format("prompt");
|
7
|
+
expect(prompt).toMatchSnapshot();
|
8
|
+
});
|
9
|
+
});
|
10
|
+
describe("instruction prompt", () => {
|
11
|
+
it("should format prompt with instruction", () => {
|
12
|
+
const prompt = (0, Llama2PromptTemplate_js_1.instruction)().format({
|
13
|
+
instruction: "instruction",
|
14
|
+
});
|
15
|
+
expect(prompt).toMatchSnapshot();
|
16
|
+
});
|
17
|
+
it("should format prompt with system and instruction", () => {
|
18
|
+
const prompt = (0, Llama2PromptTemplate_js_1.instruction)().format({
|
19
|
+
system: "system",
|
20
|
+
instruction: "instruction",
|
21
|
+
});
|
22
|
+
expect(prompt).toMatchSnapshot();
|
23
|
+
});
|
24
|
+
it("should format prompt with instruction and response prefix", () => {
|
25
|
+
const prompt = (0, Llama2PromptTemplate_js_1.instruction)().format({
|
26
|
+
instruction: "instruction",
|
27
|
+
responsePrefix: "response prefix",
|
28
|
+
});
|
29
|
+
expect(prompt).toMatchSnapshot();
|
30
|
+
});
|
31
|
+
});
|
32
|
+
describe("chat prompt", () => {
|
33
|
+
it("should format prompt with user message", () => {
|
34
|
+
const prompt = (0, Llama2PromptTemplate_js_1.chat)().format({
|
35
|
+
messages: [{ role: "user", content: "user message" }],
|
36
|
+
});
|
37
|
+
expect(prompt).toMatchSnapshot();
|
38
|
+
});
|
39
|
+
it("should format prompt with user-assistant-user messages", () => {
|
40
|
+
const prompt = (0, Llama2PromptTemplate_js_1.chat)().format({
|
41
|
+
messages: [
|
42
|
+
{ role: "user", content: "1st user message" },
|
43
|
+
{ role: "assistant", content: "assistant message" },
|
44
|
+
{ role: "user", content: "2nd user message" },
|
45
|
+
],
|
46
|
+
});
|
47
|
+
expect(prompt).toMatchSnapshot();
|
48
|
+
});
|
49
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import { chat, instruction, text } from "./Llama2PromptTemplate.js";
|
2
|
+
describe("text prompt", () => {
|
3
|
+
it("should format prompt", () => {
|
4
|
+
const prompt = text().format("prompt");
|
5
|
+
expect(prompt).toMatchSnapshot();
|
6
|
+
});
|
7
|
+
});
|
8
|
+
describe("instruction prompt", () => {
|
9
|
+
it("should format prompt with instruction", () => {
|
10
|
+
const prompt = instruction().format({
|
11
|
+
instruction: "instruction",
|
12
|
+
});
|
13
|
+
expect(prompt).toMatchSnapshot();
|
14
|
+
});
|
15
|
+
it("should format prompt with system and instruction", () => {
|
16
|
+
const prompt = instruction().format({
|
17
|
+
system: "system",
|
18
|
+
instruction: "instruction",
|
19
|
+
});
|
20
|
+
expect(prompt).toMatchSnapshot();
|
21
|
+
});
|
22
|
+
it("should format prompt with instruction and response prefix", () => {
|
23
|
+
const prompt = instruction().format({
|
24
|
+
instruction: "instruction",
|
25
|
+
responsePrefix: "response prefix",
|
26
|
+
});
|
27
|
+
expect(prompt).toMatchSnapshot();
|
28
|
+
});
|
29
|
+
});
|
30
|
+
describe("chat prompt", () => {
|
31
|
+
it("should format prompt with user message", () => {
|
32
|
+
const prompt = chat().format({
|
33
|
+
messages: [{ role: "user", content: "user message" }],
|
34
|
+
});
|
35
|
+
expect(prompt).toMatchSnapshot();
|
36
|
+
});
|
37
|
+
it("should format prompt with user-assistant-user messages", () => {
|
38
|
+
const prompt = chat().format({
|
39
|
+
messages: [
|
40
|
+
{ role: "user", content: "1st user message" },
|
41
|
+
{ role: "assistant", content: "assistant message" },
|
42
|
+
{ role: "user", content: "2nd user message" },
|
43
|
+
],
|
44
|
+
});
|
45
|
+
expect(prompt).toMatchSnapshot();
|
46
|
+
});
|
47
|
+
});
|
@@ -1,14 +1,14 @@
|
|
1
|
-
import {
|
1
|
+
import { TextGenerationPromptTemplate } from "../TextGenerationPromptTemplate.js";
|
2
2
|
import { TextChatPrompt } from "./ChatPrompt.js";
|
3
3
|
import { TextInstructionPrompt } from "./InstructionPrompt.js";
|
4
4
|
/**
|
5
5
|
* Formats a text prompt as a basic text prompt. Does not change the text prompt in any way.
|
6
6
|
*/
|
7
|
-
export declare const text: () =>
|
7
|
+
export declare const text: () => TextGenerationPromptTemplate<string, string>;
|
8
8
|
/**
|
9
9
|
* Formats an instruction prompt as a basic text prompt.
|
10
10
|
*/
|
11
|
-
export declare const instruction: () =>
|
11
|
+
export declare const instruction: () => TextGenerationPromptTemplate<TextInstructionPrompt, string>;
|
12
12
|
/**
|
13
13
|
* Formats a chat prompt as a basic text prompt.
|
14
14
|
*
|
@@ -20,4 +20,4 @@ export declare const chat: (options?: {
|
|
20
20
|
user?: string;
|
21
21
|
assistant?: string;
|
22
22
|
system?: string;
|
23
|
-
}) =>
|
23
|
+
}) => TextGenerationPromptTemplate<TextChatPrompt, string>;
|
@@ -0,0 +1,49 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const TextPromptTemplate_js_1 = require("./TextPromptTemplate.cjs");
|
4
|
+
describe("text prompt", () => {
|
5
|
+
it("should format prompt", () => {
|
6
|
+
const prompt = (0, TextPromptTemplate_js_1.text)().format("prompt");
|
7
|
+
expect(prompt).toMatchSnapshot();
|
8
|
+
});
|
9
|
+
});
|
10
|
+
describe("instruction prompt", () => {
|
11
|
+
it("should format prompt with instruction", () => {
|
12
|
+
const prompt = (0, TextPromptTemplate_js_1.instruction)().format({
|
13
|
+
instruction: "instruction",
|
14
|
+
});
|
15
|
+
expect(prompt).toMatchSnapshot();
|
16
|
+
});
|
17
|
+
it("should format prompt with system and instruction", () => {
|
18
|
+
const prompt = (0, TextPromptTemplate_js_1.instruction)().format({
|
19
|
+
system: "system",
|
20
|
+
instruction: "instruction",
|
21
|
+
});
|
22
|
+
expect(prompt).toMatchSnapshot();
|
23
|
+
});
|
24
|
+
it("should format prompt with instruction and response prefix", () => {
|
25
|
+
const prompt = (0, TextPromptTemplate_js_1.instruction)().format({
|
26
|
+
instruction: "instruction",
|
27
|
+
responsePrefix: "response prefix",
|
28
|
+
});
|
29
|
+
expect(prompt).toMatchSnapshot();
|
30
|
+
});
|
31
|
+
});
|
32
|
+
describe("chat prompt", () => {
|
33
|
+
it("should format prompt with user message", () => {
|
34
|
+
const prompt = (0, TextPromptTemplate_js_1.chat)().format({
|
35
|
+
messages: [{ role: "user", content: "user message" }],
|
36
|
+
});
|
37
|
+
expect(prompt).toMatchSnapshot();
|
38
|
+
});
|
39
|
+
it("should format prompt with user-assistant-user messages", () => {
|
40
|
+
const prompt = (0, TextPromptTemplate_js_1.chat)().format({
|
41
|
+
messages: [
|
42
|
+
{ role: "user", content: "1st user message" },
|
43
|
+
{ role: "assistant", content: "assistant message" },
|
44
|
+
{ role: "user", content: "2nd user message" },
|
45
|
+
],
|
46
|
+
});
|
47
|
+
expect(prompt).toMatchSnapshot();
|
48
|
+
});
|
49
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import { chat, instruction, text } from "./TextPromptTemplate.js";
|
2
|
+
describe("text prompt", () => {
|
3
|
+
it("should format prompt", () => {
|
4
|
+
const prompt = text().format("prompt");
|
5
|
+
expect(prompt).toMatchSnapshot();
|
6
|
+
});
|
7
|
+
});
|
8
|
+
describe("instruction prompt", () => {
|
9
|
+
it("should format prompt with instruction", () => {
|
10
|
+
const prompt = instruction().format({
|
11
|
+
instruction: "instruction",
|
12
|
+
});
|
13
|
+
expect(prompt).toMatchSnapshot();
|
14
|
+
});
|
15
|
+
it("should format prompt with system and instruction", () => {
|
16
|
+
const prompt = instruction().format({
|
17
|
+
system: "system",
|
18
|
+
instruction: "instruction",
|
19
|
+
});
|
20
|
+
expect(prompt).toMatchSnapshot();
|
21
|
+
});
|
22
|
+
it("should format prompt with instruction and response prefix", () => {
|
23
|
+
const prompt = instruction().format({
|
24
|
+
instruction: "instruction",
|
25
|
+
responsePrefix: "response prefix",
|
26
|
+
});
|
27
|
+
expect(prompt).toMatchSnapshot();
|
28
|
+
});
|
29
|
+
});
|
30
|
+
describe("chat prompt", () => {
|
31
|
+
it("should format prompt with user message", () => {
|
32
|
+
const prompt = chat().format({
|
33
|
+
messages: [{ role: "user", content: "user message" }],
|
34
|
+
});
|
35
|
+
expect(prompt).toMatchSnapshot();
|
36
|
+
});
|
37
|
+
it("should format prompt with user-assistant-user messages", () => {
|
38
|
+
const prompt = chat().format({
|
39
|
+
messages: [
|
40
|
+
{ role: "user", content: "1st user message" },
|
41
|
+
{ role: "assistant", content: "assistant message" },
|
42
|
+
{ role: "user", content: "2nd user message" },
|
43
|
+
],
|
44
|
+
});
|
45
|
+
expect(prompt).toMatchSnapshot();
|
46
|
+
});
|
47
|
+
});
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { TextGenerationPromptTemplate } from "../TextGenerationPromptTemplate.js";
|
2
2
|
import { TextChatPrompt } from "./ChatPrompt.js";
|
3
3
|
/**
|
4
4
|
* Formats a chat prompt as a Vicuna prompt.
|
@@ -13,4 +13,4 @@ import { TextChatPrompt } from "./ChatPrompt.js";
|
|
13
13
|
* ASSISTANT:
|
14
14
|
* ```
|
15
15
|
*/
|
16
|
-
export declare function chat():
|
16
|
+
export declare function chat(): TextGenerationPromptTemplate<TextChatPrompt, string>;
|
@@ -0,0 +1,21 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const VicunaPromptTemplate_js_1 = require("./VicunaPromptTemplate.cjs");
|
4
|
+
describe("chat prompt", () => {
|
5
|
+
it("should format prompt with user message", () => {
|
6
|
+
const prompt = (0, VicunaPromptTemplate_js_1.chat)().format({
|
7
|
+
messages: [{ role: "user", content: "user message" }],
|
8
|
+
});
|
9
|
+
expect(prompt).toMatchSnapshot();
|
10
|
+
});
|
11
|
+
it("should format prompt with user-assistant-user messages", () => {
|
12
|
+
const prompt = (0, VicunaPromptTemplate_js_1.chat)().format({
|
13
|
+
messages: [
|
14
|
+
{ role: "user", content: "1st user message" },
|
15
|
+
{ role: "assistant", content: "assistant message" },
|
16
|
+
{ role: "user", content: "2nd user message" },
|
17
|
+
],
|
18
|
+
});
|
19
|
+
expect(prompt).toMatchSnapshot();
|
20
|
+
});
|
21
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { chat } from "./VicunaPromptTemplate.js";
|
2
|
+
describe("chat prompt", () => {
|
3
|
+
it("should format prompt with user message", () => {
|
4
|
+
const prompt = chat().format({
|
5
|
+
messages: [{ role: "user", content: "user message" }],
|
6
|
+
});
|
7
|
+
expect(prompt).toMatchSnapshot();
|
8
|
+
});
|
9
|
+
it("should format prompt with user-assistant-user messages", () => {
|
10
|
+
const prompt = chat().format({
|
11
|
+
messages: [
|
12
|
+
{ role: "user", content: "1st user message" },
|
13
|
+
{ role: "assistant", content: "assistant message" },
|
14
|
+
{ role: "user", content: "2nd user message" },
|
15
|
+
],
|
16
|
+
});
|
17
|
+
expect(prompt).toMatchSnapshot();
|
18
|
+
});
|
19
|
+
});
|
@@ -26,14 +26,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
26
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
27
27
|
};
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
29
|
-
exports.
|
30
|
-
exports.
|
31
|
-
exports.
|
29
|
+
exports.VicunaPrompt = exports.TextPrompt = exports.Llama2Prompt = exports.ChatMLPrompt = exports.AlpacaPrompt = void 0;
|
30
|
+
exports.AlpacaPrompt = __importStar(require("./AlpacaPromptTemplate.cjs"));
|
31
|
+
exports.ChatMLPrompt = __importStar(require("./ChatMLPromptTemplate.cjs"));
|
32
32
|
__exportStar(require("./ChatPrompt.cjs"), exports);
|
33
33
|
__exportStar(require("./Content.cjs"), exports);
|
34
34
|
__exportStar(require("./InstructionPrompt.cjs"), exports);
|
35
|
-
exports.
|
35
|
+
exports.Llama2Prompt = __importStar(require("./Llama2PromptTemplate.cjs"));
|
36
36
|
__exportStar(require("./InvalidPromptError.cjs"), exports);
|
37
|
-
exports.
|
38
|
-
exports.
|
37
|
+
exports.TextPrompt = __importStar(require("./TextPromptTemplate.cjs"));
|
38
|
+
exports.VicunaPrompt = __importStar(require("./VicunaPromptTemplate.cjs"));
|
39
39
|
__exportStar(require("./trimChatPrompt.cjs"), exports);
|
@@ -0,0 +1,10 @@
|
|
1
|
+
export * as AlpacaPrompt from "./AlpacaPromptTemplate.js";
|
2
|
+
export * as ChatMLPrompt from "./ChatMLPromptTemplate.js";
|
3
|
+
export * from "./ChatPrompt.js";
|
4
|
+
export * from "./Content.js";
|
5
|
+
export * from "./InstructionPrompt.js";
|
6
|
+
export * as Llama2Prompt from "./Llama2PromptTemplate.js";
|
7
|
+
export * from "./InvalidPromptError.js";
|
8
|
+
export * as TextPrompt from "./TextPromptTemplate.js";
|
9
|
+
export * as VicunaPrompt from "./VicunaPromptTemplate.js";
|
10
|
+
export * from "./trimChatPrompt.js";
|
@@ -0,0 +1,10 @@
|
|
1
|
+
export * as AlpacaPrompt from "./AlpacaPromptTemplate.js";
|
2
|
+
export * as ChatMLPrompt from "./ChatMLPromptTemplate.js";
|
3
|
+
export * from "./ChatPrompt.js";
|
4
|
+
export * from "./Content.js";
|
5
|
+
export * from "./InstructionPrompt.js";
|
6
|
+
export * as Llama2Prompt from "./Llama2PromptTemplate.js";
|
7
|
+
export * from "./InvalidPromptError.js";
|
8
|
+
export * as TextPrompt from "./TextPromptTemplate.js";
|
9
|
+
export * as VicunaPrompt from "./VicunaPromptTemplate.js";
|
10
|
+
export * from "./trimChatPrompt.js";
|
package/model-function/index.cjs
CHANGED
@@ -19,14 +19,14 @@ __exportStar(require("./Model.cjs"), exports);
|
|
19
19
|
__exportStar(require("./ModelCallEvent.cjs"), exports);
|
20
20
|
__exportStar(require("./ModelCallMetadata.cjs"), exports);
|
21
21
|
__exportStar(require("./ModelInformation.cjs"), exports);
|
22
|
-
__exportStar(require("./
|
22
|
+
__exportStar(require("./PromptTemplate.cjs"), exports);
|
23
23
|
__exportStar(require("./SuccessfulModelCall.cjs"), exports);
|
24
24
|
__exportStar(require("./embed/EmbeddingEvent.cjs"), exports);
|
25
25
|
__exportStar(require("./embed/EmbeddingModel.cjs"), exports);
|
26
26
|
__exportStar(require("./embed/embed.cjs"), exports);
|
27
27
|
__exportStar(require("./generate-image/ImageGenerationEvent.cjs"), exports);
|
28
28
|
__exportStar(require("./generate-image/ImageGenerationModel.cjs"), exports);
|
29
|
-
__exportStar(require("./generate-image/
|
29
|
+
__exportStar(require("./generate-image/PromptTemplateImageGenerationModel.cjs"), exports);
|
30
30
|
__exportStar(require("./generate-image/generateImage.cjs"), exports);
|
31
31
|
__exportStar(require("./generate-speech/index.cjs"), exports);
|
32
32
|
__exportStar(require("./generate-structure/index.cjs"), exports);
|
@@ -3,14 +3,14 @@ export * from "./Model.js";
|
|
3
3
|
export * from "./ModelCallEvent.js";
|
4
4
|
export * from "./ModelCallMetadata.js";
|
5
5
|
export * from "./ModelInformation.js";
|
6
|
-
export * from "./
|
6
|
+
export * from "./PromptTemplate.js";
|
7
7
|
export * from "./SuccessfulModelCall.js";
|
8
8
|
export * from "./embed/EmbeddingEvent.js";
|
9
9
|
export * from "./embed/EmbeddingModel.js";
|
10
10
|
export * from "./embed/embed.js";
|
11
11
|
export * from "./generate-image/ImageGenerationEvent.js";
|
12
12
|
export * from "./generate-image/ImageGenerationModel.js";
|
13
|
-
export * from "./generate-image/
|
13
|
+
export * from "./generate-image/PromptTemplateImageGenerationModel.js";
|
14
14
|
export * from "./generate-image/generateImage.js";
|
15
15
|
export * from "./generate-speech/index.js";
|
16
16
|
export * from "./generate-structure/index.js";
|
package/model-function/index.js
CHANGED
@@ -3,14 +3,14 @@ export * from "./Model.js";
|
|
3
3
|
export * from "./ModelCallEvent.js";
|
4
4
|
export * from "./ModelCallMetadata.js";
|
5
5
|
export * from "./ModelInformation.js";
|
6
|
-
export * from "./
|
6
|
+
export * from "./PromptTemplate.js";
|
7
7
|
export * from "./SuccessfulModelCall.js";
|
8
8
|
export * from "./embed/EmbeddingEvent.js";
|
9
9
|
export * from "./embed/EmbeddingModel.js";
|
10
10
|
export * from "./embed/embed.js";
|
11
11
|
export * from "./generate-image/ImageGenerationEvent.js";
|
12
12
|
export * from "./generate-image/ImageGenerationModel.js";
|
13
|
-
export * from "./generate-image/
|
13
|
+
export * from "./generate-image/PromptTemplateImageGenerationModel.js";
|
14
14
|
export * from "./generate-image/generateImage.js";
|
15
15
|
export * from "./generate-speech/index.js";
|
16
16
|
export * from "./generate-structure/index.js";
|