@reverbia/sdk 1.0.0-next.20251113144625 → 1.0.0-next.20251113193348
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/dist/index.cjs +14 -2
- package/dist/index.d.mts +120 -1
- package/dist/index.d.ts +120 -1
- package/dist/index.mjs +12 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -21,7 +21,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
23
|
getHealth: () => getHealth,
|
|
24
|
-
postApiV1ChatCompletions: () => postApiV1ChatCompletions
|
|
24
|
+
postApiV1ChatCompletions: () => postApiV1ChatCompletions,
|
|
25
|
+
postApiV1Embeddings: () => postApiV1Embeddings
|
|
25
26
|
});
|
|
26
27
|
module.exports = __toCommonJS(index_exports);
|
|
27
28
|
|
|
@@ -844,6 +845,16 @@ var postApiV1ChatCompletions = (options) => {
|
|
|
844
845
|
}
|
|
845
846
|
});
|
|
846
847
|
};
|
|
848
|
+
var postApiV1Embeddings = (options) => {
|
|
849
|
+
return (options.client ?? client).post({
|
|
850
|
+
url: "/api/v1/embeddings",
|
|
851
|
+
...options,
|
|
852
|
+
headers: {
|
|
853
|
+
"Content-Type": "application/json",
|
|
854
|
+
...options.headers
|
|
855
|
+
}
|
|
856
|
+
});
|
|
857
|
+
};
|
|
847
858
|
var getHealth = (options) => {
|
|
848
859
|
return (options?.client ?? client).get({
|
|
849
860
|
url: "/health",
|
|
@@ -853,5 +864,6 @@ var getHealth = (options) => {
|
|
|
853
864
|
// Annotate the CommonJS export names for ESM import in node:
|
|
854
865
|
0 && (module.exports = {
|
|
855
866
|
getHealth,
|
|
856
|
-
postApiV1ChatCompletions
|
|
867
|
+
postApiV1ChatCompletions,
|
|
868
|
+
postApiV1Embeddings
|
|
857
869
|
});
|
package/dist/index.d.mts
CHANGED
|
@@ -54,6 +54,92 @@ type LlmapiChoice = {
|
|
|
54
54
|
index?: number;
|
|
55
55
|
message?: LlmapiMessage;
|
|
56
56
|
};
|
|
57
|
+
type LlmapiEmbeddingData = {
|
|
58
|
+
/**
|
|
59
|
+
* Embedding vector
|
|
60
|
+
*/
|
|
61
|
+
embedding?: Array<number>;
|
|
62
|
+
/**
|
|
63
|
+
* Index of the embedding
|
|
64
|
+
*/
|
|
65
|
+
index?: number;
|
|
66
|
+
/**
|
|
67
|
+
* Object type identifier
|
|
68
|
+
*/
|
|
69
|
+
object?: string;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* ExtraFields contains additional metadata
|
|
73
|
+
*/
|
|
74
|
+
type LlmapiEmbeddingExtraFields = {
|
|
75
|
+
/**
|
|
76
|
+
* ChunkIndex is the chunk index (0 for single requests)
|
|
77
|
+
*/
|
|
78
|
+
chunk_index?: number;
|
|
79
|
+
/**
|
|
80
|
+
* Latency is the request latency in milliseconds
|
|
81
|
+
*/
|
|
82
|
+
latency?: number;
|
|
83
|
+
/**
|
|
84
|
+
* ModelRequested is the model that was requested
|
|
85
|
+
*/
|
|
86
|
+
model_requested?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Provider is the LLM provider used (e.g., "openai", "anthropic")
|
|
89
|
+
*/
|
|
90
|
+
provider?: string;
|
|
91
|
+
/**
|
|
92
|
+
* RequestType is always "embedding"
|
|
93
|
+
*/
|
|
94
|
+
request_type?: string;
|
|
95
|
+
};
|
|
96
|
+
type LlmapiEmbeddingRequest = {
|
|
97
|
+
/**
|
|
98
|
+
* Dimensions is the number of dimensions the resulting output embeddings should have (optional)
|
|
99
|
+
*/
|
|
100
|
+
dimensions?: number;
|
|
101
|
+
/**
|
|
102
|
+
* EncodingFormat is the format to return the embeddings in (optional: "float" or "base64")
|
|
103
|
+
*/
|
|
104
|
+
encoding_format?: string;
|
|
105
|
+
/**
|
|
106
|
+
* Input text or tokens to embed (can be string, []string, []int, or [][]int)
|
|
107
|
+
*/
|
|
108
|
+
input?: unknown;
|
|
109
|
+
/**
|
|
110
|
+
* Model identifier in 'provider/model' format
|
|
111
|
+
*/
|
|
112
|
+
model?: string;
|
|
113
|
+
};
|
|
114
|
+
type LlmapiEmbeddingResponse = {
|
|
115
|
+
/**
|
|
116
|
+
* Data contains the embeddings
|
|
117
|
+
*/
|
|
118
|
+
data?: Array<LlmapiEmbeddingData>;
|
|
119
|
+
extra_fields?: LlmapiEmbeddingExtraFields;
|
|
120
|
+
/**
|
|
121
|
+
* Model is the model used
|
|
122
|
+
*/
|
|
123
|
+
model?: string;
|
|
124
|
+
/**
|
|
125
|
+
* Object is always "list"
|
|
126
|
+
*/
|
|
127
|
+
object?: string;
|
|
128
|
+
usage?: LlmapiEmbeddingUsage;
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* Usage contains token usage information
|
|
132
|
+
*/
|
|
133
|
+
type LlmapiEmbeddingUsage = {
|
|
134
|
+
/**
|
|
135
|
+
* PromptTokens is the number of tokens in the prompt
|
|
136
|
+
*/
|
|
137
|
+
prompt_tokens?: number;
|
|
138
|
+
/**
|
|
139
|
+
* TotalTokens is the total number of tokens used
|
|
140
|
+
*/
|
|
141
|
+
total_tokens?: number;
|
|
142
|
+
};
|
|
57
143
|
/**
|
|
58
144
|
* Message is the generated message
|
|
59
145
|
*/
|
|
@@ -98,6 +184,33 @@ type PostApiV1ChatCompletionsResponses = {
|
|
|
98
184
|
200: LlmapiChatCompletionResponse;
|
|
99
185
|
};
|
|
100
186
|
type PostApiV1ChatCompletionsResponse = PostApiV1ChatCompletionsResponses[keyof PostApiV1ChatCompletionsResponses];
|
|
187
|
+
type PostApiV1EmbeddingsData = {
|
|
188
|
+
/**
|
|
189
|
+
* Embedding request
|
|
190
|
+
*/
|
|
191
|
+
body: LlmapiEmbeddingRequest;
|
|
192
|
+
path?: never;
|
|
193
|
+
query?: never;
|
|
194
|
+
url: '/api/v1/embeddings';
|
|
195
|
+
};
|
|
196
|
+
type PostApiV1EmbeddingsErrors = {
|
|
197
|
+
/**
|
|
198
|
+
* Bad Request
|
|
199
|
+
*/
|
|
200
|
+
400: ResponseErrorResponse;
|
|
201
|
+
/**
|
|
202
|
+
* Internal Server Error
|
|
203
|
+
*/
|
|
204
|
+
500: ResponseErrorResponse;
|
|
205
|
+
};
|
|
206
|
+
type PostApiV1EmbeddingsError = PostApiV1EmbeddingsErrors[keyof PostApiV1EmbeddingsErrors];
|
|
207
|
+
type PostApiV1EmbeddingsResponses = {
|
|
208
|
+
/**
|
|
209
|
+
* OK
|
|
210
|
+
*/
|
|
211
|
+
200: LlmapiEmbeddingResponse;
|
|
212
|
+
};
|
|
213
|
+
type PostApiV1EmbeddingsResponse = PostApiV1EmbeddingsResponses[keyof PostApiV1EmbeddingsResponses];
|
|
101
214
|
type GetHealthData = {
|
|
102
215
|
body?: never;
|
|
103
216
|
path?: never;
|
|
@@ -427,6 +540,12 @@ type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean
|
|
|
427
540
|
* Generates a chat completion using the configured gateway.
|
|
428
541
|
*/
|
|
429
542
|
declare const postApiV1ChatCompletions: <ThrowOnError extends boolean = false>(options: Options<PostApiV1ChatCompletionsData, ThrowOnError>) => RequestResult<PostApiV1ChatCompletionsResponses, PostApiV1ChatCompletionsErrors, ThrowOnError>;
|
|
543
|
+
/**
|
|
544
|
+
* Create embeddings
|
|
545
|
+
*
|
|
546
|
+
* Generates embeddings using the configured gateway.
|
|
547
|
+
*/
|
|
548
|
+
declare const postApiV1Embeddings: <ThrowOnError extends boolean = false>(options: Options<PostApiV1EmbeddingsData, ThrowOnError>) => RequestResult<PostApiV1EmbeddingsResponses, PostApiV1EmbeddingsErrors, ThrowOnError>;
|
|
430
549
|
/**
|
|
431
550
|
* Health check
|
|
432
551
|
*
|
|
@@ -434,4 +553,4 @@ declare const postApiV1ChatCompletions: <ThrowOnError extends boolean = false>(o
|
|
|
434
553
|
*/
|
|
435
554
|
declare const getHealth: <ThrowOnError extends boolean = false>(options?: Options<GetHealthData, ThrowOnError>) => RequestResult<GetHealthResponses, GetHealthErrors, ThrowOnError>;
|
|
436
555
|
|
|
437
|
-
export { type ClientOptions$1 as ClientOptions, type GetHealthData, type GetHealthError, type GetHealthErrors, type GetHealthResponse, type GetHealthResponses, type HandlersHealthResponse, type LlmapiChatCompletionRequest, type LlmapiChatCompletionResponse, type LlmapiChoice, type LlmapiMessage, type LlmapiRole, type Options, type PostApiV1ChatCompletionsData, type PostApiV1ChatCompletionsError, type PostApiV1ChatCompletionsErrors, type PostApiV1ChatCompletionsResponse, type PostApiV1ChatCompletionsResponses, type ResponseErrorResponse, getHealth, postApiV1ChatCompletions };
|
|
556
|
+
export { type ClientOptions$1 as ClientOptions, type GetHealthData, type GetHealthError, type GetHealthErrors, type GetHealthResponse, type GetHealthResponses, type HandlersHealthResponse, type LlmapiChatCompletionRequest, type LlmapiChatCompletionResponse, type LlmapiChoice, type LlmapiEmbeddingData, type LlmapiEmbeddingExtraFields, type LlmapiEmbeddingRequest, type LlmapiEmbeddingResponse, type LlmapiEmbeddingUsage, type LlmapiMessage, type LlmapiRole, type Options, type PostApiV1ChatCompletionsData, type PostApiV1ChatCompletionsError, type PostApiV1ChatCompletionsErrors, type PostApiV1ChatCompletionsResponse, type PostApiV1ChatCompletionsResponses, type PostApiV1EmbeddingsData, type PostApiV1EmbeddingsError, type PostApiV1EmbeddingsErrors, type PostApiV1EmbeddingsResponse, type PostApiV1EmbeddingsResponses, type ResponseErrorResponse, getHealth, postApiV1ChatCompletions, postApiV1Embeddings };
|
package/dist/index.d.ts
CHANGED
|
@@ -54,6 +54,92 @@ type LlmapiChoice = {
|
|
|
54
54
|
index?: number;
|
|
55
55
|
message?: LlmapiMessage;
|
|
56
56
|
};
|
|
57
|
+
type LlmapiEmbeddingData = {
|
|
58
|
+
/**
|
|
59
|
+
* Embedding vector
|
|
60
|
+
*/
|
|
61
|
+
embedding?: Array<number>;
|
|
62
|
+
/**
|
|
63
|
+
* Index of the embedding
|
|
64
|
+
*/
|
|
65
|
+
index?: number;
|
|
66
|
+
/**
|
|
67
|
+
* Object type identifier
|
|
68
|
+
*/
|
|
69
|
+
object?: string;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* ExtraFields contains additional metadata
|
|
73
|
+
*/
|
|
74
|
+
type LlmapiEmbeddingExtraFields = {
|
|
75
|
+
/**
|
|
76
|
+
* ChunkIndex is the chunk index (0 for single requests)
|
|
77
|
+
*/
|
|
78
|
+
chunk_index?: number;
|
|
79
|
+
/**
|
|
80
|
+
* Latency is the request latency in milliseconds
|
|
81
|
+
*/
|
|
82
|
+
latency?: number;
|
|
83
|
+
/**
|
|
84
|
+
* ModelRequested is the model that was requested
|
|
85
|
+
*/
|
|
86
|
+
model_requested?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Provider is the LLM provider used (e.g., "openai", "anthropic")
|
|
89
|
+
*/
|
|
90
|
+
provider?: string;
|
|
91
|
+
/**
|
|
92
|
+
* RequestType is always "embedding"
|
|
93
|
+
*/
|
|
94
|
+
request_type?: string;
|
|
95
|
+
};
|
|
96
|
+
type LlmapiEmbeddingRequest = {
|
|
97
|
+
/**
|
|
98
|
+
* Dimensions is the number of dimensions the resulting output embeddings should have (optional)
|
|
99
|
+
*/
|
|
100
|
+
dimensions?: number;
|
|
101
|
+
/**
|
|
102
|
+
* EncodingFormat is the format to return the embeddings in (optional: "float" or "base64")
|
|
103
|
+
*/
|
|
104
|
+
encoding_format?: string;
|
|
105
|
+
/**
|
|
106
|
+
* Input text or tokens to embed (can be string, []string, []int, or [][]int)
|
|
107
|
+
*/
|
|
108
|
+
input?: unknown;
|
|
109
|
+
/**
|
|
110
|
+
* Model identifier in 'provider/model' format
|
|
111
|
+
*/
|
|
112
|
+
model?: string;
|
|
113
|
+
};
|
|
114
|
+
type LlmapiEmbeddingResponse = {
|
|
115
|
+
/**
|
|
116
|
+
* Data contains the embeddings
|
|
117
|
+
*/
|
|
118
|
+
data?: Array<LlmapiEmbeddingData>;
|
|
119
|
+
extra_fields?: LlmapiEmbeddingExtraFields;
|
|
120
|
+
/**
|
|
121
|
+
* Model is the model used
|
|
122
|
+
*/
|
|
123
|
+
model?: string;
|
|
124
|
+
/**
|
|
125
|
+
* Object is always "list"
|
|
126
|
+
*/
|
|
127
|
+
object?: string;
|
|
128
|
+
usage?: LlmapiEmbeddingUsage;
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* Usage contains token usage information
|
|
132
|
+
*/
|
|
133
|
+
type LlmapiEmbeddingUsage = {
|
|
134
|
+
/**
|
|
135
|
+
* PromptTokens is the number of tokens in the prompt
|
|
136
|
+
*/
|
|
137
|
+
prompt_tokens?: number;
|
|
138
|
+
/**
|
|
139
|
+
* TotalTokens is the total number of tokens used
|
|
140
|
+
*/
|
|
141
|
+
total_tokens?: number;
|
|
142
|
+
};
|
|
57
143
|
/**
|
|
58
144
|
* Message is the generated message
|
|
59
145
|
*/
|
|
@@ -98,6 +184,33 @@ type PostApiV1ChatCompletionsResponses = {
|
|
|
98
184
|
200: LlmapiChatCompletionResponse;
|
|
99
185
|
};
|
|
100
186
|
type PostApiV1ChatCompletionsResponse = PostApiV1ChatCompletionsResponses[keyof PostApiV1ChatCompletionsResponses];
|
|
187
|
+
type PostApiV1EmbeddingsData = {
|
|
188
|
+
/**
|
|
189
|
+
* Embedding request
|
|
190
|
+
*/
|
|
191
|
+
body: LlmapiEmbeddingRequest;
|
|
192
|
+
path?: never;
|
|
193
|
+
query?: never;
|
|
194
|
+
url: '/api/v1/embeddings';
|
|
195
|
+
};
|
|
196
|
+
type PostApiV1EmbeddingsErrors = {
|
|
197
|
+
/**
|
|
198
|
+
* Bad Request
|
|
199
|
+
*/
|
|
200
|
+
400: ResponseErrorResponse;
|
|
201
|
+
/**
|
|
202
|
+
* Internal Server Error
|
|
203
|
+
*/
|
|
204
|
+
500: ResponseErrorResponse;
|
|
205
|
+
};
|
|
206
|
+
type PostApiV1EmbeddingsError = PostApiV1EmbeddingsErrors[keyof PostApiV1EmbeddingsErrors];
|
|
207
|
+
type PostApiV1EmbeddingsResponses = {
|
|
208
|
+
/**
|
|
209
|
+
* OK
|
|
210
|
+
*/
|
|
211
|
+
200: LlmapiEmbeddingResponse;
|
|
212
|
+
};
|
|
213
|
+
type PostApiV1EmbeddingsResponse = PostApiV1EmbeddingsResponses[keyof PostApiV1EmbeddingsResponses];
|
|
101
214
|
type GetHealthData = {
|
|
102
215
|
body?: never;
|
|
103
216
|
path?: never;
|
|
@@ -427,6 +540,12 @@ type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean
|
|
|
427
540
|
* Generates a chat completion using the configured gateway.
|
|
428
541
|
*/
|
|
429
542
|
declare const postApiV1ChatCompletions: <ThrowOnError extends boolean = false>(options: Options<PostApiV1ChatCompletionsData, ThrowOnError>) => RequestResult<PostApiV1ChatCompletionsResponses, PostApiV1ChatCompletionsErrors, ThrowOnError>;
|
|
543
|
+
/**
|
|
544
|
+
* Create embeddings
|
|
545
|
+
*
|
|
546
|
+
* Generates embeddings using the configured gateway.
|
|
547
|
+
*/
|
|
548
|
+
declare const postApiV1Embeddings: <ThrowOnError extends boolean = false>(options: Options<PostApiV1EmbeddingsData, ThrowOnError>) => RequestResult<PostApiV1EmbeddingsResponses, PostApiV1EmbeddingsErrors, ThrowOnError>;
|
|
430
549
|
/**
|
|
431
550
|
* Health check
|
|
432
551
|
*
|
|
@@ -434,4 +553,4 @@ declare const postApiV1ChatCompletions: <ThrowOnError extends boolean = false>(o
|
|
|
434
553
|
*/
|
|
435
554
|
declare const getHealth: <ThrowOnError extends boolean = false>(options?: Options<GetHealthData, ThrowOnError>) => RequestResult<GetHealthResponses, GetHealthErrors, ThrowOnError>;
|
|
436
555
|
|
|
437
|
-
export { type ClientOptions$1 as ClientOptions, type GetHealthData, type GetHealthError, type GetHealthErrors, type GetHealthResponse, type GetHealthResponses, type HandlersHealthResponse, type LlmapiChatCompletionRequest, type LlmapiChatCompletionResponse, type LlmapiChoice, type LlmapiMessage, type LlmapiRole, type Options, type PostApiV1ChatCompletionsData, type PostApiV1ChatCompletionsError, type PostApiV1ChatCompletionsErrors, type PostApiV1ChatCompletionsResponse, type PostApiV1ChatCompletionsResponses, type ResponseErrorResponse, getHealth, postApiV1ChatCompletions };
|
|
556
|
+
export { type ClientOptions$1 as ClientOptions, type GetHealthData, type GetHealthError, type GetHealthErrors, type GetHealthResponse, type GetHealthResponses, type HandlersHealthResponse, type LlmapiChatCompletionRequest, type LlmapiChatCompletionResponse, type LlmapiChoice, type LlmapiEmbeddingData, type LlmapiEmbeddingExtraFields, type LlmapiEmbeddingRequest, type LlmapiEmbeddingResponse, type LlmapiEmbeddingUsage, type LlmapiMessage, type LlmapiRole, type Options, type PostApiV1ChatCompletionsData, type PostApiV1ChatCompletionsError, type PostApiV1ChatCompletionsErrors, type PostApiV1ChatCompletionsResponse, type PostApiV1ChatCompletionsResponses, type PostApiV1EmbeddingsData, type PostApiV1EmbeddingsError, type PostApiV1EmbeddingsErrors, type PostApiV1EmbeddingsResponse, type PostApiV1EmbeddingsResponses, type ResponseErrorResponse, getHealth, postApiV1ChatCompletions, postApiV1Embeddings };
|
package/dist/index.mjs
CHANGED
|
@@ -817,6 +817,16 @@ var postApiV1ChatCompletions = (options) => {
|
|
|
817
817
|
}
|
|
818
818
|
});
|
|
819
819
|
};
|
|
820
|
+
var postApiV1Embeddings = (options) => {
|
|
821
|
+
return (options.client ?? client).post({
|
|
822
|
+
url: "/api/v1/embeddings",
|
|
823
|
+
...options,
|
|
824
|
+
headers: {
|
|
825
|
+
"Content-Type": "application/json",
|
|
826
|
+
...options.headers
|
|
827
|
+
}
|
|
828
|
+
});
|
|
829
|
+
};
|
|
820
830
|
var getHealth = (options) => {
|
|
821
831
|
return (options?.client ?? client).get({
|
|
822
832
|
url: "/health",
|
|
@@ -825,5 +835,6 @@ var getHealth = (options) => {
|
|
|
825
835
|
};
|
|
826
836
|
export {
|
|
827
837
|
getHealth,
|
|
828
|
-
postApiV1ChatCompletions
|
|
838
|
+
postApiV1ChatCompletions,
|
|
839
|
+
postApiV1Embeddings
|
|
829
840
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reverbia/sdk",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.20251113193348",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"homepage": "https://github.com/zeta-chain/ai-sdk#readme",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@reverbia/portal": "1.0.0-next.
|
|
38
|
+
"@reverbia/portal": "^1.0.0-next.20251113192414"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@hey-api/openapi-ts": "0.87.2",
|