modelfusion 0.27.3 → 0.29.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 +23 -6
- package/{model-function/BasicApiConfiguration.js → core/api/AbstractApiConfiguration.cjs} +6 -15
- package/core/api/AbstractApiConfiguration.d.ts +13 -0
- package/core/api/AbstractApiConfiguration.js +18 -0
- package/core/api/ApiConfiguration.d.ts +32 -0
- package/core/api/BaseUrlApiConfiguration.cjs +32 -0
- package/core/api/BaseUrlApiConfiguration.d.ts +19 -0
- package/core/api/BaseUrlApiConfiguration.js +28 -0
- package/core/api/index.cjs +27 -0
- package/core/api/index.d.ts +11 -0
- package/core/api/index.js +11 -0
- package/{util → core}/api/postToApi.d.ts +1 -1
- package/core/index.cjs +1 -0
- package/core/index.d.ts +1 -0
- package/core/index.js +1 -0
- package/model-function/ModelCallEvent.d.ts +3 -2
- package/model-function/SuccessfulModelCall.d.ts +1 -1
- package/model-function/describe-image/ImageDescriptionEvent.cjs +2 -0
- package/model-function/describe-image/ImageDescriptionEvent.d.ts +18 -0
- package/model-function/describe-image/ImageDescriptionEvent.js +1 -0
- package/model-function/describe-image/ImageDescriptionModel.cjs +2 -0
- package/model-function/describe-image/ImageDescriptionModel.d.ts +8 -0
- package/model-function/describe-image/ImageDescriptionModel.js +1 -0
- package/model-function/describe-image/describeImage.cjs +20 -0
- package/model-function/describe-image/describeImage.d.ts +9 -0
- package/model-function/describe-image/describeImage.js +16 -0
- package/model-function/executeCall.cjs +1 -1
- package/model-function/executeCall.js +1 -1
- package/model-function/generate-text/streamText.cjs +1 -1
- package/model-function/generate-text/streamText.js +1 -1
- package/model-function/index.cjs +3 -2
- package/model-function/index.d.ts +3 -2
- package/model-function/index.js +3 -2
- package/model-provider/automatic1111/Automatic1111ApiConfiguration.cjs +3 -2
- package/model-provider/automatic1111/Automatic1111ApiConfiguration.d.ts +4 -4
- package/model-provider/automatic1111/Automatic1111ApiConfiguration.js +3 -2
- package/model-provider/automatic1111/Automatic1111Error.cjs +1 -1
- package/model-provider/automatic1111/Automatic1111Error.d.ts +2 -2
- package/model-provider/automatic1111/Automatic1111Error.js +1 -1
- package/model-provider/automatic1111/Automatic1111ImageGenerationModel.cjs +2 -2
- package/model-provider/automatic1111/Automatic1111ImageGenerationModel.d.ts +1 -1
- package/model-provider/automatic1111/Automatic1111ImageGenerationModel.js +2 -2
- package/model-provider/cohere/CohereApiConfiguration.cjs +10 -17
- package/model-provider/cohere/CohereApiConfiguration.d.ts +4 -6
- package/model-provider/cohere/CohereApiConfiguration.js +10 -17
- package/model-provider/cohere/CohereError.cjs +1 -1
- package/model-provider/cohere/CohereError.d.ts +2 -2
- package/model-provider/cohere/CohereError.js +1 -1
- package/model-provider/cohere/CohereTextEmbeddingModel.cjs +2 -2
- package/model-provider/cohere/CohereTextEmbeddingModel.d.ts +1 -1
- package/model-provider/cohere/CohereTextEmbeddingModel.js +2 -2
- package/model-provider/cohere/CohereTextGenerationModel.cjs +2 -2
- package/model-provider/cohere/CohereTextGenerationModel.d.ts +2 -2
- package/model-provider/cohere/CohereTextGenerationModel.js +2 -2
- package/model-provider/cohere/CohereTokenizer.cjs +2 -2
- package/model-provider/cohere/CohereTokenizer.d.ts +1 -1
- package/model-provider/cohere/CohereTokenizer.js +2 -2
- package/model-provider/elevenlabs/ElevenLabsApiConfiguration.cjs +10 -17
- package/model-provider/elevenlabs/ElevenLabsApiConfiguration.d.ts +4 -6
- package/model-provider/elevenlabs/ElevenLabsApiConfiguration.js +10 -17
- package/model-provider/elevenlabs/ElevenLabsError.cjs +1 -1
- package/model-provider/elevenlabs/ElevenLabsError.d.ts +2 -2
- package/model-provider/elevenlabs/ElevenLabsError.js +1 -1
- package/model-provider/elevenlabs/ElevenLabsSpeechSynthesisModel.cjs +2 -2
- package/model-provider/elevenlabs/ElevenLabsSpeechSynthesisModel.d.ts +1 -1
- package/model-provider/elevenlabs/ElevenLabsSpeechSynthesisModel.js +2 -2
- package/model-provider/huggingface/HuggingFaceApiConfiguration.cjs +10 -17
- package/model-provider/huggingface/HuggingFaceApiConfiguration.d.ts +4 -6
- package/model-provider/huggingface/HuggingFaceApiConfiguration.js +10 -17
- package/model-provider/huggingface/HuggingFaceError.cjs +5 -3
- package/model-provider/huggingface/HuggingFaceError.d.ts +5 -5
- package/model-provider/huggingface/HuggingFaceError.js +5 -3
- package/model-provider/huggingface/HuggingFaceImageDescriptionModel.cjs +81 -0
- package/model-provider/huggingface/HuggingFaceImageDescriptionModel.d.ts +37 -0
- package/model-provider/huggingface/HuggingFaceImageDescriptionModel.js +74 -0
- package/model-provider/huggingface/HuggingFaceTextEmbeddingModel.cjs +2 -2
- package/model-provider/huggingface/HuggingFaceTextEmbeddingModel.d.ts +1 -1
- package/model-provider/huggingface/HuggingFaceTextEmbeddingModel.js +2 -2
- package/model-provider/huggingface/HuggingFaceTextGenerationModel.cjs +2 -2
- package/model-provider/huggingface/HuggingFaceTextGenerationModel.d.ts +1 -1
- package/model-provider/huggingface/HuggingFaceTextGenerationModel.js +2 -2
- package/model-provider/huggingface/index.cjs +1 -0
- package/model-provider/huggingface/index.d.ts +1 -0
- package/model-provider/huggingface/index.js +1 -0
- package/model-provider/llamacpp/LlamaCppApiConfiguration.cjs +3 -2
- package/model-provider/llamacpp/LlamaCppApiConfiguration.d.ts +4 -4
- package/model-provider/llamacpp/LlamaCppApiConfiguration.js +3 -2
- package/model-provider/llamacpp/LlamaCppError.cjs +1 -1
- package/model-provider/llamacpp/LlamaCppError.d.ts +2 -2
- package/model-provider/llamacpp/LlamaCppError.js +1 -1
- package/model-provider/llamacpp/LlamaCppTextEmbeddingModel.cjs +2 -2
- package/model-provider/llamacpp/LlamaCppTextEmbeddingModel.d.ts +1 -1
- package/model-provider/llamacpp/LlamaCppTextEmbeddingModel.js +2 -2
- package/model-provider/llamacpp/LlamaCppTextGenerationModel.cjs +2 -2
- package/model-provider/llamacpp/LlamaCppTextGenerationModel.d.ts +2 -2
- package/model-provider/llamacpp/LlamaCppTextGenerationModel.js +2 -2
- package/model-provider/llamacpp/LlamaCppTokenizer.cjs +2 -2
- package/model-provider/llamacpp/LlamaCppTokenizer.d.ts +1 -1
- package/model-provider/llamacpp/LlamaCppTokenizer.js +2 -2
- package/model-provider/lmnt/LmntApiConfiguration.cjs +10 -17
- package/model-provider/lmnt/LmntApiConfiguration.d.ts +4 -6
- package/model-provider/lmnt/LmntApiConfiguration.js +10 -17
- package/model-provider/lmnt/LmntError.cjs +1 -1
- package/model-provider/lmnt/LmntError.d.ts +2 -2
- package/model-provider/lmnt/LmntError.js +1 -1
- package/model-provider/lmnt/LmntSpeechSynthesisModel.cjs +2 -2
- package/model-provider/lmnt/LmntSpeechSynthesisModel.d.ts +1 -1
- package/model-provider/lmnt/LmntSpeechSynthesisModel.js +2 -2
- package/model-provider/openai/AzureOpenAIApiConfiguration.cjs +13 -20
- package/model-provider/openai/AzureOpenAIApiConfiguration.d.ts +5 -6
- package/model-provider/openai/AzureOpenAIApiConfiguration.js +13 -20
- package/model-provider/openai/OpenAIApiConfiguration.cjs +10 -19
- package/model-provider/openai/OpenAIApiConfiguration.d.ts +4 -6
- package/model-provider/openai/OpenAIApiConfiguration.js +10 -19
- package/model-provider/openai/OpenAIError.cjs +1 -1
- package/model-provider/openai/OpenAIError.d.ts +6 -6
- package/model-provider/openai/OpenAIError.js +1 -1
- package/model-provider/openai/OpenAIImageGenerationModel.cjs +2 -2
- package/model-provider/openai/OpenAIImageGenerationModel.d.ts +2 -2
- package/model-provider/openai/OpenAIImageGenerationModel.js +2 -2
- package/model-provider/openai/OpenAITextEmbeddingModel.cjs +2 -2
- package/model-provider/openai/OpenAITextEmbeddingModel.d.ts +1 -1
- package/model-provider/openai/OpenAITextEmbeddingModel.js +2 -2
- package/model-provider/openai/OpenAITextGenerationModel.cjs +2 -2
- package/model-provider/openai/OpenAITextGenerationModel.d.ts +2 -2
- package/model-provider/openai/OpenAITextGenerationModel.js +2 -2
- package/model-provider/openai/OpenAITranscriptionModel.cjs +2 -2
- package/model-provider/openai/OpenAITranscriptionModel.d.ts +2 -2
- package/model-provider/openai/OpenAITranscriptionModel.js +2 -2
- package/model-provider/openai/chat/OpenAIChatModel.cjs +2 -2
- package/model-provider/openai/chat/OpenAIChatModel.d.ts +2 -2
- package/model-provider/openai/chat/OpenAIChatModel.js +2 -2
- package/model-provider/stability/StabilityApiConfiguration.cjs +10 -19
- package/model-provider/stability/StabilityApiConfiguration.d.ts +4 -6
- package/model-provider/stability/StabilityApiConfiguration.js +10 -19
- package/model-provider/stability/StabilityError.cjs +1 -1
- package/model-provider/stability/StabilityError.d.ts +2 -2
- package/model-provider/stability/StabilityError.js +1 -1
- package/model-provider/stability/StabilityImageGenerationModel.cjs +2 -2
- package/model-provider/stability/StabilityImageGenerationModel.d.ts +1 -1
- package/model-provider/stability/StabilityImageGenerationModel.js +2 -2
- package/observability/helicone/HeliconeOpenAIApiConfiguration.cjs +17 -33
- package/observability/helicone/HeliconeOpenAIApiConfiguration.d.ts +4 -7
- package/observability/helicone/HeliconeOpenAIApiConfiguration.js +17 -33
- package/package.json +1 -1
- package/tool/executeTool.cjs +1 -1
- package/tool/executeTool.js +1 -1
- package/util/index.cjs +0 -9
- package/util/index.d.ts +0 -9
- package/util/index.js +0 -9
- package/model-function/ApiConfiguration.d.ts +0 -14
- package/model-function/BasicApiConfiguration.cjs +0 -35
- package/model-function/BasicApiConfiguration.d.ts +0 -15
- /package/{util → core}/api/AbortError.cjs +0 -0
- /package/{util → core}/api/AbortError.d.ts +0 -0
- /package/{util → core}/api/AbortError.js +0 -0
- /package/{util → core}/api/ApiCallError.cjs +0 -0
- /package/{util → core}/api/ApiCallError.d.ts +0 -0
- /package/{util → core}/api/ApiCallError.js +0 -0
- /package/{model-function → core/api}/ApiConfiguration.cjs +0 -0
- /package/{model-function → core/api}/ApiConfiguration.js +0 -0
- /package/{util → core}/api/RetryError.cjs +0 -0
- /package/{util → core}/api/RetryError.d.ts +0 -0
- /package/{util → core}/api/RetryError.js +0 -0
- /package/{util → core}/api/RetryFunction.cjs +0 -0
- /package/{util → core}/api/RetryFunction.d.ts +0 -0
- /package/{util → core}/api/RetryFunction.js +0 -0
- /package/{util → core}/api/ThrottleFunction.cjs +0 -0
- /package/{util → core}/api/ThrottleFunction.d.ts +0 -0
- /package/{util → core}/api/ThrottleFunction.js +0 -0
- /package/{util → core}/api/callWithRetryAndThrottle.cjs +0 -0
- /package/{util → core}/api/callWithRetryAndThrottle.d.ts +0 -0
- /package/{util → core}/api/callWithRetryAndThrottle.js +0 -0
- /package/{util → core}/api/loadApiKey.cjs +0 -0
- /package/{util → core}/api/loadApiKey.d.ts +0 -0
- /package/{util → core}/api/loadApiKey.js +0 -0
- /package/{util → core}/api/postToApi.cjs +0 -0
- /package/{util → core}/api/postToApi.js +0 -0
- /package/{util → core}/api/retryNever.cjs +0 -0
- /package/{util → core}/api/retryNever.d.ts +0 -0
- /package/{util → core}/api/retryNever.js +0 -0
- /package/{util → core}/api/retryWithExponentialBackoff.cjs +0 -0
- /package/{util → core}/api/retryWithExponentialBackoff.d.ts +0 -0
- /package/{util → core}/api/retryWithExponentialBackoff.js +0 -0
- /package/{util → core}/api/throttleMaxConcurrency.cjs +0 -0
- /package/{util → core}/api/throttleMaxConcurrency.d.ts +0 -0
- /package/{util → core}/api/throttleMaxConcurrency.js +0 -0
- /package/{util → core}/api/throttleUnlimitedConcurrency.cjs +0 -0
- /package/{util → core}/api/throttleUnlimitedConcurrency.d.ts +0 -0
- /package/{util → core}/api/throttleUnlimitedConcurrency.js +0 -0
@@ -0,0 +1,81 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.HuggingFaceImageDescriptionModel = void 0;
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
8
|
+
const callWithRetryAndThrottle_js_1 = require("../../core/api/callWithRetryAndThrottle.cjs");
|
9
|
+
const postToApi_js_1 = require("../../core/api/postToApi.cjs");
|
10
|
+
const AbstractModel_js_1 = require("../../model-function/AbstractModel.cjs");
|
11
|
+
const HuggingFaceApiConfiguration_js_1 = require("./HuggingFaceApiConfiguration.cjs");
|
12
|
+
const HuggingFaceError_js_1 = require("./HuggingFaceError.cjs");
|
13
|
+
/**
|
14
|
+
* Create an image to text model that calls a Hugging Face Image-to-Text Inference API.
|
15
|
+
*
|
16
|
+
* @see https://huggingface.co/tasks/image-to-text
|
17
|
+
*/
|
18
|
+
class HuggingFaceImageDescriptionModel extends AbstractModel_js_1.AbstractModel {
|
19
|
+
constructor(settings) {
|
20
|
+
super({ settings });
|
21
|
+
Object.defineProperty(this, "provider", {
|
22
|
+
enumerable: true,
|
23
|
+
configurable: true,
|
24
|
+
writable: true,
|
25
|
+
value: "huggingface"
|
26
|
+
});
|
27
|
+
Object.defineProperty(this, "countPromptTokens", {
|
28
|
+
enumerable: true,
|
29
|
+
configurable: true,
|
30
|
+
writable: true,
|
31
|
+
value: undefined
|
32
|
+
});
|
33
|
+
}
|
34
|
+
get modelName() {
|
35
|
+
return this.settings.model;
|
36
|
+
}
|
37
|
+
async callAPI(data, options) {
|
38
|
+
const run = options?.run;
|
39
|
+
const settings = options?.settings;
|
40
|
+
const callSettings = {
|
41
|
+
...this.settings,
|
42
|
+
...settings,
|
43
|
+
abortSignal: run?.abortSignal,
|
44
|
+
data,
|
45
|
+
};
|
46
|
+
return (0, callWithRetryAndThrottle_js_1.callWithRetryAndThrottle)({
|
47
|
+
retry: callSettings.api?.retry,
|
48
|
+
throttle: callSettings.api?.throttle,
|
49
|
+
call: async () => callHuggingFaceImageDescriptionAPI(callSettings),
|
50
|
+
});
|
51
|
+
}
|
52
|
+
get settingsForEvent() {
|
53
|
+
return {};
|
54
|
+
}
|
55
|
+
generateImageDescriptionResponse(data, options) {
|
56
|
+
return this.callAPI(data, options);
|
57
|
+
}
|
58
|
+
extractImageDescription(response) {
|
59
|
+
return response[0].generated_text;
|
60
|
+
}
|
61
|
+
withSettings(additionalSettings) {
|
62
|
+
return new HuggingFaceImageDescriptionModel(Object.assign({}, this.settings, additionalSettings));
|
63
|
+
}
|
64
|
+
}
|
65
|
+
exports.HuggingFaceImageDescriptionModel = HuggingFaceImageDescriptionModel;
|
66
|
+
const huggingFaceImageDescriptionResponseSchema = zod_1.default.array(zod_1.default.object({
|
67
|
+
generated_text: zod_1.default.string(),
|
68
|
+
}));
|
69
|
+
async function callHuggingFaceImageDescriptionAPI({ api = new HuggingFaceApiConfiguration_js_1.HuggingFaceApiConfiguration(), abortSignal, model, data, }) {
|
70
|
+
return (0, postToApi_js_1.postToApi)({
|
71
|
+
url: api.assembleUrl(`/${model}`),
|
72
|
+
headers: api.headers,
|
73
|
+
body: {
|
74
|
+
content: data,
|
75
|
+
values: {},
|
76
|
+
},
|
77
|
+
failedResponseHandler: HuggingFaceError_js_1.failedHuggingFaceCallResponseHandler,
|
78
|
+
successfulResponseHandler: (0, postToApi_js_1.createJsonResponseHandler)(huggingFaceImageDescriptionResponseSchema),
|
79
|
+
abortSignal,
|
80
|
+
});
|
81
|
+
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
2
|
+
import z from "zod";
|
3
|
+
import { ApiConfiguration } from "../../core/api/ApiConfiguration.js";
|
4
|
+
import { AbstractModel } from "../../model-function/AbstractModel.js";
|
5
|
+
import { ModelFunctionOptions } from "../../model-function/ModelFunctionOptions.js";
|
6
|
+
import { ImageDescriptionModel, ImageDescriptionModelSettings } from "../../model-function/describe-image/ImageDescriptionModel.js";
|
7
|
+
export interface HuggingFaceImageDescriptionModelSettings extends ImageDescriptionModelSettings {
|
8
|
+
api?: ApiConfiguration;
|
9
|
+
model: string;
|
10
|
+
}
|
11
|
+
/**
|
12
|
+
* Create an image to text model that calls a Hugging Face Image-to-Text Inference API.
|
13
|
+
*
|
14
|
+
* @see https://huggingface.co/tasks/image-to-text
|
15
|
+
*/
|
16
|
+
export declare class HuggingFaceImageDescriptionModel extends AbstractModel<HuggingFaceImageDescriptionModelSettings> implements ImageDescriptionModel<Buffer, HuggingFaceImageDescriptionResponse, HuggingFaceImageDescriptionModelSettings> {
|
17
|
+
constructor(settings: HuggingFaceImageDescriptionModelSettings);
|
18
|
+
readonly provider = "huggingface";
|
19
|
+
get modelName(): string;
|
20
|
+
callAPI(data: Buffer, options?: ModelFunctionOptions<HuggingFaceImageDescriptionModelSettings>): Promise<HuggingFaceImageDescriptionResponse>;
|
21
|
+
get settingsForEvent(): Partial<HuggingFaceImageDescriptionModelSettings>;
|
22
|
+
readonly countPromptTokens: undefined;
|
23
|
+
generateImageDescriptionResponse(data: Buffer, options?: ModelFunctionOptions<HuggingFaceImageDescriptionModelSettings>): Promise<{
|
24
|
+
generated_text: string;
|
25
|
+
}[]>;
|
26
|
+
extractImageDescription(response: HuggingFaceImageDescriptionResponse): string;
|
27
|
+
withSettings(additionalSettings: Partial<HuggingFaceImageDescriptionModelSettings>): this;
|
28
|
+
}
|
29
|
+
declare const huggingFaceImageDescriptionResponseSchema: z.ZodArray<z.ZodObject<{
|
30
|
+
generated_text: z.ZodString;
|
31
|
+
}, "strip", z.ZodTypeAny, {
|
32
|
+
generated_text: string;
|
33
|
+
}, {
|
34
|
+
generated_text: string;
|
35
|
+
}>, "many">;
|
36
|
+
export type HuggingFaceImageDescriptionResponse = z.infer<typeof huggingFaceImageDescriptionResponseSchema>;
|
37
|
+
export {};
|
@@ -0,0 +1,74 @@
|
|
1
|
+
import z from "zod";
|
2
|
+
import { callWithRetryAndThrottle } from "../../core/api/callWithRetryAndThrottle.js";
|
3
|
+
import { createJsonResponseHandler, postToApi, } from "../../core/api/postToApi.js";
|
4
|
+
import { AbstractModel } from "../../model-function/AbstractModel.js";
|
5
|
+
import { HuggingFaceApiConfiguration } from "./HuggingFaceApiConfiguration.js";
|
6
|
+
import { failedHuggingFaceCallResponseHandler } from "./HuggingFaceError.js";
|
7
|
+
/**
|
8
|
+
* Create an image to text model that calls a Hugging Face Image-to-Text Inference API.
|
9
|
+
*
|
10
|
+
* @see https://huggingface.co/tasks/image-to-text
|
11
|
+
*/
|
12
|
+
export class HuggingFaceImageDescriptionModel extends AbstractModel {
|
13
|
+
constructor(settings) {
|
14
|
+
super({ settings });
|
15
|
+
Object.defineProperty(this, "provider", {
|
16
|
+
enumerable: true,
|
17
|
+
configurable: true,
|
18
|
+
writable: true,
|
19
|
+
value: "huggingface"
|
20
|
+
});
|
21
|
+
Object.defineProperty(this, "countPromptTokens", {
|
22
|
+
enumerable: true,
|
23
|
+
configurable: true,
|
24
|
+
writable: true,
|
25
|
+
value: undefined
|
26
|
+
});
|
27
|
+
}
|
28
|
+
get modelName() {
|
29
|
+
return this.settings.model;
|
30
|
+
}
|
31
|
+
async callAPI(data, options) {
|
32
|
+
const run = options?.run;
|
33
|
+
const settings = options?.settings;
|
34
|
+
const callSettings = {
|
35
|
+
...this.settings,
|
36
|
+
...settings,
|
37
|
+
abortSignal: run?.abortSignal,
|
38
|
+
data,
|
39
|
+
};
|
40
|
+
return callWithRetryAndThrottle({
|
41
|
+
retry: callSettings.api?.retry,
|
42
|
+
throttle: callSettings.api?.throttle,
|
43
|
+
call: async () => callHuggingFaceImageDescriptionAPI(callSettings),
|
44
|
+
});
|
45
|
+
}
|
46
|
+
get settingsForEvent() {
|
47
|
+
return {};
|
48
|
+
}
|
49
|
+
generateImageDescriptionResponse(data, options) {
|
50
|
+
return this.callAPI(data, options);
|
51
|
+
}
|
52
|
+
extractImageDescription(response) {
|
53
|
+
return response[0].generated_text;
|
54
|
+
}
|
55
|
+
withSettings(additionalSettings) {
|
56
|
+
return new HuggingFaceImageDescriptionModel(Object.assign({}, this.settings, additionalSettings));
|
57
|
+
}
|
58
|
+
}
|
59
|
+
const huggingFaceImageDescriptionResponseSchema = z.array(z.object({
|
60
|
+
generated_text: z.string(),
|
61
|
+
}));
|
62
|
+
async function callHuggingFaceImageDescriptionAPI({ api = new HuggingFaceApiConfiguration(), abortSignal, model, data, }) {
|
63
|
+
return postToApi({
|
64
|
+
url: api.assembleUrl(`/${model}`),
|
65
|
+
headers: api.headers,
|
66
|
+
body: {
|
67
|
+
content: data,
|
68
|
+
values: {},
|
69
|
+
},
|
70
|
+
failedResponseHandler: failedHuggingFaceCallResponseHandler,
|
71
|
+
successfulResponseHandler: createJsonResponseHandler(huggingFaceImageDescriptionResponseSchema),
|
72
|
+
abortSignal,
|
73
|
+
});
|
74
|
+
}
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.HuggingFaceTextEmbeddingModel = void 0;
|
7
7
|
const zod_1 = __importDefault(require("zod"));
|
8
8
|
const AbstractModel_js_1 = require("../../model-function/AbstractModel.cjs");
|
9
|
-
const callWithRetryAndThrottle_js_1 = require("../../
|
10
|
-
const postToApi_js_1 = require("../../
|
9
|
+
const callWithRetryAndThrottle_js_1 = require("../../core/api/callWithRetryAndThrottle.cjs");
|
10
|
+
const postToApi_js_1 = require("../../core/api/postToApi.cjs");
|
11
11
|
const HuggingFaceError_js_1 = require("./HuggingFaceError.cjs");
|
12
12
|
const HuggingFaceApiConfiguration_js_1 = require("./HuggingFaceApiConfiguration.cjs");
|
13
13
|
/**
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import z from "zod";
|
2
2
|
import { AbstractModel } from "../../model-function/AbstractModel.js";
|
3
|
-
import { ApiConfiguration } from "../../
|
3
|
+
import { ApiConfiguration } from "../../core/api/ApiConfiguration.js";
|
4
4
|
import { ModelFunctionOptions } from "../../model-function/ModelFunctionOptions.js";
|
5
5
|
import { TextEmbeddingModel, TextEmbeddingModelSettings } from "../../model-function/embed-text/TextEmbeddingModel.js";
|
6
6
|
export interface HuggingFaceTextEmbeddingModelSettings extends TextEmbeddingModelSettings {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import z from "zod";
|
2
2
|
import { AbstractModel } from "../../model-function/AbstractModel.js";
|
3
|
-
import { callWithRetryAndThrottle } from "../../
|
4
|
-
import { createJsonResponseHandler, postJsonToApi, } from "../../
|
3
|
+
import { callWithRetryAndThrottle } from "../../core/api/callWithRetryAndThrottle.js";
|
4
|
+
import { createJsonResponseHandler, postJsonToApi, } from "../../core/api/postToApi.js";
|
5
5
|
import { failedHuggingFaceCallResponseHandler } from "./HuggingFaceError.js";
|
6
6
|
import { HuggingFaceApiConfiguration } from "./HuggingFaceApiConfiguration.js";
|
7
7
|
/**
|
@@ -7,8 +7,8 @@ exports.HuggingFaceTextGenerationModel = void 0;
|
|
7
7
|
const zod_1 = __importDefault(require("zod"));
|
8
8
|
const AbstractModel_js_1 = require("../../model-function/AbstractModel.cjs");
|
9
9
|
const PromptFormatTextGenerationModel_js_1 = require("../../prompt/PromptFormatTextGenerationModel.cjs");
|
10
|
-
const callWithRetryAndThrottle_js_1 = require("../../
|
11
|
-
const postToApi_js_1 = require("../../
|
10
|
+
const callWithRetryAndThrottle_js_1 = require("../../core/api/callWithRetryAndThrottle.cjs");
|
11
|
+
const postToApi_js_1 = require("../../core/api/postToApi.cjs");
|
12
12
|
const HuggingFaceApiConfiguration_js_1 = require("./HuggingFaceApiConfiguration.cjs");
|
13
13
|
const HuggingFaceError_js_1 = require("./HuggingFaceError.cjs");
|
14
14
|
/**
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import z from "zod";
|
2
2
|
import { AbstractModel } from "../../model-function/AbstractModel.js";
|
3
|
-
import { ApiConfiguration } from "../../
|
3
|
+
import { ApiConfiguration } from "../../core/api/ApiConfiguration.js";
|
4
4
|
import { ModelFunctionOptions } from "../../model-function/ModelFunctionOptions.js";
|
5
5
|
import { TextGenerationModel, TextGenerationModelSettings } from "../../model-function/generate-text/TextGenerationModel.js";
|
6
6
|
import { PromptFormat } from "../../prompt/PromptFormat.js";
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import z from "zod";
|
2
2
|
import { AbstractModel } from "../../model-function/AbstractModel.js";
|
3
3
|
import { PromptFormatTextGenerationModel } from "../../prompt/PromptFormatTextGenerationModel.js";
|
4
|
-
import { callWithRetryAndThrottle } from "../../
|
5
|
-
import { createJsonResponseHandler, postJsonToApi, } from "../../
|
4
|
+
import { callWithRetryAndThrottle } from "../../core/api/callWithRetryAndThrottle.js";
|
5
|
+
import { createJsonResponseHandler, postJsonToApi, } from "../../core/api/postToApi.js";
|
6
6
|
import { HuggingFaceApiConfiguration } from "./HuggingFaceApiConfiguration.js";
|
7
7
|
import { failedHuggingFaceCallResponseHandler } from "./HuggingFaceError.js";
|
8
8
|
/**
|
@@ -18,5 +18,6 @@ exports.HuggingFaceError = void 0;
|
|
18
18
|
__exportStar(require("./HuggingFaceApiConfiguration.cjs"), exports);
|
19
19
|
var HuggingFaceError_js_1 = require("./HuggingFaceError.cjs");
|
20
20
|
Object.defineProperty(exports, "HuggingFaceError", { enumerable: true, get: function () { return HuggingFaceError_js_1.HuggingFaceError; } });
|
21
|
+
__exportStar(require("./HuggingFaceImageDescriptionModel.cjs"), exports);
|
21
22
|
__exportStar(require("./HuggingFaceTextEmbeddingModel.cjs"), exports);
|
22
23
|
__exportStar(require("./HuggingFaceTextGenerationModel.cjs"), exports);
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export * from "./HuggingFaceApiConfiguration.js";
|
2
2
|
export { HuggingFaceError, HuggingFaceErrorData } from "./HuggingFaceError.js";
|
3
|
+
export * from "./HuggingFaceImageDescriptionModel.js";
|
3
4
|
export * from "./HuggingFaceTextEmbeddingModel.js";
|
4
5
|
export * from "./HuggingFaceTextGenerationModel.js";
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export * from "./HuggingFaceApiConfiguration.js";
|
2
2
|
export { HuggingFaceError } from "./HuggingFaceError.js";
|
3
|
+
export * from "./HuggingFaceImageDescriptionModel.js";
|
3
4
|
export * from "./HuggingFaceTextEmbeddingModel.js";
|
4
5
|
export * from "./HuggingFaceTextGenerationModel.js";
|
@@ -1,11 +1,12 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.LlamaCppApiConfiguration = void 0;
|
4
|
-
const
|
5
|
-
class LlamaCppApiConfiguration extends
|
4
|
+
const BaseUrlApiConfiguration_js_1 = require("../../core/api/BaseUrlApiConfiguration.cjs");
|
5
|
+
class LlamaCppApiConfiguration extends BaseUrlApiConfiguration_js_1.BaseUrlApiConfiguration {
|
6
6
|
constructor({ baseUrl = "http://127.0.0.1:8080", retry, throttle, } = {}) {
|
7
7
|
super({
|
8
8
|
baseUrl,
|
9
|
+
headers: {},
|
9
10
|
retry,
|
10
11
|
throttle,
|
11
12
|
});
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import {
|
2
|
-
import { RetryFunction } from "../../
|
3
|
-
import { ThrottleFunction } from "../../
|
4
|
-
export declare class LlamaCppApiConfiguration extends
|
1
|
+
import { BaseUrlApiConfiguration } from "../../core/api/BaseUrlApiConfiguration.js";
|
2
|
+
import { RetryFunction } from "../../core/api/RetryFunction.js";
|
3
|
+
import { ThrottleFunction } from "../../core/api/ThrottleFunction.js";
|
4
|
+
export declare class LlamaCppApiConfiguration extends BaseUrlApiConfiguration {
|
5
5
|
constructor({ baseUrl, retry, throttle, }?: {
|
6
6
|
baseUrl?: string;
|
7
7
|
retry?: RetryFunction;
|
@@ -1,8 +1,9 @@
|
|
1
|
-
import {
|
2
|
-
export class LlamaCppApiConfiguration extends
|
1
|
+
import { BaseUrlApiConfiguration } from "../../core/api/BaseUrlApiConfiguration.js";
|
2
|
+
export class LlamaCppApiConfiguration extends BaseUrlApiConfiguration {
|
3
3
|
constructor({ baseUrl = "http://127.0.0.1:8080", retry, throttle, } = {}) {
|
4
4
|
super({
|
5
5
|
baseUrl,
|
6
|
+
headers: {},
|
6
7
|
retry,
|
7
8
|
throttle,
|
8
9
|
});
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.failedLlamaCppCallResponseHandler = exports.LlamaCppError = exports.llamaCppErrorDataSchema = void 0;
|
7
7
|
const secure_json_parse_1 = __importDefault(require("secure-json-parse"));
|
8
8
|
const zod_1 = require("zod");
|
9
|
-
const ApiCallError_js_1 = require("../../
|
9
|
+
const ApiCallError_js_1 = require("../../core/api/ApiCallError.cjs");
|
10
10
|
exports.llamaCppErrorDataSchema = zod_1.z.object({
|
11
11
|
error: zod_1.z.string(),
|
12
12
|
});
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { z } from "zod";
|
2
|
-
import { ApiCallError } from "../../
|
3
|
-
import { ResponseHandler } from "../../
|
2
|
+
import { ApiCallError } from "../../core/api/ApiCallError.js";
|
3
|
+
import { ResponseHandler } from "../../core/api/postToApi.js";
|
4
4
|
export declare const llamaCppErrorDataSchema: z.ZodObject<{
|
5
5
|
error: z.ZodString;
|
6
6
|
}, "strip", z.ZodTypeAny, {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import SecureJSON from "secure-json-parse";
|
2
2
|
import { z } from "zod";
|
3
|
-
import { ApiCallError } from "../../
|
3
|
+
import { ApiCallError } from "../../core/api/ApiCallError.js";
|
4
4
|
export const llamaCppErrorDataSchema = z.object({
|
5
5
|
error: z.string(),
|
6
6
|
});
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.LlamaCppTextEmbeddingModel = void 0;
|
7
7
|
const zod_1 = __importDefault(require("zod"));
|
8
8
|
const AbstractModel_js_1 = require("../../model-function/AbstractModel.cjs");
|
9
|
-
const callWithRetryAndThrottle_js_1 = require("../../
|
10
|
-
const postToApi_js_1 = require("../../
|
9
|
+
const callWithRetryAndThrottle_js_1 = require("../../core/api/callWithRetryAndThrottle.cjs");
|
10
|
+
const postToApi_js_1 = require("../../core/api/postToApi.cjs");
|
11
11
|
const LlamaCppApiConfiguration_js_1 = require("./LlamaCppApiConfiguration.cjs");
|
12
12
|
const LlamaCppError_js_1 = require("./LlamaCppError.cjs");
|
13
13
|
const LlamaCppTokenizer_js_1 = require("./LlamaCppTokenizer.cjs");
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import z from "zod";
|
2
2
|
import { AbstractModel } from "../../model-function/AbstractModel.js";
|
3
|
-
import { ApiConfiguration } from "../../
|
3
|
+
import { ApiConfiguration } from "../../core/api/ApiConfiguration.js";
|
4
4
|
import { ModelFunctionOptions } from "../../model-function/ModelFunctionOptions.js";
|
5
5
|
import { TextEmbeddingModel, TextEmbeddingModelSettings } from "../../model-function/embed-text/TextEmbeddingModel.js";
|
6
6
|
export interface LlamaCppTextEmbeddingModelSettings extends TextEmbeddingModelSettings {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import z from "zod";
|
2
2
|
import { AbstractModel } from "../../model-function/AbstractModel.js";
|
3
|
-
import { callWithRetryAndThrottle } from "../../
|
4
|
-
import { createJsonResponseHandler, postJsonToApi, } from "../../
|
3
|
+
import { callWithRetryAndThrottle } from "../../core/api/callWithRetryAndThrottle.js";
|
4
|
+
import { createJsonResponseHandler, postJsonToApi, } from "../../core/api/postToApi.js";
|
5
5
|
import { LlamaCppApiConfiguration } from "./LlamaCppApiConfiguration.js";
|
6
6
|
import { failedLlamaCppCallResponseHandler } from "./LlamaCppError.js";
|
7
7
|
import { LlamaCppTokenizer } from "./LlamaCppTokenizer.js";
|
@@ -10,8 +10,8 @@ const AbstractModel_js_1 = require("../../model-function/AbstractModel.cjs");
|
|
10
10
|
const AsyncQueue_js_1 = require("../../model-function/generate-text/AsyncQueue.cjs");
|
11
11
|
const parseEventSourceReadableStream_js_1 = require("../../model-function/generate-text/parseEventSourceReadableStream.cjs");
|
12
12
|
const PromptFormatTextGenerationModel_js_1 = require("../../prompt/PromptFormatTextGenerationModel.cjs");
|
13
|
-
const callWithRetryAndThrottle_js_1 = require("../../
|
14
|
-
const postToApi_js_1 = require("../../
|
13
|
+
const callWithRetryAndThrottle_js_1 = require("../../core/api/callWithRetryAndThrottle.cjs");
|
14
|
+
const postToApi_js_1 = require("../../core/api/postToApi.cjs");
|
15
15
|
const LlamaCppApiConfiguration_js_1 = require("./LlamaCppApiConfiguration.cjs");
|
16
16
|
const LlamaCppError_js_1 = require("./LlamaCppError.cjs");
|
17
17
|
const LlamaCppTokenizer_js_1 = require("./LlamaCppTokenizer.cjs");
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import z from "zod";
|
2
2
|
import { AbstractModel } from "../../model-function/AbstractModel.js";
|
3
|
-
import { ApiConfiguration } from "../../
|
3
|
+
import { ApiConfiguration } from "../../core/api/ApiConfiguration.js";
|
4
4
|
import { ModelFunctionOptions } from "../../model-function/ModelFunctionOptions.js";
|
5
5
|
import { DeltaEvent } from "../../model-function/generate-text/DeltaEvent.js";
|
6
6
|
import { TextGenerationModel, TextGenerationModelSettings } from "../../model-function/generate-text/TextGenerationModel.js";
|
7
7
|
import { PromptFormat } from "../../prompt/PromptFormat.js";
|
8
8
|
import { PromptFormatTextGenerationModel } from "../../prompt/PromptFormatTextGenerationModel.js";
|
9
|
-
import { ResponseHandler } from "../../
|
9
|
+
import { ResponseHandler } from "../../core/api/postToApi.js";
|
10
10
|
import { LlamaCppTokenizer } from "./LlamaCppTokenizer.js";
|
11
11
|
export interface LlamaCppTextGenerationModelSettings<CONTEXT_WINDOW_SIZE extends number | undefined> extends TextGenerationModelSettings {
|
12
12
|
api?: ApiConfiguration;
|
@@ -4,8 +4,8 @@ import { AbstractModel } from "../../model-function/AbstractModel.js";
|
|
4
4
|
import { AsyncQueue } from "../../model-function/generate-text/AsyncQueue.js";
|
5
5
|
import { parseEventSourceReadableStream } from "../../model-function/generate-text/parseEventSourceReadableStream.js";
|
6
6
|
import { PromptFormatTextGenerationModel } from "../../prompt/PromptFormatTextGenerationModel.js";
|
7
|
-
import { callWithRetryAndThrottle } from "../../
|
8
|
-
import { createJsonResponseHandler, postJsonToApi, } from "../../
|
7
|
+
import { callWithRetryAndThrottle } from "../../core/api/callWithRetryAndThrottle.js";
|
8
|
+
import { createJsonResponseHandler, postJsonToApi, } from "../../core/api/postToApi.js";
|
9
9
|
import { LlamaCppApiConfiguration } from "./LlamaCppApiConfiguration.js";
|
10
10
|
import { failedLlamaCppCallResponseHandler } from "./LlamaCppError.js";
|
11
11
|
import { LlamaCppTokenizer } from "./LlamaCppTokenizer.js";
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
exports.LlamaCppTokenizer = void 0;
|
7
7
|
const zod_1 = __importDefault(require("zod"));
|
8
|
-
const callWithRetryAndThrottle_js_1 = require("../../
|
9
|
-
const postToApi_js_1 = require("../../
|
8
|
+
const callWithRetryAndThrottle_js_1 = require("../../core/api/callWithRetryAndThrottle.cjs");
|
9
|
+
const postToApi_js_1 = require("../../core/api/postToApi.cjs");
|
10
10
|
const LlamaCppApiConfiguration_js_1 = require("./LlamaCppApiConfiguration.cjs");
|
11
11
|
const LlamaCppError_js_1 = require("./LlamaCppError.cjs");
|
12
12
|
/**
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import z from "zod";
|
2
2
|
import { Run } from "../../core/Run.js";
|
3
|
-
import { ApiConfiguration } from "../../
|
3
|
+
import { ApiConfiguration } from "../../core/api/ApiConfiguration.js";
|
4
4
|
import { BasicTokenizer } from "../../model-function/tokenize-text/Tokenizer.js";
|
5
5
|
/**
|
6
6
|
* Tokenizer for LlamaCpp.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import z from "zod";
|
2
|
-
import { callWithRetryAndThrottle } from "../../
|
3
|
-
import { createJsonResponseHandler, postJsonToApi, } from "../../
|
2
|
+
import { callWithRetryAndThrottle } from "../../core/api/callWithRetryAndThrottle.js";
|
3
|
+
import { createJsonResponseHandler, postJsonToApi, } from "../../core/api/postToApi.js";
|
4
4
|
import { LlamaCppApiConfiguration } from "./LlamaCppApiConfiguration.js";
|
5
5
|
import { failedLlamaCppCallResponseHandler } from "./LlamaCppError.js";
|
6
6
|
/**
|
@@ -1,29 +1,22 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.LmntApiConfiguration = void 0;
|
4
|
-
const
|
5
|
-
const loadApiKey_js_1 = require("../../
|
6
|
-
class LmntApiConfiguration extends
|
4
|
+
const BaseUrlApiConfiguration_js_1 = require("../../core/api/BaseUrlApiConfiguration.cjs");
|
5
|
+
const loadApiKey_js_1 = require("../../core/api/loadApiKey.cjs");
|
6
|
+
class LmntApiConfiguration extends BaseUrlApiConfiguration_js_1.BaseUrlApiConfiguration {
|
7
7
|
constructor({ baseUrl = "https://api.lmnt.com/speech/beta", apiKey, retry, throttle, } = {}) {
|
8
8
|
super({
|
9
9
|
baseUrl,
|
10
|
+
headers: {
|
11
|
+
"X-API-Key": (0, loadApiKey_js_1.loadApiKey)({
|
12
|
+
apiKey,
|
13
|
+
environmentVariableName: "LMNT_API_KEY",
|
14
|
+
description: "LMNT",
|
15
|
+
}),
|
16
|
+
},
|
10
17
|
retry,
|
11
18
|
throttle,
|
12
19
|
});
|
13
|
-
Object.defineProperty(this, "apiKey", {
|
14
|
-
enumerable: true,
|
15
|
-
configurable: true,
|
16
|
-
writable: true,
|
17
|
-
value: void 0
|
18
|
-
});
|
19
|
-
this.apiKey = (0, loadApiKey_js_1.loadApiKey)({
|
20
|
-
apiKey,
|
21
|
-
environmentVariableName: "LMNT_API_KEY",
|
22
|
-
description: "LMNT",
|
23
|
-
});
|
24
|
-
}
|
25
|
-
get headers() {
|
26
|
-
return { "X-API-Key": this.apiKey };
|
27
20
|
}
|
28
21
|
}
|
29
22
|
exports.LmntApiConfiguration = LmntApiConfiguration;
|
@@ -1,13 +1,11 @@
|
|
1
|
-
import {
|
2
|
-
import { RetryFunction } from "../../
|
3
|
-
import { ThrottleFunction } from "../../
|
4
|
-
export declare class LmntApiConfiguration extends
|
5
|
-
readonly apiKey: string;
|
1
|
+
import { BaseUrlApiConfiguration } from "../../core/api/BaseUrlApiConfiguration.js";
|
2
|
+
import { RetryFunction } from "../../core/api/RetryFunction.js";
|
3
|
+
import { ThrottleFunction } from "../../core/api/ThrottleFunction.js";
|
4
|
+
export declare class LmntApiConfiguration extends BaseUrlApiConfiguration {
|
6
5
|
constructor({ baseUrl, apiKey, retry, throttle, }?: {
|
7
6
|
baseUrl?: string;
|
8
7
|
apiKey?: string;
|
9
8
|
retry?: RetryFunction;
|
10
9
|
throttle?: ThrottleFunction;
|
11
10
|
});
|
12
|
-
get headers(): Record<string, string>;
|
13
11
|
}
|
@@ -1,25 +1,18 @@
|
|
1
|
-
import {
|
2
|
-
import { loadApiKey } from "../../
|
3
|
-
export class LmntApiConfiguration extends
|
1
|
+
import { BaseUrlApiConfiguration } from "../../core/api/BaseUrlApiConfiguration.js";
|
2
|
+
import { loadApiKey } from "../../core/api/loadApiKey.js";
|
3
|
+
export class LmntApiConfiguration extends BaseUrlApiConfiguration {
|
4
4
|
constructor({ baseUrl = "https://api.lmnt.com/speech/beta", apiKey, retry, throttle, } = {}) {
|
5
5
|
super({
|
6
6
|
baseUrl,
|
7
|
+
headers: {
|
8
|
+
"X-API-Key": loadApiKey({
|
9
|
+
apiKey,
|
10
|
+
environmentVariableName: "LMNT_API_KEY",
|
11
|
+
description: "LMNT",
|
12
|
+
}),
|
13
|
+
},
|
7
14
|
retry,
|
8
15
|
throttle,
|
9
16
|
});
|
10
|
-
Object.defineProperty(this, "apiKey", {
|
11
|
-
enumerable: true,
|
12
|
-
configurable: true,
|
13
|
-
writable: true,
|
14
|
-
value: void 0
|
15
|
-
});
|
16
|
-
this.apiKey = loadApiKey({
|
17
|
-
apiKey,
|
18
|
-
environmentVariableName: "LMNT_API_KEY",
|
19
|
-
description: "LMNT",
|
20
|
-
});
|
21
|
-
}
|
22
|
-
get headers() {
|
23
|
-
return { "X-API-Key": this.apiKey };
|
24
17
|
}
|
25
18
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.failedLmntCallResponseHandler = void 0;
|
4
|
-
const ApiCallError_js_1 = require("../../
|
4
|
+
const ApiCallError_js_1 = require("../../core/api/ApiCallError.cjs");
|
5
5
|
const failedLmntCallResponseHandler = async ({ response, url, requestBodyValues }) => {
|
6
6
|
const responseBody = await response.text();
|
7
7
|
try {
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import { ApiCallError } from "../../
|
2
|
-
import { ResponseHandler } from "../../
|
1
|
+
import { ApiCallError } from "../../core/api/ApiCallError.js";
|
2
|
+
import { ResponseHandler } from "../../core/api/postToApi.js";
|
3
3
|
export declare const failedLmntCallResponseHandler: ResponseHandler<ApiCallError>;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ApiCallError } from "../../
|
1
|
+
import { ApiCallError } from "../../core/api/ApiCallError.js";
|
2
2
|
export const failedLmntCallResponseHandler = async ({ response, url, requestBodyValues }) => {
|
3
3
|
const responseBody = await response.text();
|
4
4
|
try {
|
@@ -2,8 +2,8 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.LmntSpeechSynthesisModel = void 0;
|
4
4
|
const AbstractModel_js_1 = require("../../model-function/AbstractModel.cjs");
|
5
|
-
const callWithRetryAndThrottle_js_1 = require("../../
|
6
|
-
const postToApi_js_1 = require("../../
|
5
|
+
const callWithRetryAndThrottle_js_1 = require("../../core/api/callWithRetryAndThrottle.cjs");
|
6
|
+
const postToApi_js_1 = require("../../core/api/postToApi.cjs");
|
7
7
|
const LmntApiConfiguration_js_1 = require("./LmntApiConfiguration.cjs");
|
8
8
|
const LmntError_js_1 = require("./LmntError.cjs");
|
9
9
|
/**
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
2
2
|
import { AbstractModel } from "../../model-function/AbstractModel.js";
|
3
|
-
import { ApiConfiguration } from "../../
|
3
|
+
import { ApiConfiguration } from "../../core/api/ApiConfiguration.js";
|
4
4
|
import { ModelFunctionOptions } from "../../model-function/ModelFunctionOptions.js";
|
5
5
|
import { SpeechSynthesisModel, SpeechSynthesisModelSettings } from "../../model-function/synthesize-speech/SpeechSynthesisModel.js";
|
6
6
|
export interface LmntSpeechSynthesisModelSettings extends SpeechSynthesisModelSettings {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { AbstractModel } from "../../model-function/AbstractModel.js";
|
2
|
-
import { callWithRetryAndThrottle } from "../../
|
3
|
-
import { createAudioMpegResponseHandler, postToApi, } from "../../
|
2
|
+
import { callWithRetryAndThrottle } from "../../core/api/callWithRetryAndThrottle.js";
|
3
|
+
import { createAudioMpegResponseHandler, postToApi, } from "../../core/api/postToApi.js";
|
4
4
|
import { LmntApiConfiguration } from "./LmntApiConfiguration.js";
|
5
5
|
import { failedLmntCallResponseHandler } from "./LmntError.js";
|
6
6
|
/**
|