@llumiverse/drivers 0.21.0 → 0.22.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/lib/cjs/azure/azure_foundry.js +9 -0
- package/lib/cjs/azure/azure_foundry.js.map +1 -1
- package/lib/cjs/bedrock/index.js +35 -22
- package/lib/cjs/bedrock/index.js.map +1 -1
- package/lib/cjs/vertexai/index.js +26 -18
- package/lib/cjs/vertexai/index.js.map +1 -1
- package/lib/cjs/vertexai/models/gemini.js +39 -12
- package/lib/cjs/vertexai/models/gemini.js.map +1 -1
- package/lib/esm/azure/azure_foundry.js +9 -0
- package/lib/esm/azure/azure_foundry.js.map +1 -1
- package/lib/esm/bedrock/index.js +35 -22
- package/lib/esm/bedrock/index.js.map +1 -1
- package/lib/esm/vertexai/index.js +26 -18
- package/lib/esm/vertexai/index.js.map +1 -1
- package/lib/esm/vertexai/models/gemini.js +39 -12
- package/lib/esm/vertexai/models/gemini.js.map +1 -1
- package/lib/types/azure/azure_foundry.d.ts.map +1 -1
- package/lib/types/bedrock/index.d.ts +2 -2
- package/lib/types/bedrock/index.d.ts.map +1 -1
- package/lib/types/vertexai/index.d.ts.map +1 -1
- package/lib/types/vertexai/models/gemini.d.ts +3 -2
- package/lib/types/vertexai/models/gemini.d.ts.map +1 -1
- package/package.json +14 -14
- package/src/azure/azure_foundry.ts +9 -1
- package/src/bedrock/index.ts +36 -23
- package/src/vertexai/index.ts +29 -22
- package/src/vertexai/models/gemini.ts +50 -12
- package/lib/cjs/openai/azure.js +0 -31
- package/lib/cjs/openai/azure.js.map +0 -1
- package/lib/esm/openai/azure.js +0 -27
- package/lib/esm/openai/azure.js.map +0 -1
- package/lib/esm/src/adobe/firefly.js +0 -115
- package/lib/esm/src/adobe/firefly.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 -797
- 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/groq/index.js +0 -130
- package/lib/esm/src/groq/index.js.map +0 -1
- package/lib/esm/src/huggingface_ie.js +0 -196
- package/lib/esm/src/huggingface_ie.js.map +0 -1
- package/lib/esm/src/index.js +0 -13
- package/lib/esm/src/index.js.map +0 -1
- package/lib/esm/src/mistral/index.js +0 -167
- 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.js +0 -27
- package/lib/esm/src/openai/azure.js.map +0 -1
- package/lib/esm/src/openai/index.js +0 -463
- 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/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/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 -270
- package/lib/esm/src/vertexai/index.js.map +0 -1
- package/lib/esm/src/vertexai/models/claude.js +0 -370
- package/lib/esm/src/vertexai/models/claude.js.map +0 -1
- package/lib/esm/src/vertexai/models/gemini.js +0 -700
- package/lib/esm/src/vertexai/models/gemini.js.map +0 -1
- package/lib/esm/src/vertexai/models/imagen.js +0 -310
- package/lib/esm/src/vertexai/models/imagen.js.map +0 -1
- package/lib/esm/src/vertexai/models/llama.js +0 -178
- package/lib/esm/src/vertexai/models/llama.js.map +0 -1
- package/lib/esm/src/vertexai/models.js +0 -21
- 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/tsconfig.tsbuildinfo +0 -1
- package/lib/types/openai/azure.d.ts +0 -20
- package/lib/types/openai/azure.d.ts.map +0 -1
- package/lib/types/src/adobe/firefly.d.ts +0 -29
- package/lib/types/src/bedrock/converse.d.ts +0 -8
- package/lib/types/src/bedrock/index.d.ts +0 -57
- 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/groq/index.d.ts +0 -23
- package/lib/types/src/huggingface_ie.d.ts +0 -31
- package/lib/types/src/index.d.ts +0 -12
- 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.d.ts +0 -19
- package/lib/types/src/openai/index.d.ts +0 -25
- package/lib/types/src/openai/openai.d.ts +0 -14
- package/lib/types/src/replicate.d.ts +0 -44
- 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/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 -49
- package/lib/types/src/vertexai/models/claude.d.ts +0 -17
- package/lib/types/src/vertexai/models/gemini.d.ts +0 -16
- 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
|
@@ -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,49 +0,0 @@
|
|
|
1
|
-
import { AIModel, AbstractDriver, Completion, CompletionChunk, DriverOptions, EmbeddingsResult, ExecutionOptions, ImageGeneration, ModelSearchPayload, PromptSegment } from "@llumiverse/core";
|
|
2
|
-
import { FetchClient } from "@vertesia/api-fetch-client";
|
|
3
|
-
import { GoogleAuth, GoogleAuthOptions } from "google-auth-library";
|
|
4
|
-
import { JSONClient } from "google-auth-library/build/src/auth/googleauth.js";
|
|
5
|
-
import { EmbeddingsOptions } from "@llumiverse/core";
|
|
6
|
-
import { v1beta1 } from "@google-cloud/aiplatform";
|
|
7
|
-
import { AnthropicVertex } from "@anthropic-ai/vertex-sdk";
|
|
8
|
-
import { ImagenPrompt } from "./models/imagen.js";
|
|
9
|
-
import { GoogleGenAI, Content } from "@google/genai";
|
|
10
|
-
export interface VertexAIDriverOptions extends DriverOptions {
|
|
11
|
-
project: string;
|
|
12
|
-
region: string;
|
|
13
|
-
googleAuthOptions?: GoogleAuthOptions;
|
|
14
|
-
}
|
|
15
|
-
export interface GenerateContentPrompt {
|
|
16
|
-
contents: Content[];
|
|
17
|
-
system?: Content;
|
|
18
|
-
}
|
|
19
|
-
export type VertexAIPrompt = ImagenPrompt | GenerateContentPrompt;
|
|
20
|
-
export declare function trimModelName(model: string): string;
|
|
21
|
-
export declare class VertexAIDriver extends AbstractDriver<VertexAIDriverOptions, VertexAIPrompt> {
|
|
22
|
-
static PROVIDER: string;
|
|
23
|
-
provider: string;
|
|
24
|
-
aiplatform: v1beta1.ModelServiceClient | undefined;
|
|
25
|
-
anthropicClient: AnthropicVertex | undefined;
|
|
26
|
-
fetchClient: FetchClient | undefined;
|
|
27
|
-
googleGenAI: GoogleGenAI | undefined;
|
|
28
|
-
llamaClient: FetchClient & {
|
|
29
|
-
region?: string;
|
|
30
|
-
} | undefined;
|
|
31
|
-
modelGarden: v1beta1.ModelGardenServiceClient | undefined;
|
|
32
|
-
authClient: JSONClient | GoogleAuth<JSONClient>;
|
|
33
|
-
constructor(options: VertexAIDriverOptions);
|
|
34
|
-
getGoogleGenAIClient(): GoogleGenAI;
|
|
35
|
-
getFetchClient(): FetchClient;
|
|
36
|
-
getLLamaClient(region?: string): FetchClient;
|
|
37
|
-
getAnthropicClient(): AnthropicVertex;
|
|
38
|
-
getAIPlatformClient(): v1beta1.ModelServiceClient;
|
|
39
|
-
getModelGardenClient(): v1beta1.ModelGardenServiceClient;
|
|
40
|
-
validateResult(result: Completion, options: ExecutionOptions): void;
|
|
41
|
-
protected canStream(options: ExecutionOptions): Promise<boolean>;
|
|
42
|
-
createPrompt(segments: PromptSegment[], options: ExecutionOptions): Promise<VertexAIPrompt>;
|
|
43
|
-
requestTextCompletion(prompt: VertexAIPrompt, options: ExecutionOptions): Promise<Completion<any>>;
|
|
44
|
-
requestTextCompletionStream(prompt: VertexAIPrompt, options: ExecutionOptions): Promise<AsyncIterable<CompletionChunk>>;
|
|
45
|
-
requestImageGeneration(_prompt: ImagenPrompt, _options: ExecutionOptions): Promise<Completion<ImageGeneration>>;
|
|
46
|
-
listModels(_params?: ModelSearchPayload): Promise<AIModel<string>[]>;
|
|
47
|
-
validateConnection(): Promise<boolean>;
|
|
48
|
-
generateEmbeddings(options: EmbeddingsOptions): Promise<EmbeddingsResult>;
|
|
49
|
-
}
|
|
@@ -1,17 +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
|
-
interface ClaudePrompt {
|
|
6
|
-
messages: MessageParam[];
|
|
7
|
-
system?: TextBlockParam[];
|
|
8
|
-
}
|
|
9
|
-
export declare function collectTools(content: ContentBlock[]): ToolUse[] | undefined;
|
|
10
|
-
export declare class ClaudeModelDefinition implements ModelDefinition<ClaudePrompt> {
|
|
11
|
-
model: AIModel;
|
|
12
|
-
constructor(modelId: string);
|
|
13
|
-
createPrompt(_driver: VertexAIDriver, segments: PromptSegment[], options: ExecutionOptions): Promise<ClaudePrompt>;
|
|
14
|
-
requestTextCompletion(driver: VertexAIDriver, prompt: ClaudePrompt, options: ExecutionOptions): Promise<Completion>;
|
|
15
|
-
requestTextCompletionStream(driver: VertexAIDriver, prompt: ClaudePrompt, options: ExecutionOptions): Promise<AsyncIterable<CompletionChunkObject>>;
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Content } from "@google/genai";
|
|
2
|
-
import { AIModel, Completion, CompletionChunkObject, ExecutionOptions, 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
|
-
requestTextCompletion(driver: VertexAIDriver, prompt: GenerateContentPrompt, options: ExecutionOptions): Promise<Completion>;
|
|
15
|
-
requestTextCompletionStream(driver: VertexAIDriver, prompt: GenerateContentPrompt, options: ExecutionOptions): Promise<AsyncIterable<CompletionChunkObject>>;
|
|
16
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { AIModel, Completion, ExecutionOptions, ImageGeneration, 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<ImageGeneration>>;
|
|
73
|
-
}
|
|
74
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { AIModel, Completion, CompletionChunk, 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<CompletionChunk>>;
|
|
18
|
-
}
|
|
19
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { AIModel, Completion, PromptSegment, ExecutionOptions, CompletionChunk } 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<CompletionChunk>>;
|
|
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, CompletionChunk, 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<any>>;
|
|
20
|
-
requestTextCompletionStream(prompt: string, options: ExecutionOptions): Promise<AsyncIterable<CompletionChunk>>;
|
|
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
|
-
}
|