macrocosmos 1.2.2 → 1.2.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/dist/generated/apex/v1/apex.d.ts +440 -718
- package/dist/generated/apex/v1/apex.js +2924 -582
- package/dist/generated/billing/v1/billing.d.ts +71 -94
- package/dist/generated/billing/v1/billing.js +328 -80
- package/dist/generated/google/protobuf/timestamp.d.ts +122 -0
- package/dist/generated/google/protobuf/timestamp.js +92 -0
- package/dist/generated/gravity/v1/gravity.d.ts +368 -563
- package/dist/generated/gravity/v1/gravity.js +2256 -457
- package/dist/generated/sn13/v1/sn13_validator.d.ts +91 -114
- package/dist/generated/sn13/v1/sn13_validator.js +421 -96
- package/dist/lib/BaseClient.js +5 -5
- package/dist/lib/apex/Client.d.ts +8 -13
- package/dist/lib/apex/Client.js +14 -24
- package/dist/lib/billing/Client.d.ts +4 -17
- package/dist/lib/billing/Client.js +7 -21
- package/dist/lib/gravity/Client.d.ts +14 -22
- package/dist/lib/gravity/Client.js +13 -27
- package/dist/lib/sn13/Client.d.ts +4 -20
- package/dist/lib/sn13/Client.js +8 -22
- package/dist/lib/util.types.d.ts +1 -0
- package/dist/lib/util.types.js +3 -0
- package/new_version.txt +1 -1
- package/old_version.txt +1 -1
- package/package.json +7 -3
- package/tsconfig.eslint.json +1 -1
- package/eslint.config.cjs +0 -33
|
@@ -1,747 +1,469 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
import { type CallOptions, ChannelCredentials, Client, type ClientOptions, type ClientReadableStream, type ClientUnaryCall, type handleServerStreamingCall, type handleUnaryCall, Metadata, type ServiceError, type UntypedServiceImplementation } from "@grpc/grpc-js";
|
|
3
|
+
export declare const protobufPackage = "apex.v1";
|
|
4
|
+
/**
|
|
5
|
+
* A request to generate completions following Apex CompletionsRequest format.
|
|
6
|
+
* Parsed from https://github.com/macrocosm-os/prompting/blob/main/validator_api/serializers.py
|
|
7
|
+
*/
|
|
8
|
+
export interface ChatCompletionRequest {
|
|
9
|
+
/** uids: the miner UIDs that will be used to generate the completion (optional). */
|
|
10
|
+
uids: number[];
|
|
11
|
+
/** messages: the messages to generate completions for. */
|
|
12
|
+
messages: ChatMessage[];
|
|
13
|
+
/** seed: the seed to use for the completion. */
|
|
14
|
+
seed?: number | undefined;
|
|
15
|
+
/** task: the task to generate completions for (e.g. "InferenceTask"). */
|
|
16
|
+
task?: string | undefined;
|
|
17
|
+
/** model: the LLM name to use for the completion. (optional, suggest leaving this empty as not all LLMs are supported) */
|
|
18
|
+
model?: string | undefined;
|
|
19
|
+
/** test_time_inference: whether to use test time inference. */
|
|
20
|
+
testTimeInference?: boolean | undefined;
|
|
21
|
+
/** mixture: whether to use a mixture of miners to create a slower but better answer. */
|
|
22
|
+
mixture?: boolean | undefined;
|
|
23
|
+
/** sampling_parameters: the sampling parameters to use for the completion. */
|
|
24
|
+
samplingParameters?: SamplingParameters | undefined;
|
|
25
|
+
/** inference_mode: the inference mode to use for the completion. */
|
|
26
|
+
inferenceMode?: string | undefined;
|
|
27
|
+
/** json_format: whether to use JSON format for the completion. */
|
|
28
|
+
jsonFormat?: boolean | undefined;
|
|
29
|
+
/** stream: whether to stream the completion. */
|
|
30
|
+
stream?: boolean | undefined;
|
|
31
|
+
/** timeout: the timeout for the completion in seconds. */
|
|
32
|
+
timeout?: number | undefined;
|
|
14
33
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
34
|
+
/**
|
|
35
|
+
* The sampling parameters for the completion.
|
|
36
|
+
* Parsed from https://github.com/macrocosm-os/prompting/blob/main/validator_api/serializers.py
|
|
37
|
+
*/
|
|
38
|
+
export interface SamplingParameters {
|
|
39
|
+
/** temperature: the temperature to use for the completion. */
|
|
40
|
+
temperature: number;
|
|
41
|
+
/** top_p: the top_p to use for the completion. */
|
|
42
|
+
topP: number;
|
|
43
|
+
/** top_k: the top_k to use for the completion. */
|
|
44
|
+
topK?: number | undefined;
|
|
45
|
+
/** max_new_tokens: the max_new_tokens to use for the completion. */
|
|
46
|
+
maxNewTokens: number;
|
|
47
|
+
/** do_sample: whether to do sample for the completion. */
|
|
48
|
+
doSample: boolean;
|
|
21
49
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
50
|
+
/**
|
|
51
|
+
* A chat completion response, following OpenAI's ChatCompletion format.
|
|
52
|
+
* Parsed from https://github.com/openai/openai-python/blob/main/src/openai/types/chat/chat_completion.py
|
|
53
|
+
*/
|
|
54
|
+
export interface ChatCompletionResponse {
|
|
55
|
+
/** id: the id of the completion. */
|
|
56
|
+
id: string;
|
|
57
|
+
/** choices: the choices of the completion. */
|
|
58
|
+
choices: Choice[];
|
|
59
|
+
/** created: the created time of the completion. */
|
|
60
|
+
created: number;
|
|
61
|
+
/** model: the model of the completion. */
|
|
62
|
+
model: string;
|
|
63
|
+
/** object: the object of the completion. */
|
|
64
|
+
object: string;
|
|
65
|
+
/** service_tier: the service tier of the completion. (not currently supported in Apex) */
|
|
66
|
+
serviceTier: string;
|
|
67
|
+
/** system_fingerprint: the system fingerprint of the completion. (not currently supported in Apex) */
|
|
68
|
+
systemFingerprint: string;
|
|
69
|
+
/** usage: the usage of the completion. (not currently supported in Apex) */
|
|
70
|
+
usage?: CompletionUsage | undefined;
|
|
31
71
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
72
|
+
/**
|
|
73
|
+
* The choice object containing the message response from the LLM for the completion.
|
|
74
|
+
* Parsed from https://github.com/openai/openai-python/blob/main/src/openai/types/chat/chat_completion.py
|
|
75
|
+
*/
|
|
76
|
+
export interface Choice {
|
|
77
|
+
/** finish_reason: the finish reason of the choice. */
|
|
78
|
+
finishReason: string;
|
|
79
|
+
/** index: the index of the choice. */
|
|
80
|
+
index: number;
|
|
81
|
+
/** logprobs: the logprobs of the choice. */
|
|
82
|
+
logprobs?: ChoiceLogprobs | undefined;
|
|
83
|
+
/** message: the message of the choice. */
|
|
84
|
+
message?: ChatCompletionMessage | undefined;
|
|
37
85
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
86
|
+
/**
|
|
87
|
+
* The message response object from the LLM.
|
|
88
|
+
* Parsed from https://github.com/openai/openai-python/blob/main/src/openai/types/chat/chat_completion_message.py
|
|
89
|
+
*/
|
|
90
|
+
export interface ChatCompletionMessage {
|
|
91
|
+
/** content: the content of the message. */
|
|
92
|
+
content: string;
|
|
93
|
+
/** refusal: the refusal of the message. (not currently supported in Apex) */
|
|
94
|
+
refusal: string;
|
|
95
|
+
/** role: the role of the message. */
|
|
96
|
+
role: string;
|
|
97
|
+
/** annotations: the annotations of the message. (not currently supported in Apex) */
|
|
98
|
+
annotations: Annotation[];
|
|
99
|
+
/** audio: the audio of the message. (not currently supported in Apex) */
|
|
100
|
+
audio?: ChatCompletionAudio | undefined;
|
|
101
|
+
/** function_call: the function call of the message. */
|
|
102
|
+
functionCall?: FunctionCall | undefined;
|
|
103
|
+
/** tool_calls: the tool calls of the message. */
|
|
104
|
+
toolCalls: ChatCompletionMessageToolCall[];
|
|
46
105
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
106
|
+
/**
|
|
107
|
+
* The annotation object for the message. (not currently supported in Apex)
|
|
108
|
+
* Parsed from https://github.com/openai/openai-python/blob/main/src/openai/types/chat/chat_completion_message.py
|
|
109
|
+
*/
|
|
110
|
+
export interface Annotation {
|
|
111
|
+
/** content: the content of the annotation. */
|
|
112
|
+
content: string;
|
|
113
|
+
/** role: the role of the annotation. */
|
|
114
|
+
role: string;
|
|
50
115
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
116
|
+
/**
|
|
117
|
+
* The audio object for the message. (not currently supported in Apex)
|
|
118
|
+
* Parsed from https://github.com/openai/openai-python/blob/main/src/openai/types/chat/chat_completion_audio.py
|
|
119
|
+
*/
|
|
120
|
+
export interface ChatCompletionAudio {
|
|
121
|
+
/** id: the id of the audio. */
|
|
122
|
+
id: string;
|
|
123
|
+
/** data: the data of the audio. */
|
|
124
|
+
data: string;
|
|
125
|
+
/** expires_at: the expires at of the audio. */
|
|
126
|
+
expiresAt: number;
|
|
127
|
+
/** transcript: the transcript of the audio. */
|
|
128
|
+
transcript: string;
|
|
56
129
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
130
|
+
/**
|
|
131
|
+
* The function call object for the message.
|
|
132
|
+
* Parsed from https://github.com/openai/openai-python/blob/main/src/openai/types/chat/chat_completion_message.py
|
|
133
|
+
*/
|
|
134
|
+
export interface FunctionCall {
|
|
135
|
+
/** arguments: the arguments of the function call. */
|
|
136
|
+
arguments: string[];
|
|
137
|
+
/** name: the name of the function call. */
|
|
138
|
+
name: string;
|
|
60
139
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
140
|
+
/**
|
|
141
|
+
* The tool call object for the message.
|
|
142
|
+
* Parsed from https://github.com/openai/openai-python/blob/main/src/openai/types/chat/chat_completion_message_tool_call.py
|
|
143
|
+
*/
|
|
144
|
+
export interface ChatCompletionMessageToolCall {
|
|
145
|
+
/** id: the id of the tool call. */
|
|
146
|
+
id: string;
|
|
147
|
+
/** function: the function object for the tool call. */
|
|
148
|
+
function?: FunctionMessage | undefined;
|
|
149
|
+
/** type: the type of the tool call. */
|
|
150
|
+
type: string;
|
|
65
151
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
152
|
+
/**
|
|
153
|
+
* The function object for the tool call.
|
|
154
|
+
* Parsed from https://github.com/openai/openai-python/blob/main/src/openai/types/chat/chat_completion_message_tool_call.py
|
|
155
|
+
*/
|
|
156
|
+
export interface FunctionMessage {
|
|
157
|
+
/** arguments: the arguments of the function. */
|
|
158
|
+
arguments: string[];
|
|
159
|
+
/** name: the name of the function. */
|
|
160
|
+
name: string;
|
|
69
161
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
162
|
+
/**
|
|
163
|
+
* A streaming chunk response, following OpenAI's ChatCompletionChunk format.
|
|
164
|
+
* Parsed from https://github.com/openai/openai-python/blob/main/src/openai/types/chat/chat_completion_chunk.py
|
|
165
|
+
*/
|
|
166
|
+
export interface ChatCompletionChunkResponse {
|
|
167
|
+
/** id: the id of the chunk. */
|
|
168
|
+
id: string;
|
|
169
|
+
/** choices: the choices of the chunk. */
|
|
170
|
+
choices: ChunkChoice[];
|
|
171
|
+
/** created: the created time of the chunk. */
|
|
172
|
+
created: number;
|
|
173
|
+
/** model: the model of the chunk. */
|
|
174
|
+
model: string;
|
|
175
|
+
/** object: the object of the chunk. (not currently supported in Apex) */
|
|
176
|
+
object: string;
|
|
177
|
+
/** service_tier: the service tier of the chunk. (not currently supported in Apex) */
|
|
178
|
+
serviceTier: string;
|
|
179
|
+
/** system_fingerprint: the system fingerprint of the chunk. (not currently supported in Apex) */
|
|
180
|
+
systemFingerprint: string;
|
|
181
|
+
/** usage: the usage of the chunk. (not currently supported in Apex) */
|
|
182
|
+
usage?: CompletionUsage | undefined;
|
|
79
183
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
184
|
+
/**
|
|
185
|
+
* The choice object for the chunk.
|
|
186
|
+
* Parsed from https://github.com/macrocosm-os/prompting/blob/main/validator_api/serializers.py
|
|
187
|
+
*/
|
|
188
|
+
export interface ChatMessage {
|
|
189
|
+
/** role: the role of the message. */
|
|
190
|
+
role: string;
|
|
191
|
+
/** content: the content of the message. */
|
|
192
|
+
content: string;
|
|
83
193
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
194
|
+
/**
|
|
195
|
+
* The choice object for the chunk.
|
|
196
|
+
* Parsed from https://github.com/openai/openai-python/blob/main/src/openai/types/chat/chat_completion_chunk.py
|
|
197
|
+
*/
|
|
198
|
+
export interface ChunkChoice {
|
|
199
|
+
/** delta: the delta of the choice. */
|
|
200
|
+
delta?: ChoiceDelta | undefined;
|
|
201
|
+
/** finish_reason: the finish reason of the choice. */
|
|
202
|
+
finishReason: string;
|
|
203
|
+
/** index: the index of the choice. */
|
|
204
|
+
index: number;
|
|
205
|
+
/** logprobs: the logprobs of the choice. (not currently supported in Apex) */
|
|
206
|
+
logprobs?: ChoiceLogprobs | undefined;
|
|
89
207
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
208
|
+
/**
|
|
209
|
+
* The logprobs object for the choice.
|
|
210
|
+
* Parsed from https://github.com/openai/openai-python/blob/main/src/openai/types/chat/chat_completion_chunk.py
|
|
211
|
+
*/
|
|
212
|
+
export interface ChoiceLogprobs {
|
|
213
|
+
/** content: the content of the logprobs. */
|
|
214
|
+
content: ChatCompletionTokenLogprob[];
|
|
215
|
+
/** refusal: the refusal of the logprobs. */
|
|
216
|
+
refusal: ChatCompletionTokenLogprob[];
|
|
93
217
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
218
|
+
/**
|
|
219
|
+
* The delta object for the choice.
|
|
220
|
+
* Parsed from https://github.com/openai/openai-python/blob/main/src/openai/types/chat/chat_completion_chunk.py
|
|
221
|
+
*/
|
|
222
|
+
export interface ChoiceDelta {
|
|
223
|
+
/** content: the content of the delta. */
|
|
224
|
+
content: string;
|
|
225
|
+
/** function_call: the function call of the delta. */
|
|
226
|
+
functionCall?: ChoiceDeltaFunctionCall | undefined;
|
|
227
|
+
/** refusal: the refusal of the delta. */
|
|
228
|
+
refusal: string;
|
|
229
|
+
/** role: the role of the delta. */
|
|
230
|
+
role: string;
|
|
231
|
+
/** tool_calls: the tool calls of the delta. */
|
|
232
|
+
toolCalls: ChoiceDeltaToolCall[];
|
|
100
233
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
234
|
+
/**
|
|
235
|
+
* The function call object for the delta.
|
|
236
|
+
* Parsed from https://github.com/openai/openai-python/blob/main/src/openai/types/chat/chat_completion_chunk.py
|
|
237
|
+
*/
|
|
238
|
+
export interface ChoiceDeltaFunctionCall {
|
|
239
|
+
/** arguments: the arguments of the function call. */
|
|
240
|
+
arguments: string[];
|
|
241
|
+
/** name: the name of the function call. */
|
|
242
|
+
name: string;
|
|
104
243
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
244
|
+
/**
|
|
245
|
+
* The tool call object for the delta.
|
|
246
|
+
* Parsed from https://github.com/openai/openai-python/blob/main/src/openai/types/chat/chat_completion_chunk.py
|
|
247
|
+
*/
|
|
248
|
+
export interface ChoiceDeltaToolCall {
|
|
249
|
+
/** index: the index of the tool call. */
|
|
250
|
+
index: number;
|
|
251
|
+
/** id: the id of the tool call. */
|
|
252
|
+
id: string;
|
|
253
|
+
/** function: the function object for the tool call. */
|
|
254
|
+
function?: ChoiceDeltaToolCallFunction | undefined;
|
|
255
|
+
/** type: the type of the tool call. */
|
|
256
|
+
type: string;
|
|
110
257
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
258
|
+
/**
|
|
259
|
+
* The function object for the tool call.
|
|
260
|
+
* Parsed from https://github.com/openai/openai-python/blob/main/src/openai/types/chat/chat_completion_chunk.py
|
|
261
|
+
*/
|
|
262
|
+
export interface ChoiceDeltaToolCallFunction {
|
|
263
|
+
/** arguments: the arguments of the function. */
|
|
264
|
+
arguments: string[];
|
|
265
|
+
/** name: the name of the function. */
|
|
266
|
+
name: string;
|
|
114
267
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
268
|
+
/**
|
|
269
|
+
* The chat completion token logprob object. (not currently supported in Apex)
|
|
270
|
+
* Parsed from https://github.com/openai/openai-python/blob/main/src/openai/types/chat/chat_completion_token_logprob.py
|
|
271
|
+
*/
|
|
272
|
+
export interface ChatCompletionTokenLogprob {
|
|
273
|
+
/** token: the token of the logprob. */
|
|
274
|
+
token: string;
|
|
275
|
+
/** bytes: the bytes of the logprob. */
|
|
276
|
+
bytes: number[];
|
|
277
|
+
/** logprob: the logprob of the token. */
|
|
278
|
+
logprob: number;
|
|
279
|
+
/** top_logprobs: the top logprobs of the token. */
|
|
280
|
+
topLogprobs: TopLogprob[];
|
|
120
281
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
282
|
+
/**
|
|
283
|
+
* The top logprob object for the token. (not currently supported in Apex)
|
|
284
|
+
* Parsed from https://github.com/openai/openai-python/blob/main/src/openai/types/chat/chat_completion_token_logprob.py
|
|
285
|
+
*/
|
|
286
|
+
export interface TopLogprob {
|
|
287
|
+
/** token: the token of the logprob. */
|
|
288
|
+
token: string;
|
|
289
|
+
/** bytes: the bytes of the logprob. */
|
|
290
|
+
bytes: number[];
|
|
291
|
+
/** logprob: the logprob of the token. */
|
|
292
|
+
logprob: number;
|
|
125
293
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
294
|
+
/**
|
|
295
|
+
* The completion usage object. (not currently supported in Apex)
|
|
296
|
+
* Parsed from https://github.com/openai/openai-python/blob/main/src/openai/types/completion_usage.py
|
|
297
|
+
*/
|
|
298
|
+
export interface CompletionUsage {
|
|
299
|
+
/** completion_tokens: the completion tokens of the usage. */
|
|
300
|
+
completionTokens: number;
|
|
301
|
+
/** prompt_tokens: the prompt tokens of the usage. */
|
|
302
|
+
promptTokens: number;
|
|
303
|
+
/** total_tokens: the total tokens of the usage. */
|
|
304
|
+
totalTokens: number;
|
|
305
|
+
/** completion_tokens_details: the completion tokens details of the usage. */
|
|
306
|
+
completionTokensDetails?: CompletionTokensDetails | undefined;
|
|
307
|
+
/** prompt_tokens_details: the prompt tokens details of the usage. */
|
|
308
|
+
promptTokensDetails?: PromptTokensDetails | undefined;
|
|
132
309
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
310
|
+
/**
|
|
311
|
+
* The completion tokens details object. (not currently supported in Apex)
|
|
312
|
+
* Parsed from https://github.com/openai/openai-python/blob/main/src/openai/types/completion_usage.py
|
|
313
|
+
*/
|
|
314
|
+
export interface CompletionTokensDetails {
|
|
315
|
+
/** accepted_prediction_tokens: the accepted prediction tokens of the details. */
|
|
316
|
+
acceptedPredictionTokens: number;
|
|
317
|
+
/** audio_tokens: the audio tokens of the details. */
|
|
318
|
+
audioTokens: number;
|
|
319
|
+
/** reasoning_tokens: the reasoning tokens of the details. */
|
|
320
|
+
reasoningTokens: number;
|
|
321
|
+
/** rejected_prediction_tokens: the rejected prediction tokens of the details. */
|
|
322
|
+
rejectedPredictionTokens: number;
|
|
138
323
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
324
|
+
/**
|
|
325
|
+
* The prompt tokens details object. (not currently supported in Apex)
|
|
326
|
+
* Parsed from https://github.com/openai/openai-python/blob/main/src/openai/types/completion_usage.py
|
|
327
|
+
*/
|
|
328
|
+
export interface PromptTokensDetails {
|
|
329
|
+
/** audio_tokens: the audio tokens of the details. */
|
|
330
|
+
audioTokens: number;
|
|
331
|
+
/** cached_tokens: the cached tokens of the details. */
|
|
332
|
+
cachedTokens: number;
|
|
142
333
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
334
|
+
/**
|
|
335
|
+
* A web retrival request from Apex
|
|
336
|
+
* Parsed from https://github.com/macrocosm-os/prompting/blob/main/validator_api/serializers.py
|
|
337
|
+
*/
|
|
338
|
+
export interface WebRetrievalRequest {
|
|
339
|
+
/** uids: the miner UIDs that will be used to generate the completion (optional). */
|
|
340
|
+
uids: number[];
|
|
341
|
+
/** search_query: the search query. */
|
|
342
|
+
searchQuery: string;
|
|
343
|
+
/** n_miners: the number of miners to use for the query. */
|
|
344
|
+
nMiners?: number | undefined;
|
|
345
|
+
/** n_results: the number of results to return. */
|
|
346
|
+
nResults?: number | undefined;
|
|
347
|
+
/** max_response_time: the max response time to allow for the miners to respond in seconds. */
|
|
348
|
+
maxResponseTime?: number | undefined;
|
|
349
|
+
/** timeout: the timeout for the web retrieval in seconds. */
|
|
350
|
+
timeout?: number | undefined;
|
|
150
351
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
352
|
+
/**
|
|
353
|
+
* A web search result from Apex
|
|
354
|
+
* Parsed from https://github.com/macrocosm-os/prompting/blob/main/validator_api/serializers.py
|
|
355
|
+
*/
|
|
356
|
+
export interface WebSearchResult {
|
|
357
|
+
/** url: the url of the result. */
|
|
358
|
+
url: string;
|
|
359
|
+
/** content: the entire page contents. */
|
|
360
|
+
content: string;
|
|
361
|
+
/** relevant: the relevant part of the page best fitting the query.. */
|
|
362
|
+
relevant: string;
|
|
155
363
|
}
|
|
156
|
-
|
|
157
|
-
|
|
364
|
+
/**
|
|
365
|
+
* A web retrieval response from Apex
|
|
366
|
+
* Parsed from https://github.com/macrocosm-os/prompting/blob/main/validator_api/serializers.py
|
|
367
|
+
*/
|
|
368
|
+
export interface WebRetrievalResponse {
|
|
369
|
+
/** results: the results of the web retrieval. */
|
|
370
|
+
results: WebSearchResult[];
|
|
158
371
|
}
|
|
159
|
-
export
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
export declare const
|
|
168
|
-
|
|
169
|
-
|
|
372
|
+
export declare const ChatCompletionRequest: MessageFns<ChatCompletionRequest>;
|
|
373
|
+
export declare const SamplingParameters: MessageFns<SamplingParameters>;
|
|
374
|
+
export declare const ChatCompletionResponse: MessageFns<ChatCompletionResponse>;
|
|
375
|
+
export declare const Choice: MessageFns<Choice>;
|
|
376
|
+
export declare const ChatCompletionMessage: MessageFns<ChatCompletionMessage>;
|
|
377
|
+
export declare const Annotation: MessageFns<Annotation>;
|
|
378
|
+
export declare const ChatCompletionAudio: MessageFns<ChatCompletionAudio>;
|
|
379
|
+
export declare const FunctionCall: MessageFns<FunctionCall>;
|
|
380
|
+
export declare const ChatCompletionMessageToolCall: MessageFns<ChatCompletionMessageToolCall>;
|
|
381
|
+
export declare const FunctionMessage: MessageFns<FunctionMessage>;
|
|
382
|
+
export declare const ChatCompletionChunkResponse: MessageFns<ChatCompletionChunkResponse>;
|
|
383
|
+
export declare const ChatMessage: MessageFns<ChatMessage>;
|
|
384
|
+
export declare const ChunkChoice: MessageFns<ChunkChoice>;
|
|
385
|
+
export declare const ChoiceLogprobs: MessageFns<ChoiceLogprobs>;
|
|
386
|
+
export declare const ChoiceDelta: MessageFns<ChoiceDelta>;
|
|
387
|
+
export declare const ChoiceDeltaFunctionCall: MessageFns<ChoiceDeltaFunctionCall>;
|
|
388
|
+
export declare const ChoiceDeltaToolCall: MessageFns<ChoiceDeltaToolCall>;
|
|
389
|
+
export declare const ChoiceDeltaToolCallFunction: MessageFns<ChoiceDeltaToolCallFunction>;
|
|
390
|
+
export declare const ChatCompletionTokenLogprob: MessageFns<ChatCompletionTokenLogprob>;
|
|
391
|
+
export declare const TopLogprob: MessageFns<TopLogprob>;
|
|
392
|
+
export declare const CompletionUsage: MessageFns<CompletionUsage>;
|
|
393
|
+
export declare const CompletionTokensDetails: MessageFns<CompletionTokensDetails>;
|
|
394
|
+
export declare const PromptTokensDetails: MessageFns<PromptTokensDetails>;
|
|
395
|
+
export declare const WebRetrievalRequest: MessageFns<WebRetrievalRequest>;
|
|
396
|
+
export declare const WebSearchResult: MessageFns<WebSearchResult>;
|
|
397
|
+
export declare const WebRetrievalResponse: MessageFns<WebRetrievalResponse>;
|
|
398
|
+
export type ApexServiceService = typeof ApexServiceService;
|
|
399
|
+
export declare const ApexServiceService: {
|
|
400
|
+
/** ChatCompletion generates a completion for a given request. */
|
|
401
|
+
readonly chatCompletion: {
|
|
402
|
+
readonly path: "/apex.v1.ApexService/ChatCompletion";
|
|
403
|
+
readonly requestStream: false;
|
|
404
|
+
readonly responseStream: false;
|
|
405
|
+
readonly requestSerialize: (value: ChatCompletionRequest) => Buffer<ArrayBuffer>;
|
|
406
|
+
readonly requestDeserialize: (value: Buffer) => ChatCompletionRequest;
|
|
407
|
+
readonly responseSerialize: (value: ChatCompletionResponse) => Buffer<ArrayBuffer>;
|
|
408
|
+
readonly responseDeserialize: (value: Buffer) => ChatCompletionResponse;
|
|
409
|
+
};
|
|
410
|
+
/** ChatCompletionStream generates a stream of completions for a given request. */
|
|
411
|
+
readonly chatCompletionStream: {
|
|
412
|
+
readonly path: "/apex.v1.ApexService/ChatCompletionStream";
|
|
413
|
+
readonly requestStream: false;
|
|
414
|
+
readonly responseStream: true;
|
|
415
|
+
readonly requestSerialize: (value: ChatCompletionRequest) => Buffer<ArrayBuffer>;
|
|
416
|
+
readonly requestDeserialize: (value: Buffer) => ChatCompletionRequest;
|
|
417
|
+
readonly responseSerialize: (value: ChatCompletionChunkResponse) => Buffer<ArrayBuffer>;
|
|
418
|
+
readonly responseDeserialize: (value: Buffer) => ChatCompletionChunkResponse;
|
|
170
419
|
};
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
methods: {
|
|
181
|
-
ChatCompletion: {
|
|
182
|
-
requestType: string;
|
|
183
|
-
responseType: string;
|
|
184
|
-
};
|
|
185
|
-
ChatCompletionStream: {
|
|
186
|
-
requestType: string;
|
|
187
|
-
responseType: string;
|
|
188
|
-
responseStream: boolean;
|
|
189
|
-
};
|
|
190
|
-
WebRetrieval: {
|
|
191
|
-
requestType: string;
|
|
192
|
-
responseType: string;
|
|
193
|
-
};
|
|
194
|
-
};
|
|
195
|
-
};
|
|
196
|
-
ChatCompletionRequest: {
|
|
197
|
-
fields: {
|
|
198
|
-
uids: {
|
|
199
|
-
rule: string;
|
|
200
|
-
type: string;
|
|
201
|
-
id: number;
|
|
202
|
-
};
|
|
203
|
-
messages: {
|
|
204
|
-
rule: string;
|
|
205
|
-
type: string;
|
|
206
|
-
id: number;
|
|
207
|
-
};
|
|
208
|
-
seed: {
|
|
209
|
-
type: string;
|
|
210
|
-
id: number;
|
|
211
|
-
};
|
|
212
|
-
task: {
|
|
213
|
-
type: string;
|
|
214
|
-
id: number;
|
|
215
|
-
};
|
|
216
|
-
model: {
|
|
217
|
-
type: string;
|
|
218
|
-
id: number;
|
|
219
|
-
};
|
|
220
|
-
testTimeInference: {
|
|
221
|
-
type: string;
|
|
222
|
-
id: number;
|
|
223
|
-
};
|
|
224
|
-
mixture: {
|
|
225
|
-
type: string;
|
|
226
|
-
id: number;
|
|
227
|
-
};
|
|
228
|
-
samplingParameters: {
|
|
229
|
-
type: string;
|
|
230
|
-
id: number;
|
|
231
|
-
};
|
|
232
|
-
inferenceMode: {
|
|
233
|
-
type: string;
|
|
234
|
-
id: number;
|
|
235
|
-
};
|
|
236
|
-
jsonFormat: {
|
|
237
|
-
type: string;
|
|
238
|
-
id: number;
|
|
239
|
-
};
|
|
240
|
-
stream: {
|
|
241
|
-
type: string;
|
|
242
|
-
id: number;
|
|
243
|
-
};
|
|
244
|
-
timeout: {
|
|
245
|
-
type: string;
|
|
246
|
-
id: number;
|
|
247
|
-
};
|
|
248
|
-
};
|
|
249
|
-
};
|
|
250
|
-
SamplingParameters: {
|
|
251
|
-
fields: {
|
|
252
|
-
temperature: {
|
|
253
|
-
type: string;
|
|
254
|
-
id: number;
|
|
255
|
-
};
|
|
256
|
-
topP: {
|
|
257
|
-
type: string;
|
|
258
|
-
id: number;
|
|
259
|
-
};
|
|
260
|
-
topK: {
|
|
261
|
-
type: string;
|
|
262
|
-
id: number;
|
|
263
|
-
};
|
|
264
|
-
maxNewTokens: {
|
|
265
|
-
type: string;
|
|
266
|
-
id: number;
|
|
267
|
-
};
|
|
268
|
-
doSample: {
|
|
269
|
-
type: string;
|
|
270
|
-
id: number;
|
|
271
|
-
};
|
|
272
|
-
};
|
|
273
|
-
};
|
|
274
|
-
ChatCompletionResponse: {
|
|
275
|
-
fields: {
|
|
276
|
-
id: {
|
|
277
|
-
type: string;
|
|
278
|
-
id: number;
|
|
279
|
-
};
|
|
280
|
-
choices: {
|
|
281
|
-
rule: string;
|
|
282
|
-
type: string;
|
|
283
|
-
id: number;
|
|
284
|
-
};
|
|
285
|
-
created: {
|
|
286
|
-
type: string;
|
|
287
|
-
id: number;
|
|
288
|
-
};
|
|
289
|
-
model: {
|
|
290
|
-
type: string;
|
|
291
|
-
id: number;
|
|
292
|
-
};
|
|
293
|
-
object: {
|
|
294
|
-
type: string;
|
|
295
|
-
id: number;
|
|
296
|
-
};
|
|
297
|
-
serviceTier: {
|
|
298
|
-
type: string;
|
|
299
|
-
id: number;
|
|
300
|
-
};
|
|
301
|
-
systemFingerprint: {
|
|
302
|
-
type: string;
|
|
303
|
-
id: number;
|
|
304
|
-
};
|
|
305
|
-
usage: {
|
|
306
|
-
type: string;
|
|
307
|
-
id: number;
|
|
308
|
-
};
|
|
309
|
-
};
|
|
310
|
-
};
|
|
311
|
-
Choice: {
|
|
312
|
-
fields: {
|
|
313
|
-
finishReason: {
|
|
314
|
-
type: string;
|
|
315
|
-
id: number;
|
|
316
|
-
};
|
|
317
|
-
index: {
|
|
318
|
-
type: string;
|
|
319
|
-
id: number;
|
|
320
|
-
};
|
|
321
|
-
logprobs: {
|
|
322
|
-
type: string;
|
|
323
|
-
id: number;
|
|
324
|
-
};
|
|
325
|
-
message: {
|
|
326
|
-
type: string;
|
|
327
|
-
id: number;
|
|
328
|
-
};
|
|
329
|
-
};
|
|
330
|
-
};
|
|
331
|
-
ChatCompletionMessage: {
|
|
332
|
-
fields: {
|
|
333
|
-
content: {
|
|
334
|
-
type: string;
|
|
335
|
-
id: number;
|
|
336
|
-
};
|
|
337
|
-
refusal: {
|
|
338
|
-
type: string;
|
|
339
|
-
id: number;
|
|
340
|
-
};
|
|
341
|
-
role: {
|
|
342
|
-
type: string;
|
|
343
|
-
id: number;
|
|
344
|
-
};
|
|
345
|
-
annotations: {
|
|
346
|
-
rule: string;
|
|
347
|
-
type: string;
|
|
348
|
-
id: number;
|
|
349
|
-
};
|
|
350
|
-
audio: {
|
|
351
|
-
type: string;
|
|
352
|
-
id: number;
|
|
353
|
-
};
|
|
354
|
-
functionCall: {
|
|
355
|
-
type: string;
|
|
356
|
-
id: number;
|
|
357
|
-
};
|
|
358
|
-
toolCalls: {
|
|
359
|
-
rule: string;
|
|
360
|
-
type: string;
|
|
361
|
-
id: number;
|
|
362
|
-
};
|
|
363
|
-
};
|
|
364
|
-
};
|
|
365
|
-
Annotation: {
|
|
366
|
-
fields: {
|
|
367
|
-
content: {
|
|
368
|
-
type: string;
|
|
369
|
-
id: number;
|
|
370
|
-
};
|
|
371
|
-
role: {
|
|
372
|
-
type: string;
|
|
373
|
-
id: number;
|
|
374
|
-
};
|
|
375
|
-
};
|
|
376
|
-
};
|
|
377
|
-
ChatCompletionAudio: {
|
|
378
|
-
fields: {
|
|
379
|
-
id: {
|
|
380
|
-
type: string;
|
|
381
|
-
id: number;
|
|
382
|
-
};
|
|
383
|
-
data: {
|
|
384
|
-
type: string;
|
|
385
|
-
id: number;
|
|
386
|
-
};
|
|
387
|
-
expiresAt: {
|
|
388
|
-
type: string;
|
|
389
|
-
id: number;
|
|
390
|
-
};
|
|
391
|
-
transcript: {
|
|
392
|
-
type: string;
|
|
393
|
-
id: number;
|
|
394
|
-
};
|
|
395
|
-
};
|
|
396
|
-
};
|
|
397
|
-
FunctionCall: {
|
|
398
|
-
fields: {
|
|
399
|
-
arguments: {
|
|
400
|
-
rule: string;
|
|
401
|
-
type: string;
|
|
402
|
-
id: number;
|
|
403
|
-
};
|
|
404
|
-
name: {
|
|
405
|
-
type: string;
|
|
406
|
-
id: number;
|
|
407
|
-
};
|
|
408
|
-
};
|
|
409
|
-
};
|
|
410
|
-
ChatCompletionMessageToolCall: {
|
|
411
|
-
fields: {
|
|
412
|
-
id: {
|
|
413
|
-
type: string;
|
|
414
|
-
id: number;
|
|
415
|
-
};
|
|
416
|
-
function: {
|
|
417
|
-
type: string;
|
|
418
|
-
id: number;
|
|
419
|
-
};
|
|
420
|
-
type: {
|
|
421
|
-
type: string;
|
|
422
|
-
id: number;
|
|
423
|
-
};
|
|
424
|
-
};
|
|
425
|
-
};
|
|
426
|
-
Function: {
|
|
427
|
-
fields: {
|
|
428
|
-
arguments: {
|
|
429
|
-
rule: string;
|
|
430
|
-
type: string;
|
|
431
|
-
id: number;
|
|
432
|
-
};
|
|
433
|
-
name: {
|
|
434
|
-
type: string;
|
|
435
|
-
id: number;
|
|
436
|
-
};
|
|
437
|
-
};
|
|
438
|
-
};
|
|
439
|
-
ChatCompletionChunkResponse: {
|
|
440
|
-
fields: {
|
|
441
|
-
id: {
|
|
442
|
-
type: string;
|
|
443
|
-
id: number;
|
|
444
|
-
};
|
|
445
|
-
choices: {
|
|
446
|
-
rule: string;
|
|
447
|
-
type: string;
|
|
448
|
-
id: number;
|
|
449
|
-
};
|
|
450
|
-
created: {
|
|
451
|
-
type: string;
|
|
452
|
-
id: number;
|
|
453
|
-
};
|
|
454
|
-
model: {
|
|
455
|
-
type: string;
|
|
456
|
-
id: number;
|
|
457
|
-
};
|
|
458
|
-
object: {
|
|
459
|
-
type: string;
|
|
460
|
-
id: number;
|
|
461
|
-
};
|
|
462
|
-
serviceTier: {
|
|
463
|
-
type: string;
|
|
464
|
-
id: number;
|
|
465
|
-
};
|
|
466
|
-
systemFingerprint: {
|
|
467
|
-
type: string;
|
|
468
|
-
id: number;
|
|
469
|
-
};
|
|
470
|
-
usage: {
|
|
471
|
-
type: string;
|
|
472
|
-
id: number;
|
|
473
|
-
};
|
|
474
|
-
};
|
|
475
|
-
};
|
|
476
|
-
ChatMessage: {
|
|
477
|
-
fields: {
|
|
478
|
-
role: {
|
|
479
|
-
type: string;
|
|
480
|
-
id: number;
|
|
481
|
-
};
|
|
482
|
-
content: {
|
|
483
|
-
type: string;
|
|
484
|
-
id: number;
|
|
485
|
-
};
|
|
486
|
-
};
|
|
487
|
-
};
|
|
488
|
-
ChunkChoice: {
|
|
489
|
-
fields: {
|
|
490
|
-
delta: {
|
|
491
|
-
type: string;
|
|
492
|
-
id: number;
|
|
493
|
-
};
|
|
494
|
-
finishReason: {
|
|
495
|
-
type: string;
|
|
496
|
-
id: number;
|
|
497
|
-
};
|
|
498
|
-
index: {
|
|
499
|
-
type: string;
|
|
500
|
-
id: number;
|
|
501
|
-
};
|
|
502
|
-
logprobs: {
|
|
503
|
-
type: string;
|
|
504
|
-
id: number;
|
|
505
|
-
};
|
|
506
|
-
};
|
|
507
|
-
};
|
|
508
|
-
ChoiceLogprobs: {
|
|
509
|
-
fields: {
|
|
510
|
-
content: {
|
|
511
|
-
rule: string;
|
|
512
|
-
type: string;
|
|
513
|
-
id: number;
|
|
514
|
-
};
|
|
515
|
-
refusal: {
|
|
516
|
-
rule: string;
|
|
517
|
-
type: string;
|
|
518
|
-
id: number;
|
|
519
|
-
};
|
|
520
|
-
};
|
|
521
|
-
};
|
|
522
|
-
ChoiceDelta: {
|
|
523
|
-
fields: {
|
|
524
|
-
content: {
|
|
525
|
-
type: string;
|
|
526
|
-
id: number;
|
|
527
|
-
};
|
|
528
|
-
functionCall: {
|
|
529
|
-
type: string;
|
|
530
|
-
id: number;
|
|
531
|
-
};
|
|
532
|
-
refusal: {
|
|
533
|
-
type: string;
|
|
534
|
-
id: number;
|
|
535
|
-
};
|
|
536
|
-
role: {
|
|
537
|
-
type: string;
|
|
538
|
-
id: number;
|
|
539
|
-
};
|
|
540
|
-
toolCalls: {
|
|
541
|
-
rule: string;
|
|
542
|
-
type: string;
|
|
543
|
-
id: number;
|
|
544
|
-
};
|
|
545
|
-
};
|
|
546
|
-
};
|
|
547
|
-
ChoiceDeltaFunctionCall: {
|
|
548
|
-
fields: {
|
|
549
|
-
arguments: {
|
|
550
|
-
rule: string;
|
|
551
|
-
type: string;
|
|
552
|
-
id: number;
|
|
553
|
-
};
|
|
554
|
-
name: {
|
|
555
|
-
type: string;
|
|
556
|
-
id: number;
|
|
557
|
-
};
|
|
558
|
-
};
|
|
559
|
-
};
|
|
560
|
-
ChoiceDeltaToolCall: {
|
|
561
|
-
fields: {
|
|
562
|
-
index: {
|
|
563
|
-
type: string;
|
|
564
|
-
id: number;
|
|
565
|
-
};
|
|
566
|
-
id: {
|
|
567
|
-
type: string;
|
|
568
|
-
id: number;
|
|
569
|
-
};
|
|
570
|
-
function: {
|
|
571
|
-
type: string;
|
|
572
|
-
id: number;
|
|
573
|
-
};
|
|
574
|
-
type: {
|
|
575
|
-
type: string;
|
|
576
|
-
id: number;
|
|
577
|
-
};
|
|
578
|
-
};
|
|
579
|
-
};
|
|
580
|
-
ChoiceDeltaToolCallFunction: {
|
|
581
|
-
fields: {
|
|
582
|
-
arguments: {
|
|
583
|
-
rule: string;
|
|
584
|
-
type: string;
|
|
585
|
-
id: number;
|
|
586
|
-
};
|
|
587
|
-
name: {
|
|
588
|
-
type: string;
|
|
589
|
-
id: number;
|
|
590
|
-
};
|
|
591
|
-
};
|
|
592
|
-
};
|
|
593
|
-
ChatCompletionTokenLogprob: {
|
|
594
|
-
fields: {
|
|
595
|
-
token: {
|
|
596
|
-
type: string;
|
|
597
|
-
id: number;
|
|
598
|
-
};
|
|
599
|
-
bytes: {
|
|
600
|
-
rule: string;
|
|
601
|
-
type: string;
|
|
602
|
-
id: number;
|
|
603
|
-
};
|
|
604
|
-
logprob: {
|
|
605
|
-
type: string;
|
|
606
|
-
id: number;
|
|
607
|
-
};
|
|
608
|
-
topLogprobs: {
|
|
609
|
-
rule: string;
|
|
610
|
-
type: string;
|
|
611
|
-
id: number;
|
|
612
|
-
};
|
|
613
|
-
};
|
|
614
|
-
};
|
|
615
|
-
TopLogprob: {
|
|
616
|
-
fields: {
|
|
617
|
-
token: {
|
|
618
|
-
type: string;
|
|
619
|
-
id: number;
|
|
620
|
-
};
|
|
621
|
-
bytes: {
|
|
622
|
-
rule: string;
|
|
623
|
-
type: string;
|
|
624
|
-
id: number;
|
|
625
|
-
};
|
|
626
|
-
logprob: {
|
|
627
|
-
type: string;
|
|
628
|
-
id: number;
|
|
629
|
-
};
|
|
630
|
-
};
|
|
631
|
-
};
|
|
632
|
-
CompletionUsage: {
|
|
633
|
-
fields: {
|
|
634
|
-
completionTokens: {
|
|
635
|
-
type: string;
|
|
636
|
-
id: number;
|
|
637
|
-
};
|
|
638
|
-
promptTokens: {
|
|
639
|
-
type: string;
|
|
640
|
-
id: number;
|
|
641
|
-
};
|
|
642
|
-
totalTokens: {
|
|
643
|
-
type: string;
|
|
644
|
-
id: number;
|
|
645
|
-
};
|
|
646
|
-
completionTokensDetails: {
|
|
647
|
-
type: string;
|
|
648
|
-
id: number;
|
|
649
|
-
};
|
|
650
|
-
promptTokensDetails: {
|
|
651
|
-
type: string;
|
|
652
|
-
id: number;
|
|
653
|
-
};
|
|
654
|
-
};
|
|
655
|
-
};
|
|
656
|
-
CompletionTokensDetails: {
|
|
657
|
-
fields: {
|
|
658
|
-
acceptedPredictionTokens: {
|
|
659
|
-
type: string;
|
|
660
|
-
id: number;
|
|
661
|
-
};
|
|
662
|
-
audioTokens: {
|
|
663
|
-
type: string;
|
|
664
|
-
id: number;
|
|
665
|
-
};
|
|
666
|
-
reasoningTokens: {
|
|
667
|
-
type: string;
|
|
668
|
-
id: number;
|
|
669
|
-
};
|
|
670
|
-
rejectedPredictionTokens: {
|
|
671
|
-
type: string;
|
|
672
|
-
id: number;
|
|
673
|
-
};
|
|
674
|
-
};
|
|
675
|
-
};
|
|
676
|
-
PromptTokensDetails: {
|
|
677
|
-
fields: {
|
|
678
|
-
audioTokens: {
|
|
679
|
-
type: string;
|
|
680
|
-
id: number;
|
|
681
|
-
};
|
|
682
|
-
cachedTokens: {
|
|
683
|
-
type: string;
|
|
684
|
-
id: number;
|
|
685
|
-
};
|
|
686
|
-
};
|
|
687
|
-
};
|
|
688
|
-
WebRetrievalRequest: {
|
|
689
|
-
fields: {
|
|
690
|
-
uids: {
|
|
691
|
-
rule: string;
|
|
692
|
-
type: string;
|
|
693
|
-
id: number;
|
|
694
|
-
};
|
|
695
|
-
searchQuery: {
|
|
696
|
-
type: string;
|
|
697
|
-
id: number;
|
|
698
|
-
};
|
|
699
|
-
nMiners: {
|
|
700
|
-
type: string;
|
|
701
|
-
id: number;
|
|
702
|
-
};
|
|
703
|
-
nResults: {
|
|
704
|
-
type: string;
|
|
705
|
-
id: number;
|
|
706
|
-
};
|
|
707
|
-
maxResponseTime: {
|
|
708
|
-
type: string;
|
|
709
|
-
id: number;
|
|
710
|
-
};
|
|
711
|
-
timeout: {
|
|
712
|
-
type: string;
|
|
713
|
-
id: number;
|
|
714
|
-
};
|
|
715
|
-
};
|
|
716
|
-
};
|
|
717
|
-
WebSearchResult: {
|
|
718
|
-
fields: {
|
|
719
|
-
url: {
|
|
720
|
-
type: string;
|
|
721
|
-
id: number;
|
|
722
|
-
};
|
|
723
|
-
content: {
|
|
724
|
-
type: string;
|
|
725
|
-
id: number;
|
|
726
|
-
};
|
|
727
|
-
relevant: {
|
|
728
|
-
type: string;
|
|
729
|
-
id: number;
|
|
730
|
-
};
|
|
731
|
-
};
|
|
732
|
-
};
|
|
733
|
-
WebRetrievalResponse: {
|
|
734
|
-
fields: {
|
|
735
|
-
results: {
|
|
736
|
-
rule: string;
|
|
737
|
-
type: string;
|
|
738
|
-
id: number;
|
|
739
|
-
};
|
|
740
|
-
};
|
|
741
|
-
};
|
|
742
|
-
};
|
|
743
|
-
};
|
|
744
|
-
};
|
|
745
|
-
};
|
|
420
|
+
/** WebRetrieval retrieves web search results for a given request. */
|
|
421
|
+
readonly webRetrieval: {
|
|
422
|
+
readonly path: "/apex.v1.ApexService/WebRetrieval";
|
|
423
|
+
readonly requestStream: false;
|
|
424
|
+
readonly responseStream: false;
|
|
425
|
+
readonly requestSerialize: (value: WebRetrievalRequest) => Buffer<ArrayBuffer>;
|
|
426
|
+
readonly requestDeserialize: (value: Buffer) => WebRetrievalRequest;
|
|
427
|
+
readonly responseSerialize: (value: WebRetrievalResponse) => Buffer<ArrayBuffer>;
|
|
428
|
+
readonly responseDeserialize: (value: Buffer) => WebRetrievalResponse;
|
|
746
429
|
};
|
|
747
430
|
};
|
|
431
|
+
export interface ApexServiceServer extends UntypedServiceImplementation {
|
|
432
|
+
/** ChatCompletion generates a completion for a given request. */
|
|
433
|
+
chatCompletion: handleUnaryCall<ChatCompletionRequest, ChatCompletionResponse>;
|
|
434
|
+
/** ChatCompletionStream generates a stream of completions for a given request. */
|
|
435
|
+
chatCompletionStream: handleServerStreamingCall<ChatCompletionRequest, ChatCompletionChunkResponse>;
|
|
436
|
+
/** WebRetrieval retrieves web search results for a given request. */
|
|
437
|
+
webRetrieval: handleUnaryCall<WebRetrievalRequest, WebRetrievalResponse>;
|
|
438
|
+
}
|
|
439
|
+
export interface ApexServiceClient extends Client {
|
|
440
|
+
/** ChatCompletion generates a completion for a given request. */
|
|
441
|
+
chatCompletion(request: ChatCompletionRequest, callback: (error: ServiceError | null, response: ChatCompletionResponse) => void): ClientUnaryCall;
|
|
442
|
+
chatCompletion(request: ChatCompletionRequest, metadata: Metadata, callback: (error: ServiceError | null, response: ChatCompletionResponse) => void): ClientUnaryCall;
|
|
443
|
+
chatCompletion(request: ChatCompletionRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: ChatCompletionResponse) => void): ClientUnaryCall;
|
|
444
|
+
/** ChatCompletionStream generates a stream of completions for a given request. */
|
|
445
|
+
chatCompletionStream(request: ChatCompletionRequest, options?: Partial<CallOptions>): ClientReadableStream<ChatCompletionChunkResponse>;
|
|
446
|
+
chatCompletionStream(request: ChatCompletionRequest, metadata?: Metadata, options?: Partial<CallOptions>): ClientReadableStream<ChatCompletionChunkResponse>;
|
|
447
|
+
/** WebRetrieval retrieves web search results for a given request. */
|
|
448
|
+
webRetrieval(request: WebRetrievalRequest, callback: (error: ServiceError | null, response: WebRetrievalResponse) => void): ClientUnaryCall;
|
|
449
|
+
webRetrieval(request: WebRetrievalRequest, metadata: Metadata, callback: (error: ServiceError | null, response: WebRetrievalResponse) => void): ClientUnaryCall;
|
|
450
|
+
webRetrieval(request: WebRetrievalRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: WebRetrievalResponse) => void): ClientUnaryCall;
|
|
451
|
+
}
|
|
452
|
+
export declare const ApexServiceClient: {
|
|
453
|
+
new (address: string, credentials: ChannelCredentials, options?: Partial<ClientOptions>): ApexServiceClient;
|
|
454
|
+
service: typeof ApexServiceService;
|
|
455
|
+
serviceName: string;
|
|
456
|
+
};
|
|
457
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
458
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
459
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
460
|
+
} : Partial<T>;
|
|
461
|
+
export interface MessageFns<T> {
|
|
462
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
463
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
464
|
+
fromJSON(object: any): T;
|
|
465
|
+
toJSON(message: T): unknown;
|
|
466
|
+
create(base?: DeepPartial<T>): T;
|
|
467
|
+
fromPartial(object: DeepPartial<T>): T;
|
|
468
|
+
}
|
|
469
|
+
export {};
|