@agentuity/core 2.0.14 → 2.0.15
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/services/aigateway/api-reference.d.ts +4 -0
- package/dist/services/aigateway/api-reference.d.ts.map +1 -0
- package/dist/services/aigateway/api-reference.js +146 -0
- package/dist/services/aigateway/api-reference.js.map +1 -0
- package/dist/services/aigateway/index.d.ts +2 -0
- package/dist/services/aigateway/index.d.ts.map +1 -0
- package/dist/services/aigateway/index.js +2 -0
- package/dist/services/aigateway/index.js.map +1 -0
- package/dist/services/aigateway/service.d.ts +221 -0
- package/dist/services/aigateway/service.d.ts.map +1 -0
- package/dist/services/aigateway/service.js +280 -0
- package/dist/services/aigateway/service.js.map +1 -0
- package/dist/services/api-reference.d.ts +1 -0
- package/dist/services/api-reference.d.ts.map +1 -1
- package/dist/services/api-reference.js.map +1 -1
- package/dist/services/coder/client.d.ts +5 -1
- package/dist/services/coder/client.d.ts.map +1 -1
- package/dist/services/coder/client.js +8 -1
- package/dist/services/coder/client.js.map +1 -1
- package/dist/services/coder/protocol.d.ts +1 -1
- package/dist/services/coder/sessions.d.ts +2 -0
- package/dist/services/coder/sessions.d.ts.map +1 -1
- package/dist/services/coder/skills.d.ts +4 -1
- package/dist/services/coder/skills.d.ts.map +1 -1
- package/dist/services/coder/skills.js +14 -1
- package/dist/services/coder/skills.js.map +1 -1
- package/dist/services/coder/types.d.ts +64 -8
- package/dist/services/coder/types.d.ts.map +1 -1
- package/dist/services/coder/types.js +36 -1
- package/dist/services/coder/types.js.map +1 -1
- package/dist/services/config.d.ts +1 -0
- package/dist/services/config.d.ts.map +1 -1
- package/dist/services/config.js +2 -0
- package/dist/services/config.js.map +1 -1
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +1 -0
- package/dist/services/index.js.map +1 -1
- package/dist/services/keyvalue/service.d.ts +2 -2
- package/dist/services/project/deploy.d.ts +2 -2
- package/dist/services/sandbox/list.d.ts +1 -1
- package/dist/services/sandbox/run.d.ts +4 -4
- package/dist/services/sandbox/types.d.ts +8 -8
- package/dist/services/session/events.d.ts +2 -2
- package/dist/services/stats.d.ts +1 -1
- package/dist/services/stream/service.d.ts +2 -2
- package/dist/services/vector/service.d.ts +2 -2
- package/package.json +2 -2
- package/src/env.d.ts +6 -0
- package/src/services/aigateway/api-reference.ts +167 -0
- package/src/services/aigateway/index.ts +24 -0
- package/src/services/aigateway/service.ts +355 -0
- package/src/services/api-reference.ts +1 -0
- package/src/services/coder/client.ts +10 -0
- package/src/services/coder/skills.ts +19 -0
- package/src/services/coder/types.ts +51 -1
- package/src/services/config.ts +2 -0
- package/src/services/index.ts +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-reference.d.ts","sourceRoot":"","sources":["../../../src/services/aigateway/api-reference.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AA+BnD,QAAA,MAAM,OAAO,EAAE,OA8Hd,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AIGatewayChatCompletionParamsSchema, AIGatewayChatCompletionStreamParamsSchema, AIGatewayChatCompletionSchema, AIGatewayModelsResponseSchema, } from "./service.js";
|
|
3
|
+
const AIGatewayStreamCompletionSchema = z
|
|
4
|
+
.object({
|
|
5
|
+
choices: z
|
|
6
|
+
.array(z
|
|
7
|
+
.object({
|
|
8
|
+
delta: z
|
|
9
|
+
.object({
|
|
10
|
+
role: z
|
|
11
|
+
.string()
|
|
12
|
+
.optional()
|
|
13
|
+
.describe('Role for the streamed message delta.'),
|
|
14
|
+
content: z.string().optional().describe('Token or text delta.'),
|
|
15
|
+
})
|
|
16
|
+
.optional()
|
|
17
|
+
.describe('Incremental assistant message content.'),
|
|
18
|
+
finish_reason: z
|
|
19
|
+
.string()
|
|
20
|
+
.nullable()
|
|
21
|
+
.optional()
|
|
22
|
+
.describe('Reason the model stopped generating, when available.'),
|
|
23
|
+
})
|
|
24
|
+
.catchall(z.unknown()))
|
|
25
|
+
.describe('Streamed completion choices.'),
|
|
26
|
+
})
|
|
27
|
+
.catchall(z.unknown())
|
|
28
|
+
.describe('A single Server-Sent Events data frame for streamed completions.');
|
|
29
|
+
const service = {
|
|
30
|
+
name: 'AI Gateway',
|
|
31
|
+
slug: 'ai-gateway',
|
|
32
|
+
description: 'List supported LLM models and run routed AI Gateway completions',
|
|
33
|
+
host: 'aigateway',
|
|
34
|
+
hasPublicEndpoints: true,
|
|
35
|
+
endpoints: [
|
|
36
|
+
{
|
|
37
|
+
id: 'list-models',
|
|
38
|
+
title: 'List Models',
|
|
39
|
+
method: 'GET',
|
|
40
|
+
path: '/models',
|
|
41
|
+
description: 'List model metadata for LLM providers available through AI Gateway, grouped by provider.',
|
|
42
|
+
pathParams: [],
|
|
43
|
+
queryParams: [],
|
|
44
|
+
requestBody: null,
|
|
45
|
+
responseDescription: 'JSON response with provider keys mapped to arrays of supported model metadata under the `data` envelope.',
|
|
46
|
+
responseFields: { schema: AIGatewayModelsResponseSchema },
|
|
47
|
+
statuses: [
|
|
48
|
+
{ code: 200, description: 'Model catalog returned. Public — no auth required.' },
|
|
49
|
+
],
|
|
50
|
+
examplePath: '/models',
|
|
51
|
+
public: true,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: 'create-chat-completion',
|
|
55
|
+
title: 'Create Completion',
|
|
56
|
+
method: 'POST',
|
|
57
|
+
path: '/',
|
|
58
|
+
description: 'Create a completion through the AI Gateway auto-router. The gateway routes by model and request shape, so chat `messages` and legacy `prompt` payloads are both supported.',
|
|
59
|
+
pathParams: [],
|
|
60
|
+
queryParams: [],
|
|
61
|
+
requestBody: {
|
|
62
|
+
description: 'Completion request. Use `messages` for chat-compatible models and `prompt` for legacy OpenAI completions-compatible models. Additional provider-specific fields are passed through.',
|
|
63
|
+
fields: { schema: AIGatewayChatCompletionParamsSchema },
|
|
64
|
+
},
|
|
65
|
+
responseDescription: 'Provider-compatible completion response.',
|
|
66
|
+
responseHeaders: [
|
|
67
|
+
{
|
|
68
|
+
name: 'X-Gateway-Cost',
|
|
69
|
+
description: 'Estimated total gateway cost in USD, when billing metadata is available.',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'X-Gateway-Prompt-Tokens',
|
|
73
|
+
description: 'Prompt token count used for gateway billing.',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: 'X-Gateway-Completion-Tokens',
|
|
77
|
+
description: 'Completion token count used for gateway billing.',
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
responseFields: { schema: AIGatewayChatCompletionSchema, stripRequired: true },
|
|
81
|
+
statuses: [
|
|
82
|
+
{ code: 200, description: 'Completion created' },
|
|
83
|
+
{ code: 400, description: 'Invalid completion request' },
|
|
84
|
+
{ code: 401, description: 'Unauthorized — invalid or missing API key' },
|
|
85
|
+
{ code: 402, description: 'Payment required — upgrade to a paid plan' },
|
|
86
|
+
],
|
|
87
|
+
examplePath: '/',
|
|
88
|
+
exampleBody: {
|
|
89
|
+
model: 'openai/gpt-4o-mini',
|
|
90
|
+
messages: [{ role: 'user', content: 'Say hello in one sentence.' }],
|
|
91
|
+
max_tokens: 64,
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
id: 'stream-chat-completion',
|
|
96
|
+
title: 'Stream Completion',
|
|
97
|
+
method: 'POST',
|
|
98
|
+
path: '/',
|
|
99
|
+
description: 'Create a streaming completion through the AI Gateway auto-router. Set `stream: true` to receive Server-Sent Events token deltas.',
|
|
100
|
+
pathParams: [],
|
|
101
|
+
queryParams: [],
|
|
102
|
+
requestBody: {
|
|
103
|
+
description: 'Completion request with `stream` set to `true`.',
|
|
104
|
+
fields: {
|
|
105
|
+
schema: AIGatewayChatCompletionStreamParamsSchema,
|
|
106
|
+
overrides: { stream: { type: 'true' } },
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
responseDescription: 'Server-Sent Events stream. Each `data:` frame contains a provider-compatible delta payload. The stream ends with `data: [DONE]`.',
|
|
110
|
+
responseHeaders: [
|
|
111
|
+
{
|
|
112
|
+
name: 'Trailer',
|
|
113
|
+
description: 'Declares billing trailers such as `X-Gateway-Cost`, `X-Gateway-Prompt-Tokens`, and `X-Gateway-Completion-Tokens` for streamed responses.',
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: 'X-Gateway-Cost',
|
|
117
|
+
description: 'Estimated total gateway cost in USD. For streaming responses this may be delivered as an HTTP trailer after the body completes.',
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: 'X-Gateway-Prompt-Tokens',
|
|
121
|
+
description: 'Prompt token count used for gateway billing. For streaming responses this may be delivered as an HTTP trailer.',
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
name: 'X-Gateway-Completion-Tokens',
|
|
125
|
+
description: 'Completion token count used for gateway billing. For streaming responses this may be delivered as an HTTP trailer.',
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
responseFields: { schema: AIGatewayStreamCompletionSchema, stripRequired: true },
|
|
129
|
+
statuses: [
|
|
130
|
+
{ code: 200, description: 'Streaming completion started' },
|
|
131
|
+
{ code: 400, description: 'Invalid completion request' },
|
|
132
|
+
{ code: 401, description: 'Unauthorized — invalid or missing API key' },
|
|
133
|
+
{ code: 402, description: 'Payment required — upgrade to a paid plan' },
|
|
134
|
+
],
|
|
135
|
+
examplePath: '/',
|
|
136
|
+
exampleHeaders: { Accept: 'text/event-stream' },
|
|
137
|
+
exampleBody: {
|
|
138
|
+
model: 'openai/gpt-4o-mini',
|
|
139
|
+
messages: [{ role: 'user', content: 'Count to three.' }],
|
|
140
|
+
stream: true,
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
};
|
|
145
|
+
export default service;
|
|
146
|
+
//# sourceMappingURL=api-reference.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-reference.js","sourceRoot":"","sources":["../../../src/services/aigateway/api-reference.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACN,mCAAmC,EACnC,yCAAyC,EACzC,6BAA6B,EAC7B,6BAA6B,GAC7B,MAAM,cAAc,CAAC;AAGtB,MAAM,+BAA+B,GAAG,CAAC;KACvC,MAAM,CAAC;IACP,OAAO,EAAE,CAAC;SACR,KAAK,CACL,CAAC;SACC,MAAM,CAAC;QACP,KAAK,EAAE,CAAC;aACN,MAAM,CAAC;YACP,IAAI,EAAE,CAAC;iBACL,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CAAC,sCAAsC,CAAC;YAClD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC;SAC/D,CAAC;aACD,QAAQ,EAAE;aACV,QAAQ,CAAC,wCAAwC,CAAC;QACpD,aAAa,EAAE,CAAC;aACd,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,EAAE;aACV,QAAQ,CAAC,sDAAsD,CAAC;KAClE,CAAC;SACD,QAAQ,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CACvB;SACA,QAAQ,CAAC,8BAA8B,CAAC;CAC1C,CAAC;KACD,QAAQ,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;KACrB,QAAQ,CAAC,kEAAkE,CAAC,CAAC;AAE/E,MAAM,OAAO,GAAY;IACxB,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,iEAAiE;IAC9E,IAAI,EAAE,WAAW;IACjB,kBAAkB,EAAE,IAAI;IACxB,SAAS,EAAE;QACV;YACC,EAAE,EAAE,aAAa;YACjB,KAAK,EAAE,aAAa;YACpB,MAAM,EAAE,KA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AE,GAAG;YAChB,cAAc,EAAE,EAAE,MAAM,EAAE,mBAAmB,EAAE;YAC/C,WAAW,EAAE;gBACZ,KAAK,EAAE,oBAAoB;gBAC3B,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;gBACxD,MAAM,EAAE,IAAI;aACZ;SACD;KACD;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { AIGatewayChatCompletionParamsSchema, AIGatewayChatCompletionStreamParamsSchema, AIGatewayChatCompletionSchema, AIGatewayChatMessageSchema, AIGatewayModelProviderSchema, AIGatewayModelSchema, AIGatewayModelsResponseSchema, AIGatewayModelsSchema, AIGatewayPricingSchema, AIGatewayResponseMetadataSchema, AIGatewayService, type AIGatewayChatCompletion, type AIGatewayChatCompletionParams, type AIGatewayChatCompletionStreamParams, type AIGatewayChatMessage, type AIGatewayModel, type AIGatewayModelProvider, type AIGatewayModels, type AIGatewayModelsResponse, type AIGatewayPricing, type AIGatewayResponseMetadata, type AIGatewayStreamingCompletion, } from './service.ts';
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/aigateway/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,mCAAmC,EACnC,yCAAyC,EACzC,6BAA6B,EAC7B,0BAA0B,EAC1B,4BAA4B,EAC5B,oBAAoB,EACpB,6BAA6B,EAC7B,qBAAqB,EACrB,sBAAsB,EACtB,+BAA+B,EAC/B,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,6BAA6B,EAClC,KAAK,mCAAmC,EACxC,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAC9B,KAAK,4BAA4B,GACjC,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { AIGatewayChatCompletionParamsSchema, AIGatewayChatCompletionStreamParamsSchema, AIGatewayChatCompletionSchema, AIGatewayChatMessageSchema, AIGatewayModelProviderSchema, AIGatewayModelSchema, AIGatewayModelsResponseSchema, AIGatewayModelsSchema, AIGatewayPricingSchema, AIGatewayResponseMetadataSchema, AIGatewayService, } from "./service.js";
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/aigateway/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,mCAAmC,EACnC,yCAAyC,EACzC,6BAA6B,EAC7B,0BAA0B,EAC1B,4BAA4B,EAC5B,oBAAoB,EACpB,6BAA6B,EAC7B,qBAAqB,EACrB,sBAAsB,EACtB,+BAA+B,EAC/B,gBAAgB,GAYhB,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { FetchAdapter } from '../adapter.ts';
|
|
3
|
+
export declare const AIGatewayPricingSchema: z.ZodObject<{
|
|
4
|
+
input: z.ZodNumber;
|
|
5
|
+
output: z.ZodNumber;
|
|
6
|
+
cached_input: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
unit: z.ZodString;
|
|
8
|
+
currency: z.ZodString;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export type AIGatewayPricing = z.infer<typeof AIGatewayPricingSchema>;
|
|
11
|
+
export declare const AIGatewayModelProviderSchema: z.ZodObject<{
|
|
12
|
+
env: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
13
|
+
api: z.ZodOptional<z.ZodString>;
|
|
14
|
+
doc: z.ZodOptional<z.ZodString>;
|
|
15
|
+
logo_url: z.ZodOptional<z.ZodString>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export type AIGatewayModelProvider = z.infer<typeof AIGatewayModelProviderSchema>;
|
|
18
|
+
export declare const AIGatewayModelSchema: z.ZodObject<{
|
|
19
|
+
id: z.ZodString;
|
|
20
|
+
name: z.ZodString;
|
|
21
|
+
created: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
api: z.ZodOptional<z.ZodString>;
|
|
23
|
+
family: z.ZodOptional<z.ZodString>;
|
|
24
|
+
context_window: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
max_output_tokens: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
input_modalities: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
27
|
+
output_modalities: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
28
|
+
attachment: z.ZodOptional<z.ZodBoolean>;
|
|
29
|
+
reasoning: z.ZodOptional<z.ZodBoolean>;
|
|
30
|
+
tool_call: z.ZodOptional<z.ZodBoolean>;
|
|
31
|
+
temperature: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
+
knowledge: z.ZodOptional<z.ZodString>;
|
|
33
|
+
open_weights: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
+
provider: z.ZodOptional<z.ZodObject<{
|
|
35
|
+
env: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
36
|
+
api: z.ZodOptional<z.ZodString>;
|
|
37
|
+
doc: z.ZodOptional<z.ZodString>;
|
|
38
|
+
logo_url: z.ZodOptional<z.ZodString>;
|
|
39
|
+
}, z.core.$strip>>;
|
|
40
|
+
pricing: z.ZodOptional<z.ZodObject<{
|
|
41
|
+
input: z.ZodNumber;
|
|
42
|
+
output: z.ZodNumber;
|
|
43
|
+
cached_input: z.ZodOptional<z.ZodNumber>;
|
|
44
|
+
unit: z.ZodString;
|
|
45
|
+
currency: z.ZodString;
|
|
46
|
+
}, z.core.$strip>>;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
export type AIGatewayModel = z.infer<typeof AIGatewayModelSchema>;
|
|
49
|
+
export declare const AIGatewayModelsSchema: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
|
|
50
|
+
id: z.ZodString;
|
|
51
|
+
name: z.ZodString;
|
|
52
|
+
created: z.ZodOptional<z.ZodNumber>;
|
|
53
|
+
api: z.ZodOptional<z.ZodString>;
|
|
54
|
+
family: z.ZodOptional<z.ZodString>;
|
|
55
|
+
context_window: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
max_output_tokens: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
input_modalities: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
58
|
+
output_modalities: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
59
|
+
attachment: z.ZodOptional<z.ZodBoolean>;
|
|
60
|
+
reasoning: z.ZodOptional<z.ZodBoolean>;
|
|
61
|
+
tool_call: z.ZodOptional<z.ZodBoolean>;
|
|
62
|
+
temperature: z.ZodOptional<z.ZodBoolean>;
|
|
63
|
+
knowledge: z.ZodOptional<z.ZodString>;
|
|
64
|
+
open_weights: z.ZodOptional<z.ZodBoolean>;
|
|
65
|
+
provider: z.ZodOptional<z.ZodObject<{
|
|
66
|
+
env: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
67
|
+
api: z.ZodOptional<z.ZodString>;
|
|
68
|
+
doc: z.ZodOptional<z.ZodString>;
|
|
69
|
+
logo_url: z.ZodOptional<z.ZodString>;
|
|
70
|
+
}, z.core.$strip>>;
|
|
71
|
+
pricing: z.ZodOptional<z.ZodObject<{
|
|
72
|
+
input: z.ZodNumber;
|
|
73
|
+
output: z.ZodNumber;
|
|
74
|
+
cached_input: z.ZodOptional<z.ZodNumber>;
|
|
75
|
+
unit: z.ZodString;
|
|
76
|
+
currency: z.ZodString;
|
|
77
|
+
}, z.core.$strip>>;
|
|
78
|
+
}, z.core.$strip>>>;
|
|
79
|
+
export type AIGatewayModels = z.infer<typeof AIGatewayModelsSchema>;
|
|
80
|
+
export declare const AIGatewayModelsResponseSchema: z.ZodObject<{
|
|
81
|
+
success: z.ZodBoolean;
|
|
82
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
|
|
83
|
+
id: z.ZodString;
|
|
84
|
+
name: z.ZodString;
|
|
85
|
+
created: z.ZodOptional<z.ZodNumber>;
|
|
86
|
+
api: z.ZodOptional<z.ZodString>;
|
|
87
|
+
family: z.ZodOptional<z.ZodString>;
|
|
88
|
+
context_window: z.ZodOptional<z.ZodNumber>;
|
|
89
|
+
max_output_tokens: z.ZodOptional<z.ZodNumber>;
|
|
90
|
+
input_modalities: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
91
|
+
output_modalities: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
92
|
+
attachment: z.ZodOptional<z.ZodBoolean>;
|
|
93
|
+
reasoning: z.ZodOptional<z.ZodBoolean>;
|
|
94
|
+
tool_call: z.ZodOptional<z.ZodBoolean>;
|
|
95
|
+
temperature: z.ZodOptional<z.ZodBoolean>;
|
|
96
|
+
knowledge: z.ZodOptional<z.ZodString>;
|
|
97
|
+
open_weights: z.ZodOptional<z.ZodBoolean>;
|
|
98
|
+
provider: z.ZodOptional<z.ZodObject<{
|
|
99
|
+
env: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
100
|
+
api: z.ZodOptional<z.ZodString>;
|
|
101
|
+
doc: z.ZodOptional<z.ZodString>;
|
|
102
|
+
logo_url: z.ZodOptional<z.ZodString>;
|
|
103
|
+
}, z.core.$strip>>;
|
|
104
|
+
pricing: z.ZodOptional<z.ZodObject<{
|
|
105
|
+
input: z.ZodNumber;
|
|
106
|
+
output: z.ZodNumber;
|
|
107
|
+
cached_input: z.ZodOptional<z.ZodNumber>;
|
|
108
|
+
unit: z.ZodString;
|
|
109
|
+
currency: z.ZodString;
|
|
110
|
+
}, z.core.$strip>>;
|
|
111
|
+
}, z.core.$strip>>>>;
|
|
112
|
+
message: z.ZodOptional<z.ZodString>;
|
|
113
|
+
error: z.ZodOptional<z.ZodString>;
|
|
114
|
+
}, z.core.$strip>;
|
|
115
|
+
export type AIGatewayModelsResponse = z.infer<typeof AIGatewayModelsResponseSchema>;
|
|
116
|
+
export declare const AIGatewayChatMessageSchema: z.ZodObject<{
|
|
117
|
+
role: z.ZodEnum<{
|
|
118
|
+
system: "system";
|
|
119
|
+
developer: "developer";
|
|
120
|
+
user: "user";
|
|
121
|
+
assistant: "assistant";
|
|
122
|
+
tool: "tool";
|
|
123
|
+
}>;
|
|
124
|
+
content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodObject<{
|
|
125
|
+
type: z.ZodString;
|
|
126
|
+
}, z.core.$catchall<z.ZodUnknown>>>, z.ZodNull]>>;
|
|
127
|
+
name: z.ZodOptional<z.ZodString>;
|
|
128
|
+
tool_call_id: z.ZodOptional<z.ZodString>;
|
|
129
|
+
tool_calls: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
130
|
+
}, z.core.$strip>;
|
|
131
|
+
export type AIGatewayChatMessage = z.infer<typeof AIGatewayChatMessageSchema>;
|
|
132
|
+
export declare const AIGatewayChatCompletionParamsSchema: z.ZodObject<{
|
|
133
|
+
model: z.ZodString;
|
|
134
|
+
messages: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
135
|
+
role: z.ZodEnum<{
|
|
136
|
+
system: "system";
|
|
137
|
+
developer: "developer";
|
|
138
|
+
user: "user";
|
|
139
|
+
assistant: "assistant";
|
|
140
|
+
tool: "tool";
|
|
141
|
+
}>;
|
|
142
|
+
content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodObject<{
|
|
143
|
+
type: z.ZodString;
|
|
144
|
+
}, z.core.$catchall<z.ZodUnknown>>>, z.ZodNull]>>;
|
|
145
|
+
name: z.ZodOptional<z.ZodString>;
|
|
146
|
+
tool_call_id: z.ZodOptional<z.ZodString>;
|
|
147
|
+
tool_calls: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
148
|
+
}, z.core.$strip>>>;
|
|
149
|
+
prompt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
150
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
151
|
+
top_p: z.ZodOptional<z.ZodNumber>;
|
|
152
|
+
max_tokens: z.ZodOptional<z.ZodNumber>;
|
|
153
|
+
stream: z.ZodOptional<z.ZodBoolean>;
|
|
154
|
+
stop: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
155
|
+
}, z.core.$catchall<z.ZodUnknown>>;
|
|
156
|
+
export type AIGatewayChatCompletionParams = z.infer<typeof AIGatewayChatCompletionParamsSchema>;
|
|
157
|
+
export declare const AIGatewayChatCompletionStreamParamsSchema: z.ZodObject<{
|
|
158
|
+
model: z.ZodString;
|
|
159
|
+
messages: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
160
|
+
role: z.ZodEnum<{
|
|
161
|
+
system: "system";
|
|
162
|
+
developer: "developer";
|
|
163
|
+
user: "user";
|
|
164
|
+
assistant: "assistant";
|
|
165
|
+
tool: "tool";
|
|
166
|
+
}>;
|
|
167
|
+
content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodObject<{
|
|
168
|
+
type: z.ZodString;
|
|
169
|
+
}, z.core.$catchall<z.ZodUnknown>>>, z.ZodNull]>>;
|
|
170
|
+
name: z.ZodOptional<z.ZodString>;
|
|
171
|
+
tool_call_id: z.ZodOptional<z.ZodString>;
|
|
172
|
+
tool_calls: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
173
|
+
}, z.core.$strip>>>;
|
|
174
|
+
prompt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
175
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
176
|
+
top_p: z.ZodOptional<z.ZodNumber>;
|
|
177
|
+
max_tokens: z.ZodOptional<z.ZodNumber>;
|
|
178
|
+
stop: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
179
|
+
stream: z.ZodLiteral<true>;
|
|
180
|
+
}, z.core.$catchall<z.ZodUnknown>>;
|
|
181
|
+
export type AIGatewayChatCompletionStreamParams = z.infer<typeof AIGatewayChatCompletionStreamParamsSchema>;
|
|
182
|
+
export declare const AIGatewayChatCompletionSchema: z.ZodObject<{
|
|
183
|
+
id: z.ZodOptional<z.ZodString>;
|
|
184
|
+
object: z.ZodOptional<z.ZodString>;
|
|
185
|
+
created: z.ZodOptional<z.ZodNumber>;
|
|
186
|
+
model: z.ZodOptional<z.ZodString>;
|
|
187
|
+
choices: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
188
|
+
usage: z.ZodOptional<z.ZodUnknown>;
|
|
189
|
+
agentuity: z.ZodOptional<z.ZodObject<{
|
|
190
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
191
|
+
cost: z.ZodOptional<z.ZodObject<{
|
|
192
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
193
|
+
promptTokens: z.ZodOptional<z.ZodNumber>;
|
|
194
|
+
completionTokens: z.ZodOptional<z.ZodNumber>;
|
|
195
|
+
}, z.core.$strip>>;
|
|
196
|
+
}, z.core.$strip>>;
|
|
197
|
+
}, z.core.$catchall<z.ZodUnknown>>;
|
|
198
|
+
export type AIGatewayChatCompletion = z.infer<typeof AIGatewayChatCompletionSchema>;
|
|
199
|
+
export declare const AIGatewayResponseMetadataSchema: z.ZodObject<{
|
|
200
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
201
|
+
cost: z.ZodOptional<z.ZodObject<{
|
|
202
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
203
|
+
promptTokens: z.ZodOptional<z.ZodNumber>;
|
|
204
|
+
completionTokens: z.ZodOptional<z.ZodNumber>;
|
|
205
|
+
}, z.core.$strip>>;
|
|
206
|
+
}, z.core.$strip>;
|
|
207
|
+
export type AIGatewayResponseMetadata = z.infer<typeof AIGatewayResponseMetadataSchema>;
|
|
208
|
+
export type AIGatewayStreamingCompletion = {
|
|
209
|
+
stream: ReadableStream<Uint8Array>;
|
|
210
|
+
metadata: Promise<AIGatewayResponseMetadata>;
|
|
211
|
+
};
|
|
212
|
+
export declare class AIGatewayService {
|
|
213
|
+
readonly baseUrl: string;
|
|
214
|
+
readonly adapter: FetchAdapter;
|
|
215
|
+
constructor(baseUrl: string, adapter: FetchAdapter);
|
|
216
|
+
listModels(): Promise<AIGatewayModels>;
|
|
217
|
+
complete(params: AIGatewayChatCompletionParams): Promise<AIGatewayChatCompletion>;
|
|
218
|
+
streamComplete(params: AIGatewayChatCompletionParams): Promise<ReadableStream<Uint8Array>>;
|
|
219
|
+
streamCompleteWithMetadata(params: AIGatewayChatCompletionParams): Promise<AIGatewayStreamingCompletion>;
|
|
220
|
+
}
|
|
221
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/services/aigateway/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAQ7C,eAAO,MAAM,sBAAsB;;;;;;iBAMjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,4BAA4B;;;;;iBAKvC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkB/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAA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