@llumiverse/drivers 0.22.2 → 0.22.3
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/lib/cjs/adobe/firefly.js +2 -2
- package/lib/cjs/adobe/firefly.js.map +1 -1
- package/lib/cjs/azure/azure_foundry.js +11 -11
- package/lib/cjs/azure/azure_foundry.js.map +1 -1
- package/lib/cjs/bedrock/index.js +7 -7
- package/lib/cjs/bedrock/index.js.map +1 -1
- package/lib/cjs/groq/index.js +2 -2
- package/lib/cjs/groq/index.js.map +1 -1
- package/lib/cjs/huggingface_ie.js +3 -4
- package/lib/cjs/huggingface_ie.js.map +1 -1
- package/lib/cjs/index.js +2 -2
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/mistral/index.js +2 -2
- package/lib/cjs/mistral/index.js.map +1 -1
- package/lib/cjs/openai/azure_openai.js +1 -1
- package/lib/cjs/openai/azure_openai.js.map +1 -1
- package/lib/cjs/openai/index.js +3 -3
- package/lib/cjs/openai/index.js.map +1 -1
- package/lib/cjs/replicate.js +4 -4
- package/lib/cjs/replicate.js.map +1 -1
- package/lib/cjs/togetherai/index.js +2 -2
- package/lib/cjs/togetherai/index.js.map +1 -1
- package/lib/cjs/vertexai/index.js +82 -40
- package/lib/cjs/vertexai/index.js.map +1 -1
- package/lib/cjs/vertexai/models/claude.js +4 -4
- package/lib/cjs/vertexai/models/claude.js.map +1 -1
- package/lib/cjs/vertexai/models/gemini.js +15 -5
- package/lib/cjs/vertexai/models/gemini.js.map +1 -1
- package/lib/cjs/vertexai/models/imagen.js +2 -5
- package/lib/cjs/vertexai/models/imagen.js.map +1 -1
- package/lib/cjs/watsonx/index.js +3 -3
- package/lib/cjs/watsonx/index.js.map +1 -1
- package/lib/esm/adobe/firefly.js +2 -2
- package/lib/esm/adobe/firefly.js.map +1 -1
- package/lib/esm/azure/azure_foundry.js +11 -11
- package/lib/esm/azure/azure_foundry.js.map +1 -1
- package/lib/esm/bedrock/index.js +8 -8
- package/lib/esm/bedrock/index.js.map +1 -1
- package/lib/esm/groq/index.js +2 -2
- package/lib/esm/groq/index.js.map +1 -1
- package/lib/esm/huggingface_ie.js +4 -5
- package/lib/esm/huggingface_ie.js.map +1 -1
- package/lib/esm/index.js +2 -2
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/mistral/index.js +2 -2
- package/lib/esm/mistral/index.js.map +1 -1
- package/lib/esm/openai/azure_openai.js +1 -1
- package/lib/esm/openai/azure_openai.js.map +1 -1
- package/lib/esm/openai/index.js +3 -3
- package/lib/esm/openai/index.js.map +1 -1
- package/lib/esm/replicate.js +4 -4
- package/lib/esm/replicate.js.map +1 -1
- package/lib/esm/togetherai/index.js +2 -2
- package/lib/esm/togetherai/index.js.map +1 -1
- package/lib/esm/vertexai/index.js +83 -41
- package/lib/esm/vertexai/index.js.map +1 -1
- package/lib/esm/vertexai/models/claude.js +4 -4
- package/lib/esm/vertexai/models/claude.js.map +1 -1
- package/lib/esm/vertexai/models/gemini.js +15 -5
- package/lib/esm/vertexai/models/gemini.js.map +1 -1
- package/lib/esm/vertexai/models/imagen.js +3 -6
- package/lib/esm/vertexai/models/imagen.js.map +1 -1
- package/lib/esm/watsonx/index.js +3 -3
- package/lib/esm/watsonx/index.js.map +1 -1
- package/lib/types/bedrock/index.d.ts +1 -0
- package/lib/types/bedrock/index.d.ts.map +1 -1
- package/lib/types/huggingface_ie.d.ts +3 -3
- package/lib/types/huggingface_ie.d.ts.map +1 -1
- package/lib/types/index.d.ts +2 -2
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/replicate.d.ts.map +1 -1
- package/lib/types/vertexai/index.d.ts +12 -11
- package/lib/types/vertexai/index.d.ts.map +1 -1
- package/lib/types/vertexai/models/gemini.d.ts.map +1 -1
- package/lib/types/vertexai/models/imagen.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/bedrock/index.ts +5 -4
- package/src/vertexai/index.ts +53 -6
- package/src/vertexai/models/gemini.ts +18 -6
- package/src/vertexai/models/imagen.ts +3 -7
- package/lib/cjs/test-driver/TestErrorCompletionStream.js +0 -20
- package/lib/cjs/test-driver/TestErrorCompletionStream.js.map +0 -1
- package/lib/cjs/test-driver/TestValidationErrorCompletionStream.js +0 -24
- package/lib/cjs/test-driver/TestValidationErrorCompletionStream.js.map +0 -1
- package/lib/cjs/test-driver/index.js +0 -109
- package/lib/cjs/test-driver/index.js.map +0 -1
- package/lib/cjs/test-driver/utils.js +0 -30
- package/lib/cjs/test-driver/utils.js.map +0 -1
- package/lib/esm/src/adobe/firefly.js +0 -116
- package/lib/esm/src/adobe/firefly.js.map +0 -1
- package/lib/esm/src/azure/azure_foundry.js +0 -382
- package/lib/esm/src/azure/azure_foundry.js.map +0 -1
- package/lib/esm/src/bedrock/converse.js +0 -278
- package/lib/esm/src/bedrock/converse.js.map +0 -1
- package/lib/esm/src/bedrock/index.js +0 -962
- package/lib/esm/src/bedrock/index.js.map +0 -1
- package/lib/esm/src/bedrock/nova-image-payload.js +0 -203
- package/lib/esm/src/bedrock/nova-image-payload.js.map +0 -1
- package/lib/esm/src/bedrock/payloads.js +0 -2
- package/lib/esm/src/bedrock/payloads.js.map +0 -1
- package/lib/esm/src/bedrock/s3.js +0 -99
- package/lib/esm/src/bedrock/s3.js.map +0 -1
- package/lib/esm/src/bedrock/twelvelabs.js +0 -84
- package/lib/esm/src/bedrock/twelvelabs.js.map +0 -1
- package/lib/esm/src/groq/index.js +0 -286
- package/lib/esm/src/groq/index.js.map +0 -1
- package/lib/esm/src/huggingface_ie.js +0 -197
- package/lib/esm/src/huggingface_ie.js.map +0 -1
- package/lib/esm/src/index.js +0 -14
- package/lib/esm/src/index.js.map +0 -1
- package/lib/esm/src/mistral/index.js +0 -169
- package/lib/esm/src/mistral/index.js.map +0 -1
- package/lib/esm/src/mistral/types.js +0 -80
- package/lib/esm/src/mistral/types.js.map +0 -1
- package/lib/esm/src/openai/azure_openai.js +0 -68
- package/lib/esm/src/openai/azure_openai.js.map +0 -1
- package/lib/esm/src/openai/index.js +0 -464
- package/lib/esm/src/openai/index.js.map +0 -1
- package/lib/esm/src/openai/openai.js +0 -14
- package/lib/esm/src/openai/openai.js.map +0 -1
- package/lib/esm/src/openai/openai_format.js +0 -134
- package/lib/esm/src/openai/openai_format.js.map +0 -1
- package/lib/esm/src/replicate.js +0 -268
- package/lib/esm/src/replicate.js.map +0 -1
- package/lib/esm/src/test/TestErrorCompletionStream.js +0 -16
- package/lib/esm/src/test/TestErrorCompletionStream.js.map +0 -1
- package/lib/esm/src/test/TestValidationErrorCompletionStream.js +0 -20
- package/lib/esm/src/test/TestValidationErrorCompletionStream.js.map +0 -1
- package/lib/esm/src/test/index.js +0 -91
- package/lib/esm/src/test/index.js.map +0 -1
- package/lib/esm/src/test/utils.js +0 -25
- package/lib/esm/src/test/utils.js.map +0 -1
- package/lib/esm/src/test-driver/TestErrorCompletionStream.js +0 -16
- package/lib/esm/src/test-driver/TestErrorCompletionStream.js.map +0 -1
- package/lib/esm/src/test-driver/TestValidationErrorCompletionStream.js +0 -20
- package/lib/esm/src/test-driver/TestValidationErrorCompletionStream.js.map +0 -1
- package/lib/esm/src/test-driver/index.js +0 -91
- package/lib/esm/src/test-driver/index.js.map +0 -1
- package/lib/esm/src/test-driver/utils.js +0 -25
- package/lib/esm/src/test-driver/utils.js.map +0 -1
- package/lib/esm/src/togetherai/index.js +0 -122
- package/lib/esm/src/togetherai/index.js.map +0 -1
- package/lib/esm/src/togetherai/interfaces.js +0 -2
- package/lib/esm/src/togetherai/interfaces.js.map +0 -1
- package/lib/esm/src/vertexai/debug.js +0 -6
- package/lib/esm/src/vertexai/debug.js.map +0 -1
- package/lib/esm/src/vertexai/embeddings/embeddings-image.js +0 -24
- package/lib/esm/src/vertexai/embeddings/embeddings-image.js.map +0 -1
- package/lib/esm/src/vertexai/embeddings/embeddings-text.js +0 -20
- package/lib/esm/src/vertexai/embeddings/embeddings-text.js.map +0 -1
- package/lib/esm/src/vertexai/index.js +0 -383
- package/lib/esm/src/vertexai/index.js.map +0 -1
- package/lib/esm/src/vertexai/models/claude.js +0 -394
- package/lib/esm/src/vertexai/models/claude.js.map +0 -1
- package/lib/esm/src/vertexai/models/gemini.js +0 -817
- package/lib/esm/src/vertexai/models/gemini.js.map +0 -1
- package/lib/esm/src/vertexai/models/imagen.js +0 -302
- package/lib/esm/src/vertexai/models/imagen.js.map +0 -1
- package/lib/esm/src/vertexai/models/llama.js +0 -179
- package/lib/esm/src/vertexai/models/llama.js.map +0 -1
- package/lib/esm/src/vertexai/models.js +0 -32
- package/lib/esm/src/vertexai/models.js.map +0 -1
- package/lib/esm/src/watsonx/index.js +0 -157
- package/lib/esm/src/watsonx/index.js.map +0 -1
- package/lib/esm/src/watsonx/interfaces.js +0 -2
- package/lib/esm/src/watsonx/interfaces.js.map +0 -1
- package/lib/esm/src/xai/index.js +0 -64
- package/lib/esm/src/xai/index.js.map +0 -1
- package/lib/esm/test-driver/TestErrorCompletionStream.js +0 -16
- package/lib/esm/test-driver/TestErrorCompletionStream.js.map +0 -1
- package/lib/esm/test-driver/TestValidationErrorCompletionStream.js +0 -20
- package/lib/esm/test-driver/TestValidationErrorCompletionStream.js.map +0 -1
- package/lib/esm/test-driver/index.js +0 -91
- package/lib/esm/test-driver/index.js.map +0 -1
- package/lib/esm/test-driver/utils.js +0 -25
- package/lib/esm/test-driver/utils.js.map +0 -1
- package/lib/esm/tsconfig.tsbuildinfo +0 -1
- package/lib/types/src/adobe/firefly.d.ts +0 -29
- package/lib/types/src/azure/azure_foundry.d.ts +0 -49
- package/lib/types/src/bedrock/converse.d.ts +0 -8
- package/lib/types/src/bedrock/index.d.ts +0 -61
- package/lib/types/src/bedrock/nova-image-payload.d.ts +0 -73
- package/lib/types/src/bedrock/payloads.d.ts +0 -11
- package/lib/types/src/bedrock/s3.d.ts +0 -22
- package/lib/types/src/bedrock/twelvelabs.d.ts +0 -49
- package/lib/types/src/groq/index.d.ts +0 -26
- package/lib/types/src/huggingface_ie.d.ts +0 -34
- package/lib/types/src/index.d.ts +0 -13
- package/lib/types/src/mistral/index.d.ts +0 -24
- package/lib/types/src/mistral/types.d.ts +0 -131
- package/lib/types/src/openai/azure_openai.d.ts +0 -24
- package/lib/types/src/openai/index.d.ts +0 -24
- package/lib/types/src/openai/openai.d.ts +0 -14
- package/lib/types/src/openai/openai_format.d.ts +0 -18
- package/lib/types/src/replicate.d.ts +0 -47
- package/lib/types/src/test/TestErrorCompletionStream.d.ts +0 -8
- package/lib/types/src/test/TestValidationErrorCompletionStream.d.ts +0 -8
- package/lib/types/src/test/index.d.ts +0 -23
- package/lib/types/src/test/utils.d.ts +0 -4
- package/lib/types/src/test-driver/TestErrorCompletionStream.d.ts +0 -8
- package/lib/types/src/test-driver/TestValidationErrorCompletionStream.d.ts +0 -8
- package/lib/types/src/test-driver/index.d.ts +0 -23
- package/lib/types/src/test-driver/utils.d.ts +0 -4
- package/lib/types/src/togetherai/index.d.ts +0 -22
- package/lib/types/src/togetherai/interfaces.d.ts +0 -95
- package/lib/types/src/vertexai/debug.d.ts +0 -1
- package/lib/types/src/vertexai/embeddings/embeddings-image.d.ts +0 -10
- package/lib/types/src/vertexai/embeddings/embeddings-text.d.ts +0 -9
- package/lib/types/src/vertexai/index.d.ts +0 -52
- package/lib/types/src/vertexai/models/claude.d.ts +0 -19
- package/lib/types/src/vertexai/models/gemini.d.ts +0 -17
- package/lib/types/src/vertexai/models/imagen.d.ts +0 -74
- package/lib/types/src/vertexai/models/llama.d.ts +0 -19
- package/lib/types/src/vertexai/models.d.ts +0 -14
- package/lib/types/src/watsonx/index.d.ts +0 -26
- package/lib/types/src/watsonx/interfaces.d.ts +0 -64
- package/lib/types/src/xai/index.d.ts +0 -18
- package/lib/types/test-driver/TestErrorCompletionStream.d.ts +0 -9
- package/lib/types/test-driver/TestErrorCompletionStream.d.ts.map +0 -1
- package/lib/types/test-driver/TestValidationErrorCompletionStream.d.ts +0 -9
- package/lib/types/test-driver/TestValidationErrorCompletionStream.d.ts.map +0 -1
- package/lib/types/test-driver/index.d.ts +0 -24
- package/lib/types/test-driver/index.d.ts.map +0 -1
- package/lib/types/test-driver/utils.d.ts +0 -5
- package/lib/types/test-driver/utils.d.ts.map +0 -1
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { AIModel, AbstractDriver, Completion, CompletionChunkObject, DataSource, DriverOptions, EmbeddingsResult, ExecutionOptions, ModelSearchPayload, TrainingJob, TrainingOptions } from "@llumiverse/core";
|
|
2
|
-
import Replicate, { Prediction } from "replicate";
|
|
3
|
-
export interface ReplicateDriverOptions extends DriverOptions {
|
|
4
|
-
apiKey: string;
|
|
5
|
-
}
|
|
6
|
-
export declare class ReplicateDriver extends AbstractDriver<DriverOptions, string> {
|
|
7
|
-
static PROVIDER: string;
|
|
8
|
-
provider: string;
|
|
9
|
-
service: Replicate;
|
|
10
|
-
static parseModelId(modelId: string): {
|
|
11
|
-
owner: string;
|
|
12
|
-
model: string;
|
|
13
|
-
version: string;
|
|
14
|
-
};
|
|
15
|
-
constructor(options: ReplicateDriverOptions);
|
|
16
|
-
extractDataFromResponse(response: Prediction): Completion;
|
|
17
|
-
requestTextCompletionStream(prompt: string, options: ExecutionOptions): Promise<AsyncIterable<CompletionChunkObject>>;
|
|
18
|
-
requestTextCompletion(prompt: string, options: ExecutionOptions): Promise<{
|
|
19
|
-
result: {
|
|
20
|
-
type: "text";
|
|
21
|
-
value: string;
|
|
22
|
-
}[];
|
|
23
|
-
original_response: Prediction | undefined;
|
|
24
|
-
}>;
|
|
25
|
-
startTraining(dataset: DataSource, options: TrainingOptions): Promise<TrainingJob>;
|
|
26
|
-
/**
|
|
27
|
-
* This method is not returning a consistent TrainingJob like the one returned by startTraining
|
|
28
|
-
* Instead of returning the full model name `owner/model:version` it returns only the version `version
|
|
29
|
-
* @param jobId
|
|
30
|
-
* @returns
|
|
31
|
-
*/
|
|
32
|
-
cancelTraining(jobId: string): Promise<TrainingJob>;
|
|
33
|
-
/**
|
|
34
|
-
* This method is not returning a consistent TrainingJob like the one returned by startTraining
|
|
35
|
-
* Instead of returning the full model name `owner/model:version` it returns only the version `version
|
|
36
|
-
* @param jobId
|
|
37
|
-
* @returns
|
|
38
|
-
*/
|
|
39
|
-
getTrainingJob(jobId: string): Promise<TrainingJob>;
|
|
40
|
-
validateConnection(): Promise<boolean>;
|
|
41
|
-
_listTrainableModels(): Promise<AIModel[]>;
|
|
42
|
-
listTrainableModels(): Promise<AIModel[]>;
|
|
43
|
-
listModels(params?: ModelSearchPayload): Promise<AIModel[]>;
|
|
44
|
-
listModelVersions(owner: string, model: string): Promise<AIModel[]>;
|
|
45
|
-
searchModels(params: ModelSearchPayload): Promise<AIModel[]>;
|
|
46
|
-
generateEmbeddings(): Promise<EmbeddingsResult>;
|
|
47
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { CompletionStream, ExecutionOptions, ExecutionResponse, PromptSegment } from "@llumiverse/core";
|
|
2
|
-
export declare class TestErrorCompletionStream implements CompletionStream<PromptSegment[]> {
|
|
3
|
-
segments: PromptSegment[];
|
|
4
|
-
options: ExecutionOptions;
|
|
5
|
-
completion: ExecutionResponse<PromptSegment[]> | undefined;
|
|
6
|
-
constructor(segments: PromptSegment[], options: ExecutionOptions);
|
|
7
|
-
[Symbol.asyncIterator](): AsyncGenerator<string, void, unknown>;
|
|
8
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { CompletionStream, ExecutionOptions, ExecutionResponse, PromptSegment } from "@llumiverse/core";
|
|
2
|
-
export declare class TestValidationErrorCompletionStream implements CompletionStream<PromptSegment[]> {
|
|
3
|
-
segments: PromptSegment[];
|
|
4
|
-
options: ExecutionOptions;
|
|
5
|
-
completion: ExecutionResponse<PromptSegment[]> | undefined;
|
|
6
|
-
constructor(segments: PromptSegment[], options: ExecutionOptions);
|
|
7
|
-
[Symbol.asyncIterator](): AsyncGenerator<"Started TestValidationError.\n" | "chunk1\n" | "chunk2\n", void, unknown>;
|
|
8
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { AIModel, CompletionStream, Driver, EmbeddingsResult, ExecutionOptions, ExecutionResponse, PromptSegment, TrainingJob } from "@llumiverse/core";
|
|
2
|
-
export * from "./TestErrorCompletionStream.js";
|
|
3
|
-
export * from "./TestValidationErrorCompletionStream.js";
|
|
4
|
-
export declare enum TestDriverModels {
|
|
5
|
-
executionError = "execution-error",
|
|
6
|
-
validationError = "validation-error"
|
|
7
|
-
}
|
|
8
|
-
export declare class TestDriver implements Driver<PromptSegment[]> {
|
|
9
|
-
provider: string;
|
|
10
|
-
createTrainingPrompt(): Promise<string>;
|
|
11
|
-
startTraining(): Promise<TrainingJob>;
|
|
12
|
-
cancelTraining(): Promise<TrainingJob>;
|
|
13
|
-
getTrainingJob(_jobId: string): Promise<TrainingJob>;
|
|
14
|
-
createPrompt(segments: PromptSegment[], _opts: ExecutionOptions): Promise<PromptSegment[]>;
|
|
15
|
-
execute(segments: PromptSegment[], options: ExecutionOptions): Promise<ExecutionResponse<PromptSegment[]>>;
|
|
16
|
-
stream(segments: PromptSegment[], options: ExecutionOptions): Promise<CompletionStream<PromptSegment[]>>;
|
|
17
|
-
listTrainableModels(): Promise<AIModel<string>[]>;
|
|
18
|
-
listModels(): Promise<AIModel<string>[]>;
|
|
19
|
-
validateConnection(): Promise<boolean>;
|
|
20
|
-
generateEmbeddings(): Promise<EmbeddingsResult>;
|
|
21
|
-
executeError(segments: PromptSegment[], _options: ExecutionOptions): Promise<ExecutionResponse<PromptSegment[]>>;
|
|
22
|
-
executeValidationError(segments: PromptSegment[], _options: ExecutionOptions): Promise<ExecutionResponse<PromptSegment[]>>;
|
|
23
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ExecutionResponse, PromptSegment } from "@llumiverse/core";
|
|
2
|
-
export declare function throwError(message: string, prompt: PromptSegment[]): never;
|
|
3
|
-
export declare function createValidationErrorCompletion(segments: PromptSegment[]): ExecutionResponse<PromptSegment[]>;
|
|
4
|
-
export declare function sleep(ms: number): Promise<unknown>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { CompletionStream, ExecutionOptions, ExecutionResponse, PromptSegment } from "@llumiverse/core";
|
|
2
|
-
export declare class TestErrorCompletionStream implements CompletionStream<PromptSegment[]> {
|
|
3
|
-
segments: PromptSegment[];
|
|
4
|
-
options: ExecutionOptions;
|
|
5
|
-
completion: ExecutionResponse<PromptSegment[]> | undefined;
|
|
6
|
-
constructor(segments: PromptSegment[], options: ExecutionOptions);
|
|
7
|
-
[Symbol.asyncIterator](): AsyncGenerator<string, void, unknown>;
|
|
8
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { CompletionStream, ExecutionOptions, ExecutionResponse, PromptSegment } from "@llumiverse/core";
|
|
2
|
-
export declare class TestValidationErrorCompletionStream implements CompletionStream<PromptSegment[]> {
|
|
3
|
-
segments: PromptSegment[];
|
|
4
|
-
options: ExecutionOptions;
|
|
5
|
-
completion: ExecutionResponse<PromptSegment[]> | undefined;
|
|
6
|
-
constructor(segments: PromptSegment[], options: ExecutionOptions);
|
|
7
|
-
[Symbol.asyncIterator](): AsyncGenerator<"Started TestValidationError.\n" | "chunk1\n" | "chunk2\n", void, unknown>;
|
|
8
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { AIModel, CompletionStream, Driver, EmbeddingsResult, ExecutionOptions, ExecutionResponse, PromptSegment, TrainingJob } from "@llumiverse/core";
|
|
2
|
-
export * from "./TestErrorCompletionStream.js";
|
|
3
|
-
export * from "./TestValidationErrorCompletionStream.js";
|
|
4
|
-
export declare enum TestDriverModels {
|
|
5
|
-
executionError = "execution-error",
|
|
6
|
-
validationError = "validation-error"
|
|
7
|
-
}
|
|
8
|
-
export declare class TestDriver implements Driver<PromptSegment[]> {
|
|
9
|
-
provider: string;
|
|
10
|
-
createTrainingPrompt(): Promise<string>;
|
|
11
|
-
startTraining(): Promise<TrainingJob>;
|
|
12
|
-
cancelTraining(): Promise<TrainingJob>;
|
|
13
|
-
getTrainingJob(_jobId: string): Promise<TrainingJob>;
|
|
14
|
-
createPrompt(segments: PromptSegment[], _opts: ExecutionOptions): Promise<PromptSegment[]>;
|
|
15
|
-
execute(segments: PromptSegment[], options: ExecutionOptions): Promise<ExecutionResponse<PromptSegment[]>>;
|
|
16
|
-
stream(segments: PromptSegment[], options: ExecutionOptions): Promise<CompletionStream<PromptSegment[]>>;
|
|
17
|
-
listTrainableModels(): Promise<AIModel<string>[]>;
|
|
18
|
-
listModels(): Promise<AIModel<string>[]>;
|
|
19
|
-
validateConnection(): Promise<boolean>;
|
|
20
|
-
generateEmbeddings(): Promise<EmbeddingsResult>;
|
|
21
|
-
executeError(segments: PromptSegment[], _options: ExecutionOptions): Promise<ExecutionResponse<PromptSegment[]>>;
|
|
22
|
-
executeValidationError(segments: PromptSegment[], _options: ExecutionOptions): Promise<ExecutionResponse<PromptSegment[]>>;
|
|
23
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ExecutionResponse, PromptSegment } from "@llumiverse/core";
|
|
2
|
-
export declare function throwError(message: string, prompt: PromptSegment[]): never;
|
|
3
|
-
export declare function createValidationErrorCompletion(segments: PromptSegment[]): ExecutionResponse<PromptSegment[]>;
|
|
4
|
-
export declare function sleep(ms: number): Promise<unknown>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { AIModel, AbstractDriver, Completion, CompletionChunkObject, DriverOptions, EmbeddingsResult, ExecutionOptions } from "@llumiverse/core";
|
|
2
|
-
import { FetchClient } from "@vertesia/api-fetch-client";
|
|
3
|
-
interface TogetherAIDriverOptions extends DriverOptions {
|
|
4
|
-
apiKey: string;
|
|
5
|
-
}
|
|
6
|
-
export declare class TogetherAIDriver extends AbstractDriver<TogetherAIDriverOptions, string> {
|
|
7
|
-
static PROVIDER: string;
|
|
8
|
-
provider: string;
|
|
9
|
-
apiKey: string;
|
|
10
|
-
fetchClient: FetchClient;
|
|
11
|
-
constructor(options: TogetherAIDriverOptions);
|
|
12
|
-
getResponseFormat: (options: ExecutionOptions) => {
|
|
13
|
-
type: string;
|
|
14
|
-
schema: any;
|
|
15
|
-
} | undefined;
|
|
16
|
-
requestTextCompletion(prompt: string, options: ExecutionOptions): Promise<Completion>;
|
|
17
|
-
requestTextCompletionStream(prompt: string, options: ExecutionOptions): Promise<AsyncIterable<CompletionChunkObject>>;
|
|
18
|
-
listModels(): Promise<AIModel<string>[]>;
|
|
19
|
-
validateConnection(): Promise<boolean>;
|
|
20
|
-
generateEmbeddings(): Promise<EmbeddingsResult>;
|
|
21
|
-
}
|
|
22
|
-
export {};
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
interface ModelInstanceConfig {
|
|
2
|
-
appearsIn: any[];
|
|
3
|
-
order: number;
|
|
4
|
-
}
|
|
5
|
-
interface Config {
|
|
6
|
-
stop: string[];
|
|
7
|
-
prompt_format: string;
|
|
8
|
-
chat_template: string;
|
|
9
|
-
}
|
|
10
|
-
interface Pricing {
|
|
11
|
-
input: number;
|
|
12
|
-
output: number;
|
|
13
|
-
hourly: number;
|
|
14
|
-
}
|
|
15
|
-
interface Instance {
|
|
16
|
-
av_zone: string;
|
|
17
|
-
cluster: string;
|
|
18
|
-
}
|
|
19
|
-
interface Ask {
|
|
20
|
-
[key: string]: number;
|
|
21
|
-
}
|
|
22
|
-
interface Gpu {
|
|
23
|
-
[key: string]: number;
|
|
24
|
-
}
|
|
25
|
-
interface Price {
|
|
26
|
-
base: number;
|
|
27
|
-
fine_tune: number;
|
|
28
|
-
hourly: number;
|
|
29
|
-
input: number;
|
|
30
|
-
output: number;
|
|
31
|
-
}
|
|
32
|
-
interface Stat {
|
|
33
|
-
av_zone: string;
|
|
34
|
-
cluster: string;
|
|
35
|
-
capacity: number;
|
|
36
|
-
qps: number;
|
|
37
|
-
throughput_in: number;
|
|
38
|
-
throughput_out: number;
|
|
39
|
-
error_rate: number;
|
|
40
|
-
retry_rate: number;
|
|
41
|
-
}
|
|
42
|
-
interface Depth {
|
|
43
|
-
num_asks: number;
|
|
44
|
-
num_bids: number;
|
|
45
|
-
num_running: number;
|
|
46
|
-
asks: Ask;
|
|
47
|
-
asks_updated: string;
|
|
48
|
-
gpus: Gpu;
|
|
49
|
-
qps: number;
|
|
50
|
-
permit_required: boolean;
|
|
51
|
-
price: Price;
|
|
52
|
-
throughput_in: number;
|
|
53
|
-
throughput_out: number;
|
|
54
|
-
stats: Stat[];
|
|
55
|
-
}
|
|
56
|
-
export interface TogetherModelInfo {
|
|
57
|
-
modelInstanceConfig: ModelInstanceConfig;
|
|
58
|
-
_id: string;
|
|
59
|
-
name: string;
|
|
60
|
-
display_name: string;
|
|
61
|
-
display_type: string;
|
|
62
|
-
description: string;
|
|
63
|
-
license: string;
|
|
64
|
-
creator_organization: string;
|
|
65
|
-
hardware_label: string;
|
|
66
|
-
num_parameters: number;
|
|
67
|
-
show_in_playground: boolean;
|
|
68
|
-
isFeaturedModel: boolean;
|
|
69
|
-
context_length: number;
|
|
70
|
-
config: Config;
|
|
71
|
-
pricing: Pricing;
|
|
72
|
-
created_at: string;
|
|
73
|
-
update_at: string;
|
|
74
|
-
instances: Instance[];
|
|
75
|
-
access: string;
|
|
76
|
-
link: string;
|
|
77
|
-
descriptionLink: string;
|
|
78
|
-
depth: Depth;
|
|
79
|
-
}
|
|
80
|
-
export interface TextCompletion {
|
|
81
|
-
id: string;
|
|
82
|
-
choices: {
|
|
83
|
-
text: string;
|
|
84
|
-
finish_reason: string;
|
|
85
|
-
}[];
|
|
86
|
-
usage: {
|
|
87
|
-
prompt_tokens: number;
|
|
88
|
-
completion_tokens: number;
|
|
89
|
-
total_tokens: number;
|
|
90
|
-
};
|
|
91
|
-
created: number;
|
|
92
|
-
model: string;
|
|
93
|
-
object: string;
|
|
94
|
-
}
|
|
95
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function logObject(prefix: string, obj: any): void;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { EmbeddingsOptions, EmbeddingsResult } from '@llumiverse/core';
|
|
2
|
-
import { VertexAIDriver } from '../index.js';
|
|
3
|
-
export interface ImageEmbeddingsOptions {
|
|
4
|
-
model?: string;
|
|
5
|
-
image?: {
|
|
6
|
-
bytesBase64Encoded?: string;
|
|
7
|
-
};
|
|
8
|
-
text: string;
|
|
9
|
-
}
|
|
10
|
-
export declare function getEmbeddingsForImages(driver: VertexAIDriver, options: EmbeddingsOptions): Promise<EmbeddingsResult>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { EmbeddingsResult } from '@llumiverse/core';
|
|
2
|
-
import { VertexAIDriver } from '../index.js';
|
|
3
|
-
export interface TextEmbeddingsOptions {
|
|
4
|
-
model?: string;
|
|
5
|
-
task_type?: "RETRIEVAL_QUERY" | "RETRIEVAL_DOCUMENT" | "SEMANTIC_SIMILARITY" | "CLASSIFICATION" | "CLUSTERING";
|
|
6
|
-
title?: string;
|
|
7
|
-
content: string;
|
|
8
|
-
}
|
|
9
|
-
export declare function getEmbeddingsForText(driver: VertexAIDriver, options: TextEmbeddingsOptions): Promise<EmbeddingsResult>;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { AnthropicVertex } from "@anthropic-ai/vertex-sdk";
|
|
2
|
-
import { PredictionServiceClient, v1beta1 } from "@google-cloud/aiplatform";
|
|
3
|
-
import { Content, GoogleGenAI, Model } from "@google/genai";
|
|
4
|
-
import { AIModel, AbstractDriver, Completion, CompletionChunkObject, DriverOptions, EmbeddingsOptions, EmbeddingsResult, ExecutionOptions, ModelSearchPayload, PromptSegment } from "@llumiverse/core";
|
|
5
|
-
import { FetchClient } from "@vertesia/api-fetch-client";
|
|
6
|
-
import { GoogleAuth, GoogleAuthOptions } from "google-auth-library";
|
|
7
|
-
import { ImagenPrompt } from "./models/imagen.js";
|
|
8
|
-
export interface VertexAIDriverOptions extends DriverOptions {
|
|
9
|
-
project: string;
|
|
10
|
-
region: string;
|
|
11
|
-
googleAuthOptions?: GoogleAuthOptions;
|
|
12
|
-
}
|
|
13
|
-
export interface GenerateContentPrompt {
|
|
14
|
-
contents: Content[];
|
|
15
|
-
system?: Content;
|
|
16
|
-
}
|
|
17
|
-
export type VertexAIPrompt = ImagenPrompt | GenerateContentPrompt;
|
|
18
|
-
export declare function trimModelName(model: string): string;
|
|
19
|
-
export declare class VertexAIDriver extends AbstractDriver<VertexAIDriverOptions, VertexAIPrompt> {
|
|
20
|
-
static PROVIDER: string;
|
|
21
|
-
provider: string;
|
|
22
|
-
aiplatform: v1beta1.ModelServiceClient | undefined;
|
|
23
|
-
anthropicClient: AnthropicVertex | undefined;
|
|
24
|
-
fetchClient: FetchClient | undefined;
|
|
25
|
-
googleGenAI: GoogleGenAI | undefined;
|
|
26
|
-
llamaClient: FetchClient & {
|
|
27
|
-
region?: string;
|
|
28
|
-
} | undefined;
|
|
29
|
-
modelGarden: v1beta1.ModelGardenServiceClient | undefined;
|
|
30
|
-
imagenClient: PredictionServiceClient | undefined;
|
|
31
|
-
googleAuth: GoogleAuth<any>;
|
|
32
|
-
private authClientPromise;
|
|
33
|
-
constructor(options: VertexAIDriverOptions);
|
|
34
|
-
private getAuthClient;
|
|
35
|
-
getGoogleGenAIClient(region?: string): GoogleGenAI;
|
|
36
|
-
getFetchClient(): FetchClient;
|
|
37
|
-
getLLamaClient(region?: string): FetchClient;
|
|
38
|
-
getAnthropicClient(region?: string): Promise<AnthropicVertex>;
|
|
39
|
-
getAIPlatformClient(): Promise<v1beta1.ModelServiceClient>;
|
|
40
|
-
getModelGardenClient(): Promise<v1beta1.ModelGardenServiceClient>;
|
|
41
|
-
getImagenClient(): Promise<PredictionServiceClient>;
|
|
42
|
-
validateResult(result: Completion, options: ExecutionOptions): void;
|
|
43
|
-
protected canStream(options: ExecutionOptions): Promise<boolean>;
|
|
44
|
-
createPrompt(segments: PromptSegment[], options: ExecutionOptions): Promise<VertexAIPrompt>;
|
|
45
|
-
requestTextCompletion(prompt: VertexAIPrompt, options: ExecutionOptions): Promise<Completion>;
|
|
46
|
-
requestTextCompletionStream(prompt: VertexAIPrompt, options: ExecutionOptions): Promise<AsyncIterable<CompletionChunkObject>>;
|
|
47
|
-
requestImageGeneration(_prompt: ImagenPrompt, _options: ExecutionOptions): Promise<Completion>;
|
|
48
|
-
getGenAIModelsArray(client: GoogleGenAI): Promise<Model[]>;
|
|
49
|
-
listModels(_params?: ModelSearchPayload): Promise<AIModel<string>[]>;
|
|
50
|
-
validateConnection(): Promise<boolean>;
|
|
51
|
-
generateEmbeddings(options: EmbeddingsOptions): Promise<EmbeddingsResult>;
|
|
52
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ContentBlock, MessageParam, TextBlockParam } from "@anthropic-ai/sdk/resources/index.js";
|
|
2
|
-
import { AIModel, Completion, CompletionChunkObject, ExecutionOptions, PromptSegment, ToolUse } from "@llumiverse/core";
|
|
3
|
-
import { VertexAIDriver } from "../index.js";
|
|
4
|
-
import { ModelDefinition } from "../models.js";
|
|
5
|
-
export declare const ANTHROPIC_REGIONS: Record<string, string>;
|
|
6
|
-
export declare const NON_GLOBAL_ANTHROPIC_MODELS: string[];
|
|
7
|
-
interface ClaudePrompt {
|
|
8
|
-
messages: MessageParam[];
|
|
9
|
-
system?: TextBlockParam[];
|
|
10
|
-
}
|
|
11
|
-
export declare function collectTools(content: ContentBlock[]): ToolUse[] | undefined;
|
|
12
|
-
export declare class ClaudeModelDefinition implements ModelDefinition<ClaudePrompt> {
|
|
13
|
-
model: AIModel;
|
|
14
|
-
constructor(modelId: string);
|
|
15
|
-
createPrompt(_driver: VertexAIDriver, segments: PromptSegment[], options: ExecutionOptions): Promise<ClaudePrompt>;
|
|
16
|
-
requestTextCompletion(driver: VertexAIDriver, prompt: ClaudePrompt, options: ExecutionOptions): Promise<Completion>;
|
|
17
|
-
requestTextCompletionStream(driver: VertexAIDriver, prompt: ClaudePrompt, options: ExecutionOptions): Promise<AsyncIterable<CompletionChunkObject>>;
|
|
18
|
-
}
|
|
19
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Content, GenerateContentResponseUsageMetadata } from "@google/genai";
|
|
2
|
-
import { AIModel, Completion, CompletionChunkObject, ExecutionOptions, ExecutionTokenUsage, PromptSegment } from "@llumiverse/core";
|
|
3
|
-
import { VertexAIDriver, GenerateContentPrompt } from "../index.js";
|
|
4
|
-
import { ModelDefinition } from "../models.js";
|
|
5
|
-
export declare function mergeConsecutiveRole(contents: Content[] | undefined): Content[];
|
|
6
|
-
export declare class GeminiModelDefinition implements ModelDefinition<GenerateContentPrompt> {
|
|
7
|
-
model: AIModel;
|
|
8
|
-
constructor(modelId: string);
|
|
9
|
-
preValidationProcessing(result: Completion, options: ExecutionOptions): {
|
|
10
|
-
result: Completion;
|
|
11
|
-
options: ExecutionOptions;
|
|
12
|
-
};
|
|
13
|
-
createPrompt(_driver: VertexAIDriver, segments: PromptSegment[], options: ExecutionOptions): Promise<GenerateContentPrompt>;
|
|
14
|
-
usageMetadataToTokenUsage(usageMetadata: GenerateContentResponseUsageMetadata | undefined): ExecutionTokenUsage;
|
|
15
|
-
requestTextCompletion(driver: VertexAIDriver, prompt: GenerateContentPrompt, options: ExecutionOptions): Promise<Completion>;
|
|
16
|
-
requestTextCompletionStream(driver: VertexAIDriver, prompt: GenerateContentPrompt, options: ExecutionOptions): Promise<AsyncIterable<CompletionChunkObject>>;
|
|
17
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { AIModel, Completion, ExecutionOptions, PromptSegment } from "@llumiverse/core";
|
|
2
|
-
import { VertexAIDriver } from "../index.js";
|
|
3
|
-
interface ImagenBaseReference {
|
|
4
|
-
referenceType: "REFERENCE_TYPE_RAW" | "REFERENCE_TYPE_MASK" | "REFERENCE_TYPE_SUBJECT" | "REFERENCE_TYPE_CONTROL" | "REFERENCE_TYPE_STYLE";
|
|
5
|
-
referenceId: number;
|
|
6
|
-
referenceImage: {
|
|
7
|
-
bytesBase64Encoded: string;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
export declare enum ImagenTaskType {
|
|
11
|
-
TEXT_IMAGE = "TEXT_IMAGE",
|
|
12
|
-
EDIT_MODE_INPAINT_REMOVAL = "EDIT_MODE_INPAINT_REMOVAL",
|
|
13
|
-
EDIT_MODE_INPAINT_INSERTION = "EDIT_MODE_INPAINT_INSERTION",
|
|
14
|
-
EDIT_MODE_BGSWAP = "EDIT_MODE_BGSWAP",
|
|
15
|
-
EDIT_MODE_OUTPAINT = "EDIT_MODE_OUTPAINT",
|
|
16
|
-
CUSTOMIZATION_SUBJECT = "CUSTOMIZATION_SUBJECT",
|
|
17
|
-
CUSTOMIZATION_STYLE = "CUSTOMIZATION_STYLE",
|
|
18
|
-
CUSTOMIZATION_CONTROLLED = "CUSTOMIZATION_CONTROLLED",
|
|
19
|
-
CUSTOMIZATION_INSTRUCT = "CUSTOMIZATION_INSTRUCT"
|
|
20
|
-
}
|
|
21
|
-
export declare enum ImagenMaskMode {
|
|
22
|
-
MASK_MODE_USER_PROVIDED = "MASK_MODE_USER_PROVIDED",
|
|
23
|
-
MASK_MODE_BACKGROUND = "MASK_MODE_BACKGROUND",
|
|
24
|
-
MASK_MODE_FOREGROUND = "MASK_MODE_FOREGROUND",
|
|
25
|
-
MASK_MODE_SEMANTIC = "MASK_MODE_SEMANTIC"
|
|
26
|
-
}
|
|
27
|
-
interface ImagenReferenceRaw extends ImagenBaseReference {
|
|
28
|
-
referenceType: "REFERENCE_TYPE_RAW";
|
|
29
|
-
}
|
|
30
|
-
interface ImagenReferenceMask extends Omit<ImagenBaseReference, "referenceImage"> {
|
|
31
|
-
referenceType: "REFERENCE_TYPE_MASK";
|
|
32
|
-
maskImageConfig: {
|
|
33
|
-
maskMode?: ImagenMaskMode;
|
|
34
|
-
maskClasses?: number[];
|
|
35
|
-
dilation?: number;
|
|
36
|
-
};
|
|
37
|
-
referenceImage?: {
|
|
38
|
-
bytesBase64Encoded: string;
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
interface ImagenReferenceSubject extends ImagenBaseReference {
|
|
42
|
-
referenceType: "REFERENCE_TYPE_SUBJECT";
|
|
43
|
-
subjectImageConfig: {
|
|
44
|
-
subjectDescription: string;
|
|
45
|
-
subjectType: "SUBJECT_TYPE_PERSON" | "SUBJECT_TYPE_ANIMAL" | "SUBJECT_TYPE_PRODUCT" | "SUBJECT_TYPE_DEFAULT";
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
interface ImagenReferenceControl extends ImagenBaseReference {
|
|
49
|
-
referenceType: "REFERENCE_TYPE_CONTROL";
|
|
50
|
-
controlImageConfig: {
|
|
51
|
-
controlType: "CONTROL_TYPE_FACE_MESH" | "CONTROL_TYPE_CANNY" | "CONTROL_TYPE_SCRIBBLE";
|
|
52
|
-
enableControlImageComputation?: boolean;
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
interface ImagenReferenceStyle extends ImagenBaseReference {
|
|
56
|
-
referenceType: "REFERENCE_TYPE_STYLE";
|
|
57
|
-
styleImageConfig: {
|
|
58
|
-
styleDescription?: string;
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
type ImagenMessage = ImagenReferenceRaw | ImagenReferenceMask | ImagenReferenceSubject | ImagenReferenceControl | ImagenReferenceStyle;
|
|
62
|
-
export interface ImagenPrompt {
|
|
63
|
-
prompt: string;
|
|
64
|
-
referenceImages?: ImagenMessage[];
|
|
65
|
-
subjectDescription?: string;
|
|
66
|
-
negativePrompt?: string;
|
|
67
|
-
}
|
|
68
|
-
export declare class ImagenModelDefinition {
|
|
69
|
-
model: AIModel;
|
|
70
|
-
constructor(modelId: string);
|
|
71
|
-
createPrompt(_driver: VertexAIDriver, segments: PromptSegment[], options: ExecutionOptions): Promise<ImagenPrompt>;
|
|
72
|
-
requestImageGeneration(driver: VertexAIDriver, prompt: ImagenPrompt, options: ExecutionOptions): Promise<Completion>;
|
|
73
|
-
}
|
|
74
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { AIModel, Completion, CompletionChunkObject, ExecutionOptions, PromptOptions, PromptSegment } from "@llumiverse/core";
|
|
2
|
-
import { VertexAIDriver } from "../index.js";
|
|
3
|
-
import { ModelDefinition } from "../models.js";
|
|
4
|
-
interface LLamaMessage {
|
|
5
|
-
role: string;
|
|
6
|
-
content: string;
|
|
7
|
-
}
|
|
8
|
-
interface LLamaPrompt {
|
|
9
|
-
messages: LLamaMessage[];
|
|
10
|
-
}
|
|
11
|
-
export declare class LLamaModelDefinition implements ModelDefinition<LLamaPrompt> {
|
|
12
|
-
model: AIModel;
|
|
13
|
-
constructor(modelId: string);
|
|
14
|
-
getLlamaModelRegion(modelName: string): string;
|
|
15
|
-
createPrompt(_driver: VertexAIDriver, segments: PromptSegment[], options: PromptOptions): Promise<LLamaPrompt>;
|
|
16
|
-
requestTextCompletion(driver: VertexAIDriver, prompt: LLamaPrompt, options: ExecutionOptions): Promise<Completion>;
|
|
17
|
-
requestTextCompletionStream(driver: VertexAIDriver, prompt: LLamaPrompt, options: ExecutionOptions): Promise<AsyncIterable<CompletionChunkObject>>;
|
|
18
|
-
}
|
|
19
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { AIModel, Completion, PromptSegment, ExecutionOptions, CompletionChunkObject } from "@llumiverse/core";
|
|
2
|
-
import { VertexAIDriver } from "./index.js";
|
|
3
|
-
export interface ModelDefinition<PromptT = any> {
|
|
4
|
-
model: AIModel;
|
|
5
|
-
versions?: string[];
|
|
6
|
-
createPrompt: (driver: VertexAIDriver, segments: PromptSegment[], options: ExecutionOptions) => Promise<PromptT>;
|
|
7
|
-
requestTextCompletion: (driver: VertexAIDriver, prompt: PromptT, options: ExecutionOptions) => Promise<Completion>;
|
|
8
|
-
requestTextCompletionStream: (driver: VertexAIDriver, prompt: PromptT, options: ExecutionOptions) => Promise<AsyncIterable<CompletionChunkObject>>;
|
|
9
|
-
preValidationProcessing?(result: Completion, options: ExecutionOptions): {
|
|
10
|
-
result: Completion;
|
|
11
|
-
options: ExecutionOptions;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
export declare function getModelDefinition(model: string): ModelDefinition;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { AIModel, AbstractDriver, Completion, CompletionChunkObject, DriverOptions, EmbeddingsOptions, EmbeddingsResult, ExecutionOptions } from "@llumiverse/core";
|
|
2
|
-
import { FetchClient } from "@vertesia/api-fetch-client";
|
|
3
|
-
import { WatsonAuthToken } from "./interfaces.js";
|
|
4
|
-
interface WatsonxDriverOptions extends DriverOptions {
|
|
5
|
-
apiKey: string;
|
|
6
|
-
projectId: string;
|
|
7
|
-
endpointUrl: string;
|
|
8
|
-
}
|
|
9
|
-
export declare class WatsonxDriver extends AbstractDriver<WatsonxDriverOptions, string> {
|
|
10
|
-
static PROVIDER: string;
|
|
11
|
-
provider: string;
|
|
12
|
-
apiKey: string;
|
|
13
|
-
endpoint_url: string;
|
|
14
|
-
projectId: string;
|
|
15
|
-
authToken?: WatsonAuthToken;
|
|
16
|
-
fetcher?: FetchClient;
|
|
17
|
-
fetchClient: FetchClient;
|
|
18
|
-
constructor(options: WatsonxDriverOptions);
|
|
19
|
-
requestTextCompletion(prompt: string, options: ExecutionOptions): Promise<Completion>;
|
|
20
|
-
requestTextCompletionStream(prompt: string, options: ExecutionOptions): Promise<AsyncIterable<CompletionChunkObject>>;
|
|
21
|
-
listModels(): Promise<AIModel<string>[]>;
|
|
22
|
-
getAuthToken(): Promise<string>;
|
|
23
|
-
validateConnection(): Promise<boolean>;
|
|
24
|
-
generateEmbeddings(options: EmbeddingsOptions): Promise<EmbeddingsResult>;
|
|
25
|
-
}
|
|
26
|
-
export {};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
export interface WatsonxTextGenerationPayload {
|
|
2
|
-
model_id: string;
|
|
3
|
-
input: string;
|
|
4
|
-
parameters: {
|
|
5
|
-
max_new_tokens?: number;
|
|
6
|
-
time_limit?: number;
|
|
7
|
-
stop_sequences?: string[];
|
|
8
|
-
temperature?: number;
|
|
9
|
-
top_k?: number;
|
|
10
|
-
top_p?: number;
|
|
11
|
-
};
|
|
12
|
-
project_id: string;
|
|
13
|
-
}
|
|
14
|
-
export interface WatsonxTextGenerationResponse {
|
|
15
|
-
model_id: string;
|
|
16
|
-
created_at: string;
|
|
17
|
-
results: {
|
|
18
|
-
generated_text: string;
|
|
19
|
-
generated_token_count: number;
|
|
20
|
-
input_token_count: number;
|
|
21
|
-
stop_reason: string;
|
|
22
|
-
}[];
|
|
23
|
-
}
|
|
24
|
-
export interface GenerateEmbeddingPayload {
|
|
25
|
-
model_id: string;
|
|
26
|
-
inputs: string[];
|
|
27
|
-
project_id: string;
|
|
28
|
-
}
|
|
29
|
-
export interface GenerateEmbeddingResponse {
|
|
30
|
-
model_id: string;
|
|
31
|
-
created_at: string;
|
|
32
|
-
results: {
|
|
33
|
-
embedding: number[];
|
|
34
|
-
}[];
|
|
35
|
-
input_token_count: number;
|
|
36
|
-
}
|
|
37
|
-
export interface WatsonxModelSpec {
|
|
38
|
-
model_id: string;
|
|
39
|
-
label: string;
|
|
40
|
-
provider: string;
|
|
41
|
-
source: string;
|
|
42
|
-
short_description: string;
|
|
43
|
-
tasks: {
|
|
44
|
-
id: string;
|
|
45
|
-
ratings: {
|
|
46
|
-
quality: number;
|
|
47
|
-
};
|
|
48
|
-
}[];
|
|
49
|
-
min_shot_size: number;
|
|
50
|
-
tier: string;
|
|
51
|
-
number_params: string;
|
|
52
|
-
}
|
|
53
|
-
export interface WatsonxListModelResponse {
|
|
54
|
-
total_count: number;
|
|
55
|
-
limit: number;
|
|
56
|
-
resources: WatsonxModelSpec[];
|
|
57
|
-
}
|
|
58
|
-
export interface WatsonAuthToken {
|
|
59
|
-
access_token: string;
|
|
60
|
-
refresh_token: string;
|
|
61
|
-
token_type: string;
|
|
62
|
-
expire_in: number;
|
|
63
|
-
expiration: number;
|
|
64
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { AIModel, Completion, DriverOptions, ExecutionOptions, PromptOptions, PromptSegment } from "@llumiverse/core";
|
|
2
|
-
import { FetchClient } from "@vertesia/api-fetch-client";
|
|
3
|
-
import OpenAI from "openai";
|
|
4
|
-
import { BaseOpenAIDriver } from "../openai/index.js";
|
|
5
|
-
export interface xAiDriverOptions extends DriverOptions {
|
|
6
|
-
apiKey: string;
|
|
7
|
-
endpoint?: string;
|
|
8
|
-
}
|
|
9
|
-
export declare class xAIDriver extends BaseOpenAIDriver {
|
|
10
|
-
service: OpenAI;
|
|
11
|
-
provider: "xai";
|
|
12
|
-
xai_service: FetchClient;
|
|
13
|
-
DEFAULT_ENDPOINT: string;
|
|
14
|
-
constructor(opts: xAiDriverOptions);
|
|
15
|
-
_formatPrompt(segments: PromptSegment[], opts: PromptOptions): Promise<OpenAI.Chat.Completions.ChatCompletionMessageParam[]>;
|
|
16
|
-
extractDataFromResponse(_options: ExecutionOptions, result: OpenAI.Chat.Completions.ChatCompletion): Completion;
|
|
17
|
-
listModels(): Promise<AIModel[]>;
|
|
18
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { CompletionStream, ExecutionOptions, ExecutionResponse, PromptSegment } from "@llumiverse/core";
|
|
2
|
-
export declare class TestErrorCompletionStream implements CompletionStream<PromptSegment[]> {
|
|
3
|
-
segments: PromptSegment[];
|
|
4
|
-
options: ExecutionOptions;
|
|
5
|
-
completion: ExecutionResponse<PromptSegment[]> | undefined;
|
|
6
|
-
constructor(segments: PromptSegment[], options: ExecutionOptions);
|
|
7
|
-
[Symbol.asyncIterator](): AsyncGenerator<string, void, unknown>;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=TestErrorCompletionStream.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TestErrorCompletionStream.d.ts","sourceRoot":"","sources":["../../../src/test-driver/TestErrorCompletionStream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGxG,qBAAa,yBAA0B,YAAW,gBAAgB,CAAC,aAAa,EAAE,CAAC;IAI5D,QAAQ,EAAE,aAAa,EAAE;IACjC,OAAO,EAAE,gBAAgB;IAHpC,UAAU,EAAE,iBAAiB,CAAC,aAAa,EAAE,CAAC,GAAG,SAAS,CAAC;gBAExC,QAAQ,EAAE,aAAa,EAAE,EACjC,OAAO,EAAE,gBAAgB;IAE7B,CAAC,MAAM,CAAC,aAAa,CAAC;CAKhC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { CompletionStream, ExecutionOptions, ExecutionResponse, PromptSegment } from "@llumiverse/core";
|
|
2
|
-
export declare class TestValidationErrorCompletionStream implements CompletionStream<PromptSegment[]> {
|
|
3
|
-
segments: PromptSegment[];
|
|
4
|
-
options: ExecutionOptions;
|
|
5
|
-
completion: ExecutionResponse<PromptSegment[]> | undefined;
|
|
6
|
-
constructor(segments: PromptSegment[], options: ExecutionOptions);
|
|
7
|
-
[Symbol.asyncIterator](): AsyncGenerator<"Started TestValidationError.\n" | "chunk1\n" | "chunk2\n", void, unknown>;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=TestValidationErrorCompletionStream.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TestValidationErrorCompletionStream.d.ts","sourceRoot":"","sources":["../../../src/test-driver/TestValidationErrorCompletionStream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAIxG,qBAAa,mCAAoC,YAAW,gBAAgB,CAAC,aAAa,EAAE,CAAC;IAItE,QAAQ,EAAE,aAAa,EAAE;IACjC,OAAO,EAAE,gBAAgB;IAHpC,UAAU,EAAE,iBAAiB,CAAC,aAAa,EAAE,CAAC,GAAG,SAAS,CAAC;gBAExC,QAAQ,EAAE,aAAa,EAAE,EACjC,OAAO,EAAE,gBAAgB;IAE7B,CAAC,MAAM,CAAC,aAAa,CAAC;CAShC"}
|