@dremio/js-sdk 0.38.0 → 0.39.1
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/cloud/ai/AIResource.d.ts +17 -2
- package/dist/cloud/ai/AIResource.js +21 -23
- package/dist/cloud/ai/AIResource.js.map +1 -1
- package/dist/cloud/ai/modelProviderCodec.d.ts +35 -25
- package/dist/cloud/ai/modelProviderCodec.js +1 -1
- package/dist/cloud/ai/modelProviderCodec.js.map +1 -1
- package/dist/cloud/projects/Project.d.ts +6 -0
- package/dist/cloud/projects/Project.js +64 -0
- package/dist/cloud/projects/Project.js.map +1 -1
- package/dist/enterprise/ai/AIResource.d.ts +10 -13
- package/dist/enterprise/ai/AIResource.js +5 -35
- package/dist/enterprise/ai/AIResource.js.map +1 -1
- package/dist/enterprise/ai/ModelProvider.d.ts +34 -24
- package/dist/enterprise/ai/chat/AgentChatPartialResponse.d.ts +6 -6
- package/dist/enterprise/ai/chat/AgentChatResponse.js +4 -2
- package/dist/enterprise/ai/chat/AgentChatResponse.js.map +1 -1
- package/dist/enterprise/ai/chat/ChatSession.d.ts +18 -9
- package/dist/enterprise/ai/chat/ChatSession.js +18 -4
- package/dist/enterprise/ai/chat/ChatSession.js.map +1 -1
- package/dist/enterprise/ai/chat/chatEventSchema.d.ts +18 -0
- package/dist/enterprise/ai/chat/chatEventSchema.js +32 -11
- package/dist/enterprise/ai/chat/chatEventSchema.js.map +1 -1
- package/dist/enterprise/ai/chat/methods/sendChatMessage.d.ts +10 -0
- package/dist/enterprise/ai/chat/methods/sendChatMessage.js +59 -0
- package/dist/enterprise/ai/chat/methods/sendChatMessage.js.map +1 -0
- package/dist/enterprise/ai/modelProviderCodec.d.ts +100 -70
- package/dist/enterprise/ai/modelProviderConfigSchemas.d.ts +60 -45
- package/dist/enterprise/ai/modelProviderConfigSchemas.js +27 -25
- package/dist/enterprise/ai/modelProviderConfigSchemas.js.map +1 -1
- package/dist/enterprise/grants/Grant.d.ts +6 -6
- package/dist/enterprise/grants/Grant.js.map +1 -1
- package/dist/enterprise/grants/GrantsResource.d.ts +1 -1
- package/dist/enterprise/grants/createRetrieveGrants.d.ts +1 -1
- package/dist/enterprise/users/EnterpriseUser.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ChatSession } from "../../enterprise/ai/chat/ChatSession.ts";
|
|
2
2
|
import type { UserChatMessage } from "../../enterprise/ai/chat/UserChatMessage.ts";
|
|
3
|
-
import { AgentChatResponse } from "../../enterprise/ai/chat/AgentChatResponse.ts";
|
|
4
3
|
import type { Logger, SonarV4Config, V4Config } from "../../common/Config.ts";
|
|
5
4
|
import { ModelProvider } from "../../enterprise/ai/ModelProvider.ts";
|
|
6
5
|
import * as z from "zod/mini";
|
|
@@ -8,6 +7,10 @@ import { modelProviderCreateCodec } from "./modelProviderCodec.js";
|
|
|
8
7
|
import { DremioModelProvider } from "./DremioModelProvider.ts";
|
|
9
8
|
import { listAvailableModels } from "../../enterprise/ai/AIResource.ts";
|
|
10
9
|
import type { SignalParam } from "../../common/Params.ts";
|
|
10
|
+
import type { AgentChatResponse, AgentResponseContent } from "../../enterprise/ai/chat/AgentChatResponse.ts";
|
|
11
|
+
import { type Observable } from "rxjs";
|
|
12
|
+
import { AgentChatExchange } from "../../enterprise/ai/chat/eventWrappers/AgentChatExchange.ts";
|
|
13
|
+
import { ChatSessionClient } from "../../enterprise/ai/chat/ChatSessionClient.ts";
|
|
11
14
|
export declare class AIResource {
|
|
12
15
|
#private;
|
|
13
16
|
constructor(config: Logger & V4Config & SonarV4Config);
|
|
@@ -47,6 +50,7 @@ export declare class AIResource {
|
|
|
47
50
|
} | {
|
|
48
51
|
openAi: {
|
|
49
52
|
organizationId: string;
|
|
53
|
+
region: "GLOBAL" | "US" | "EU";
|
|
50
54
|
};
|
|
51
55
|
};
|
|
52
56
|
defaultModelName: string;
|
|
@@ -102,6 +106,7 @@ export declare class AIResource {
|
|
|
102
106
|
} | {
|
|
103
107
|
openAi: {
|
|
104
108
|
organizationId: string;
|
|
109
|
+
region: "GLOBAL" | "US" | "EU";
|
|
105
110
|
};
|
|
106
111
|
};
|
|
107
112
|
defaultModelName: string;
|
|
@@ -157,6 +162,7 @@ export declare class AIResource {
|
|
|
157
162
|
} | {
|
|
158
163
|
openAi: {
|
|
159
164
|
organizationId: string;
|
|
165
|
+
region: "GLOBAL" | "US" | "EU";
|
|
160
166
|
};
|
|
161
167
|
};
|
|
162
168
|
defaultModelName: string;
|
|
@@ -214,6 +220,7 @@ export declare class AIResource {
|
|
|
214
220
|
} | {
|
|
215
221
|
openAi: {
|
|
216
222
|
organizationId: string;
|
|
223
|
+
region: "GLOBAL" | "US" | "EU";
|
|
217
224
|
};
|
|
218
225
|
};
|
|
219
226
|
defaultModelName: string;
|
|
@@ -236,5 +243,13 @@ export declare class AIResource {
|
|
|
236
243
|
* Sends a chat message to the Dremio AI Agent and returns an Observable containing
|
|
237
244
|
* Agent replies.
|
|
238
245
|
*/
|
|
239
|
-
sendChatMessage(chatSession: ChatSession
|
|
246
|
+
sendChatMessage(chatSession: ChatSession, userChatMessage: UserChatMessage): Observable<import("ts-results-es").Ok<AgentChatResponse<AgentResponseContent>> | import("ts-results-es").Err<import("../index.ts").HttpError | import("../index.ts").Problem<"https://api.dremio.dev/problems/ai-agent/chat/agent-disabled" | "https://api.dremio.dev/problems/ai-agent/chat/input-too-large" | "https://api.dremio.dev/problems/ai-agent/chat/model-provider-not-found" | "https://api.dremio.dev/problems/ai-agent/chat/no-default-model-provider" | "https://api.dremio.dev/problems/ai-agent/chat/no-model-provider-privilege" | "https://api.dremio.dev/problems/ai-agent/chat/preview-disabled" | "https://api.dremio.dev/problems/ai-agent/chat/rate-limit-exceeded", undefined>>>;
|
|
247
|
+
/**
|
|
248
|
+
* Creates an Observable that emits each time the `AgentChatExchange` is updated
|
|
249
|
+
* with events from the Agent.
|
|
250
|
+
*/
|
|
251
|
+
createAgentChatExchange$<T extends AgentResponseContent>(chatSession: ChatSession, userChatMessage: UserChatMessage, options?: {
|
|
252
|
+
mapChatEvents?: (v: AgentChatResponse<AgentResponseContent>) => Observable<AgentChatResponse<T>>;
|
|
253
|
+
}): Observable<AgentChatExchange>;
|
|
254
|
+
createChatSessionClient(chatSession: ChatSession): ChatSessionClient;
|
|
240
255
|
}
|
|
@@ -13,10 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { map } from "rxjs";
|
|
17
16
|
import { ChatSession } from "../../enterprise/ai/chat/ChatSession.js";
|
|
18
|
-
import { AgentChatResponse } from "../../enterprise/ai/chat/AgentChatResponse.js";
|
|
19
|
-
import { fromTextEventStream } from "../../common/fromTextEventStream.js";
|
|
20
17
|
import { ModelProvider } from "../../enterprise/ai/ModelProvider.js";
|
|
21
18
|
import * as z from "zod/mini";
|
|
22
19
|
import { dremioProvidedSchema, modelProviderCreateCodec, modelProviderRetrieveCodec, safeDecodeModelProvider, } from "./modelProviderCodec.js";
|
|
@@ -24,6 +21,11 @@ import { modelProviderRetrieveCodec as baseModelProviderRetrieveCodec } from "..
|
|
|
24
21
|
import { DremioModelProvider } from "./DremioModelProvider.js";
|
|
25
22
|
import { safeParseResultToResult } from "../../common/safeParseResultToResult.js";
|
|
26
23
|
import { listAvailableModels } from "../../enterprise/ai/AIResource.js";
|
|
24
|
+
import { createSendChatMessage } from "../../enterprise/ai/chat/methods/sendChatMessage.js";
|
|
25
|
+
import { catchError, concatMap, endWith, map, of, scan, share, startWith, } from "rxjs";
|
|
26
|
+
import { AgentEndTurn } from "../../enterprise/ai/chat/eventWrappers/AgentEndTurn.js";
|
|
27
|
+
import { AgentChatExchange } from "../../enterprise/ai/chat/eventWrappers/AgentChatExchange.js";
|
|
28
|
+
import { ChatSessionClient } from "../../enterprise/ai/chat/ChatSessionClient.js";
|
|
27
29
|
export class AIResource {
|
|
28
30
|
#config;
|
|
29
31
|
constructor(config) {
|
|
@@ -87,26 +89,22 @@ export class AIResource {
|
|
|
87
89
|
* Sends a chat message to the Dremio AI Agent and returns an Observable containing
|
|
88
90
|
* Agent replies.
|
|
89
91
|
*/
|
|
90
|
-
sendChatMessage(chatSession) {
|
|
91
|
-
return (
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
.
|
|
105
|
-
|
|
106
|
-
throw result.error;
|
|
107
|
-
}
|
|
108
|
-
return result.value;
|
|
109
|
-
})).pipe(map((event) => AgentChatResponse.fromJSON(JSON.parse(event.data))));
|
|
92
|
+
sendChatMessage(chatSession, userChatMessage) {
|
|
93
|
+
return createSendChatMessage(this.#config)(chatSession, userChatMessage);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Creates an Observable that emits each time the `AgentChatExchange` is updated
|
|
97
|
+
* with events from the Agent.
|
|
98
|
+
*/
|
|
99
|
+
createAgentChatExchange$(chatSession, userChatMessage, options = {}) {
|
|
100
|
+
const initialAgentChatExchange = new AgentChatExchange(userChatMessage, []);
|
|
101
|
+
return this.sendChatMessage(chatSession, userChatMessage).pipe(map((eventResult) => eventResult.unwrap()), concatMap((agentChatEvent) => options.mapChatEvents?.(agentChatEvent) || of(agentChatEvent)), endWith(new AgentEndTurn({ type: "reply_finished" })), catchError((error) => of(new AgentEndTurn({ error, type: "error" }))), scan((agentChatExchange, agentChatEvent) => agentChatExchange._addChatEvent(agentChatEvent), initialAgentChatExchange), startWith(initialAgentChatExchange), share());
|
|
102
|
+
}
|
|
103
|
+
createChatSessionClient(chatSession) {
|
|
104
|
+
return new ChatSessionClient({
|
|
105
|
+
chatSession,
|
|
106
|
+
createAgentChatExchange$: this.createAgentChatExchange$.bind(this),
|
|
107
|
+
});
|
|
110
108
|
}
|
|
111
109
|
}
|
|
112
110
|
//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B,CAAC;YACD,OAAO,MAAM,CAAC,KAAK,CAAC;QACtB,CAAC,CAAC,CACL,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,iBAAiB,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/E,CAAC;CACF","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { map } from \"rxjs\";\nimport { ChatSession } from \"../../enterprise/ai/chat/ChatSession.ts\";\nimport type { UserChatMessage } from \"../../enterprise/ai/chat/UserChatMessage.ts\";\nimport { AgentChatResponse } from \"../../enterprise/ai/chat/AgentChatResponse.ts\";\nimport type { Logger, SonarV4Config, V4Config } from \"../../common/Config.ts\";\nimport { fromTextEventStream } from \"../../common/fromTextEventStream.ts\";\nimport { ModelProvider } from \"../../enterprise/ai/ModelProvider.ts\";\nimport * as z from \"zod/mini\";\nimport {\n dremioProvidedSchema,\n modelProviderCreateCodec,\n modelProviderRetrieveCodec,\n safeDecodeModelProvider,\n type SafeDecodeResultWithoutDremioLLM,\n} from \"./modelProviderCodec.js\";\nimport { modelProviderRetrieveCodec as baseModelProviderRetrieveCodec } from \"../../enterprise/ai/modelProviderCodec.ts\";\nimport { DremioModelProvider } from \"./DremioModelProvider.ts\";\nimport { safeParseResultToResult } from \"../../common/safeParseResultToResult.ts\";\nimport { listAvailableModels } from \"../../enterprise/ai/AIResource.ts\";\nimport type { SignalParam } from \"../../common/Params.ts\";\n\nexport class AIResource {\n #config: Logger & V4Config & SonarV4Config;\n\n constructor(config: Logger & V4Config & SonarV4Config) {\n this.#config = config;\n }\n\n createModelProvider(properties: z.output<typeof modelProviderCreateCodec>) {\n const body = z.encode(modelProviderCreateCodec, properties);\n return this.#config\n .v4Request(`model-provider/config`, {\n body: JSON.stringify(body),\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n keepalive: true,\n method: \"POST\",\n })\n .map((res) => res.json() as Promise<z.input<typeof modelProviderRetrieveCodec>>)\n .andThen(\n (entity) =>\n safeDecodeModelProvider(this.#config, entity) as SafeDecodeResultWithoutDremioLLM,\n );\n }\n\n listModelProviders() {\n const getPage = ({ signal }: SignalParam = {}) => {\n return this.#config\n .v4Request(\"model-provider/config\", {\n headers: {\n Accept: \"application/json\",\n },\n signal,\n })\n .map(\n (res) => res.json() as Promise<{ configs: z.input<typeof modelProviderRetrieveCodec>[] }>,\n )\n .map((response) => ({\n data: response.configs.map((entity) =>\n safeParseResultToResult(z.safeDecode(modelProviderRetrieveCodec, entity)).map(\n (properties) => {\n if (\"dremioProvided\" in properties.config) {\n return new DremioModelProvider(\n this.#config,\n properties as z.infer<typeof dremioProvidedSchema>,\n );\n }\n return new ModelProvider(\n this.#config,\n properties as z.output<typeof baseModelProviderRetrieveCodec>,\n );\n },\n ),\n ),\n }));\n };\n return {\n async *data({ signal }: SignalParam = {}) {\n yield* (await getPage({ signal }).promise).map((response) => response.data).unwrap();\n },\n getPage,\n };\n }\n\n listAvailableModels(...args: Parameters<ReturnType<typeof listAvailableModels>>) {\n return listAvailableModels(this.#config)(...args);\n }\n\n retrieveModelProvider(id: string) {\n return this.#config\n .v4Request(`model-provider/config/${id}`, {\n headers: {\n Accept: \"application/json\",\n },\n })\n .map((res) => res.json() as Promise<z.input<typeof modelProviderRetrieveCodec>>)\n .andThen((entity) => safeDecodeModelProvider(this.#config, entity));\n }\n\n /**\n * Sends a chat message to the Dremio AI Agent and returns an Observable containing\n * Agent replies.\n */\n sendChatMessage(chatSession: ChatSession) {\n return (chatMessage: UserChatMessage) =>\n fromTextEventStream(({ signal }) =>\n this.#config\n .sonarV4Request(\"agent\", {\n body: JSON.stringify({\n message: chatMessage.toString(),\n sessionId: chatSession.sessionId,\n } satisfies {\n message: string;\n modelProviderId?: string;\n sessionId?: string;\n }),\n headers: {\n Accept: \"text/event-stream\",\n \"Content-Type\": \"application/json\",\n },\n method: \"POST\",\n signal,\n })\n .promise.then((result) => {\n if (result.isErr()) {\n throw result.error;\n }\n return result.value;\n }),\n ).pipe(map((event) => AgentChatResponse.fromJSON(JSON.parse(event.data))));\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"AIResource.js","sourceRoot":"","sources":["../../../src/cloud/ai/AIResource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAGtE,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAC9B,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EACxB,0BAA0B,EAC1B,uBAAuB,GAExB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,0BAA0B,IAAI,8BAA8B,EAAE,MAAM,2CAA2C,CAAC;AACzH,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAExE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AAK5F,OAAO,EACL,UAAU,EACV,SAAS,EACT,OAAO,EACP,GAAG,EACH,EAAE,EACF,IAAI,EACJ,KAAK,EACL,SAAS,GAEV,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,YAAY,EAAE,MAAM,wDAAwD,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAA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CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;IAC3E,CAAC;IAED;;;OAGG;IACH,wBAAwB,CACtB,WAAwB,EACxB,eAAgC,EAChC,UAII,EAAE;QAEN,MAAM,wBAAwB,GAAG,IAAI,iBAAiB,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;QAE5E,OAAO,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC,IAAI,CAC5D,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,EAC1C,SAAS,CAAC,CAAC,cAAc,EAAE,EAAE,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,cAAc,CAAC,CAAC,EAC5F,OAAO,CAAC,IAAI,YAAY,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC,CAAC,EACrD,UAAU,CAAC,CAAC,KAAc,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,YAAY,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAC9E,IAAI,CACF,CAAC,iBAAiB,EAAE,cAAc,EAAE,EAAE,CAAC,iBAAiB,CAAC,aAAa,CAAC,cAAc,CAAC,EACtF,wBAAwB,CACzB,EACD,SAAS,CAAC,wBAAwB,CAAC,EACnC,KAAK,EAAE,CACR,CAAC;IACJ,CAAC;IAED,uBAAuB,CAAC,WAAwB;QAC9C,OAAO,IAAI,iBAAiB,CAAC;YAC3B,WAAW;YACX,wBAAwB,EAAE,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAC;SACnE,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ChatSession } from \"../../enterprise/ai/chat/ChatSession.ts\";\nimport type { UserChatMessage } from \"../../enterprise/ai/chat/UserChatMessage.ts\";\nimport type { Logger, SonarV4Config, V4Config } from \"../../common/Config.ts\";\nimport { ModelProvider } from \"../../enterprise/ai/ModelProvider.ts\";\nimport * as z from \"zod/mini\";\nimport {\n dremioProvidedSchema,\n modelProviderCreateCodec,\n modelProviderRetrieveCodec,\n safeDecodeModelProvider,\n type SafeDecodeResultWithoutDremioLLM,\n} from \"./modelProviderCodec.js\";\nimport { modelProviderRetrieveCodec as baseModelProviderRetrieveCodec } from \"../../enterprise/ai/modelProviderCodec.ts\";\nimport { DremioModelProvider } from \"./DremioModelProvider.ts\";\nimport { safeParseResultToResult } from \"../../common/safeParseResultToResult.ts\";\nimport { listAvailableModels } from \"../../enterprise/ai/AIResource.ts\";\nimport type { SignalParam } from \"../../common/Params.ts\";\nimport { createSendChatMessage } from \"../../enterprise/ai/chat/methods/sendChatMessage.ts\";\nimport type {\n AgentChatResponse,\n AgentResponseContent,\n} from \"../../enterprise/ai/chat/AgentChatResponse.ts\";\nimport {\n catchError,\n concatMap,\n endWith,\n map,\n of,\n scan,\n share,\n startWith,\n type Observable,\n} from \"rxjs\";\nimport { AgentEndTurn } from \"../../enterprise/ai/chat/eventWrappers/AgentEndTurn.ts\";\nimport { AgentChatExchange } from \"../../enterprise/ai/chat/eventWrappers/AgentChatExchange.ts\";\nimport { ChatSessionClient } from \"../../enterprise/ai/chat/ChatSessionClient.ts\";\n\nexport class AIResource {\n #config: Logger & V4Config & SonarV4Config;\n\n constructor(config: Logger & V4Config & SonarV4Config) {\n this.#config = config;\n }\n\n createModelProvider(properties: z.output<typeof modelProviderCreateCodec>) {\n const body = z.encode(modelProviderCreateCodec, properties);\n return this.#config\n .v4Request(`model-provider/config`, {\n body: JSON.stringify(body),\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n keepalive: true,\n method: \"POST\",\n })\n .map((res) => res.json() as Promise<z.input<typeof modelProviderRetrieveCodec>>)\n .andThen(\n (entity) =>\n safeDecodeModelProvider(this.#config, entity) as SafeDecodeResultWithoutDremioLLM,\n );\n }\n\n listModelProviders() {\n const getPage = ({ signal }: SignalParam = {}) => {\n return this.#config\n .v4Request(\"model-provider/config\", {\n headers: {\n Accept: \"application/json\",\n },\n signal,\n })\n .map(\n (res) => res.json() as Promise<{ configs: z.input<typeof modelProviderRetrieveCodec>[] }>,\n )\n .map((response) => ({\n data: response.configs.map((entity) =>\n safeParseResultToResult(z.safeDecode(modelProviderRetrieveCodec, entity)).map(\n (properties) => {\n if (\"dremioProvided\" in properties.config) {\n return new DremioModelProvider(\n this.#config,\n properties as z.infer<typeof dremioProvidedSchema>,\n );\n }\n return new ModelProvider(\n this.#config,\n properties as z.output<typeof baseModelProviderRetrieveCodec>,\n );\n },\n ),\n ),\n }));\n };\n return {\n async *data({ signal }: SignalParam = {}) {\n yield* (await getPage({ signal }).promise).map((response) => response.data).unwrap();\n },\n getPage,\n };\n }\n\n listAvailableModels(...args: Parameters<ReturnType<typeof listAvailableModels>>) {\n return listAvailableModels(this.#config)(...args);\n }\n\n retrieveModelProvider(id: string) {\n return this.#config\n .v4Request(`model-provider/config/${id}`, {\n headers: {\n Accept: \"application/json\",\n },\n })\n .map((res) => res.json() as Promise<z.input<typeof modelProviderRetrieveCodec>>)\n .andThen((entity) => safeDecodeModelProvider(this.#config, entity));\n }\n\n /**\n * Sends a chat message to the Dremio AI Agent and returns an Observable containing\n * Agent replies.\n */\n sendChatMessage(chatSession: ChatSession, userChatMessage: UserChatMessage) {\n return createSendChatMessage(this.#config)(chatSession, userChatMessage);\n }\n\n /**\n * Creates an Observable that emits each time the `AgentChatExchange` is updated\n * with events from the Agent.\n */\n createAgentChatExchange$<T extends AgentResponseContent>(\n chatSession: ChatSession,\n userChatMessage: UserChatMessage,\n options: {\n mapChatEvents?: (\n v: AgentChatResponse<AgentResponseContent>,\n ) => Observable<AgentChatResponse<T>>;\n } = {},\n ) {\n const initialAgentChatExchange = new AgentChatExchange(userChatMessage, []);\n\n return this.sendChatMessage(chatSession, userChatMessage).pipe(\n map((eventResult) => eventResult.unwrap()),\n concatMap((agentChatEvent) => options.mapChatEvents?.(agentChatEvent) || of(agentChatEvent)),\n endWith(new AgentEndTurn({ type: \"reply_finished\" })),\n catchError((error: unknown) => of(new AgentEndTurn({ error, type: \"error\" }))),\n scan(\n (agentChatExchange, agentChatEvent) => agentChatExchange._addChatEvent(agentChatEvent),\n initialAgentChatExchange,\n ),\n startWith(initialAgentChatExchange),\n share(),\n );\n }\n\n createChatSessionClient(chatSession: ChatSession) {\n return new ChatSessionClient({\n chatSession,\n createAgentChatExchange$: this.createAgentChatExchange$.bind(this),\n });\n }\n}\n"]}
|
|
@@ -8,7 +8,7 @@ export { modelProviderCreateCodec, modelProviderUpdateCodec };
|
|
|
8
8
|
export declare const dremioProvidedSchema: z.ZodMiniObject<{
|
|
9
9
|
config: z.ZodMiniObject<{
|
|
10
10
|
dremioProvided: z.ZodMiniObject<Record<never, z.core.SomeType>, z.core.$strip>;
|
|
11
|
-
}, z.core.$
|
|
11
|
+
}, z.core.$strip>;
|
|
12
12
|
defaultModelName: z.ZodMiniString<string>;
|
|
13
13
|
id: z.ZodMiniString<string>;
|
|
14
14
|
isDefault: z.ZodMiniBoolean<boolean>;
|
|
@@ -32,37 +32,42 @@ export declare const modelProviderRetrieveCodec: z.ZodMiniCodec<z.ZodMiniUnion<r
|
|
|
32
32
|
auth: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
33
33
|
accessKey: z.ZodMiniObject<{
|
|
34
34
|
accessKeyId: z.ZodMiniString<string>;
|
|
35
|
-
}, z.core.$
|
|
36
|
-
}, z.core.$
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
37
37
|
role: z.ZodMiniObject<{
|
|
38
38
|
roleArn: z.ZodMiniString<string>;
|
|
39
|
-
}, z.core.$
|
|
40
|
-
}, z.core.$
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
}, z.core.$strip>]>;
|
|
41
41
|
region: z.ZodMiniString<string>;
|
|
42
|
-
}, z.core.$
|
|
42
|
+
}, z.core.$strip>;
|
|
43
43
|
}, z.core.$strict>, z.ZodMiniObject<{
|
|
44
|
-
anthropic: z.ZodMiniObject<{}, z.core.$
|
|
44
|
+
anthropic: z.ZodMiniObject<{}, z.core.$strip>;
|
|
45
45
|
}, z.core.$strict>, z.ZodMiniObject<{
|
|
46
46
|
azureOpenAi: z.ZodMiniObject<{
|
|
47
47
|
auth: z.ZodMiniObject<{
|
|
48
48
|
clientSecretAuth: z.ZodMiniObject<{
|
|
49
49
|
azureClientId: z.ZodMiniString<string>;
|
|
50
50
|
azureTenantId: z.ZodMiniString<string>;
|
|
51
|
-
}, z.core.$
|
|
52
|
-
}, z.core.$
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
53
|
resourceName: z.ZodMiniString<string>;
|
|
54
|
-
}, z.core.$
|
|
54
|
+
}, z.core.$strip>;
|
|
55
55
|
}, z.core.$strict>, z.ZodMiniObject<{
|
|
56
|
-
googleGemini: z.ZodMiniObject<{}, z.core.$
|
|
56
|
+
googleGemini: z.ZodMiniObject<{}, z.core.$strip>;
|
|
57
57
|
}, z.core.$strict>, z.ZodMiniObject<{
|
|
58
58
|
openAi: z.ZodMiniObject<{
|
|
59
59
|
organizationId: z.ZodMiniString<string>;
|
|
60
|
-
|
|
60
|
+
region: z.ZodMiniEnum<{
|
|
61
|
+
GLOBAL: "GLOBAL";
|
|
62
|
+
US: "US";
|
|
63
|
+
EU: "EU";
|
|
64
|
+
}>;
|
|
65
|
+
}, z.core.$strip>;
|
|
61
66
|
}, z.core.$strict>]>;
|
|
62
67
|
}, z.core.$strip>, z.ZodMiniObject<{
|
|
63
68
|
config: z.ZodMiniObject<{
|
|
64
69
|
dremioProvided: z.ZodMiniObject<Record<never, z.core.SomeType>, z.core.$strip>;
|
|
65
|
-
}, z.core.$
|
|
70
|
+
}, z.core.$strip>;
|
|
66
71
|
defaultModelName: z.ZodMiniString<string>;
|
|
67
72
|
id: z.ZodMiniString<string>;
|
|
68
73
|
isDefault: z.ZodMiniBoolean<boolean>;
|
|
@@ -80,32 +85,37 @@ export declare const modelProviderRetrieveCodec: z.ZodMiniCodec<z.ZodMiniUnion<r
|
|
|
80
85
|
auth: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
81
86
|
accessKey: z.ZodMiniObject<{
|
|
82
87
|
accessKeyId: z.ZodMiniString<string>;
|
|
83
|
-
}, z.core.$
|
|
84
|
-
}, z.core.$
|
|
88
|
+
}, z.core.$strip>;
|
|
89
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
85
90
|
role: z.ZodMiniObject<{
|
|
86
91
|
roleArn: z.ZodMiniString<string>;
|
|
87
|
-
}, z.core.$
|
|
88
|
-
}, z.core.$
|
|
92
|
+
}, z.core.$strip>;
|
|
93
|
+
}, z.core.$strip>]>;
|
|
89
94
|
region: z.ZodMiniString<string>;
|
|
90
|
-
}, z.core.$
|
|
95
|
+
}, z.core.$strip>;
|
|
91
96
|
}, z.core.$strict>, z.ZodMiniObject<{
|
|
92
|
-
anthropic: z.ZodMiniObject<{}, z.core.$
|
|
97
|
+
anthropic: z.ZodMiniObject<{}, z.core.$strip>;
|
|
93
98
|
}, z.core.$strict>, z.ZodMiniObject<{
|
|
94
99
|
azureOpenAi: z.ZodMiniObject<{
|
|
95
100
|
auth: z.ZodMiniObject<{
|
|
96
101
|
clientSecretAuth: z.ZodMiniObject<{
|
|
97
102
|
azureClientId: z.ZodMiniString<string>;
|
|
98
103
|
azureTenantId: z.ZodMiniString<string>;
|
|
99
|
-
}, z.core.$
|
|
100
|
-
}, z.core.$
|
|
104
|
+
}, z.core.$strip>;
|
|
105
|
+
}, z.core.$strip>;
|
|
101
106
|
resourceName: z.ZodMiniString<string>;
|
|
102
|
-
}, z.core.$
|
|
107
|
+
}, z.core.$strip>;
|
|
103
108
|
}, z.core.$strict>, z.ZodMiniObject<{
|
|
104
|
-
googleGemini: z.ZodMiniObject<{}, z.core.$
|
|
109
|
+
googleGemini: z.ZodMiniObject<{}, z.core.$strip>;
|
|
105
110
|
}, z.core.$strict>, z.ZodMiniObject<{
|
|
106
111
|
openAi: z.ZodMiniObject<{
|
|
107
112
|
organizationId: z.ZodMiniString<string>;
|
|
108
|
-
|
|
113
|
+
region: z.ZodMiniEnum<{
|
|
114
|
+
GLOBAL: "GLOBAL";
|
|
115
|
+
US: "US";
|
|
116
|
+
EU: "EU";
|
|
117
|
+
}>;
|
|
118
|
+
}, z.core.$strip>;
|
|
109
119
|
}, z.core.$strict>]>;
|
|
110
120
|
defaultModelName: z.ZodMiniString<string>;
|
|
111
121
|
isDefault: z.ZodMiniBoolean<boolean>;
|
|
@@ -115,7 +125,7 @@ export declare const modelProviderRetrieveCodec: z.ZodMiniCodec<z.ZodMiniUnion<r
|
|
|
115
125
|
}, z.core.$strip>, z.ZodMiniObject<{
|
|
116
126
|
config: z.ZodMiniObject<{
|
|
117
127
|
dremioProvided: z.ZodMiniObject<Record<never, z.core.SomeType>, z.core.$strip>;
|
|
118
|
-
}, z.core.$
|
|
128
|
+
}, z.core.$strip>;
|
|
119
129
|
defaultModelName: z.ZodMiniString<string>;
|
|
120
130
|
id: z.ZodMiniString<string>;
|
|
121
131
|
isDefault: z.ZodMiniBoolean<boolean>;
|
|
@@ -20,7 +20,7 @@ import { DremioModelProvider } from "./DremioModelProvider.js";
|
|
|
20
20
|
import { ModelProvider } from "../interfaces.js";
|
|
21
21
|
export { modelProviderCreateCodec, modelProviderUpdateCodec };
|
|
22
22
|
export const dremioProvidedSchema = z.object({
|
|
23
|
-
config: z.
|
|
23
|
+
config: z.object({
|
|
24
24
|
dremioProvided: z.object(),
|
|
25
25
|
}),
|
|
26
26
|
defaultModelName: z.string(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modelProviderCodec.js","sourceRoot":"","sources":["../../../src/cloud/ai/modelProviderCodec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAC9B,OAAO,EACL,wBAAwB,EACxB,0BAA0B,IAAI,8BAA8B,EAC5D,wBAAwB,GACzB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,CAAC;AAE9D,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,MAAM,EAAE,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"modelProviderCodec.js","sourceRoot":"","sources":["../../../src/cloud/ai/modelProviderCodec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAC9B,OAAO,EACL,wBAAwB,EACxB,0BAA0B,IAAI,8BAA8B,EAC5D,wBAAwB,GACzB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,CAAC;AAE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EAAE,MAAM,CAAC,CAAC;IAEtE,IAAI,YAAY,CAAC,OAAO,EAAE,CAAC;QACzB,IAAI,gBAAgB,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjD,OAAO,EAAE,CACP,IAAI,mBAAmB,CAAC,MAAM,EAAE,YAAY,CAAC,IAA4C,CAAC,CAC3F,CAAC;QACJ,CAAC;QACD,OAAO,EAAE,CACP,IAAI,aAAa,CACf,MAAM,EACN,YAAY,CAAC,IAAuD,CACrE,CACF,CAAC;IACJ,CAAC;IAED,OAAO,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;AACjC,CAAC","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as z from \"zod/mini\";\nimport {\n modelProviderCreateCodec,\n modelProviderRetrieveCodec as baseModelProviderRetrieveCodec,\n modelProviderUpdateCodec,\n} from \"../../enterprise/ai/modelProviderCodec.ts\";\nimport { Err, Ok, Result } from \"ts-results-es\";\nimport { DremioModelProvider } from \"./DremioModelProvider.ts\";\nimport type { V4Config } from \"../../common/Config.ts\";\nimport { ModelProvider } from \"../interfaces.ts\";\n\nexport { modelProviderCreateCodec, modelProviderUpdateCodec };\n\nexport const dremioProvidedSchema = z.object({\n config: z.object({\n dremioProvided: z.object(),\n }),\n defaultModelName: z.string(),\n id: z.string(),\n isDefault: z.boolean(),\n name: z.string(),\n sqlModelNames: z.array(z.string()),\n tag: z.string(),\n});\n\nexport const modelProviderRetrieveCodec = z.codec(\n z.union([baseModelProviderRetrieveCodec.def.in, dremioProvidedSchema]),\n z.union([baseModelProviderRetrieveCodec.def.out, dremioProvidedSchema]),\n {\n decode(v) {\n if (\"dremioProvided\" in v.config) {\n return v as z.infer<typeof dremioProvidedSchema>;\n }\n\n return z.decode(\n baseModelProviderRetrieveCodec,\n v as z.input<typeof baseModelProviderRetrieveCodec>,\n );\n },\n encode(v) {\n if (\"dremioProvided\" in v.config) {\n return v as z.infer<typeof dremioProvidedSchema>;\n }\n\n return z.encode(\n baseModelProviderRetrieveCodec,\n v as z.output<typeof baseModelProviderRetrieveCodec>,\n );\n },\n },\n);\n\nexport function safeDecodeModelProvider(\n config: V4Config,\n entity: z.input<typeof modelProviderRetrieveCodec>,\n): Result<\n DremioModelProvider | ModelProvider,\n z.core.util.SafeParseResult<z.output<typeof modelProviderRetrieveCodec>>[\"error\"]\n> {\n const decodeResult = z.safeDecode(modelProviderRetrieveCodec, entity);\n\n if (decodeResult.success) {\n if (\"dremioProvided\" in decodeResult.data.config) {\n return Ok(\n new DremioModelProvider(config, decodeResult.data as z.infer<typeof dremioProvidedSchema>),\n );\n }\n return Ok(\n new ModelProvider(\n config,\n decodeResult.data as z.output<typeof baseModelProviderRetrieveCodec>,\n ),\n );\n }\n\n return Err(decodeResult.error);\n}\n\nexport type SafeDecodeResultWithoutDremioLLM = Result<\n ModelProvider,\n z.core.util.SafeParseResult<z.output<typeof modelProviderRetrieveCodec>>[\"error\"]\n>;\n"]}
|
|
@@ -4,6 +4,8 @@ import { projectUpdateSchema, type projectPropertiesCodec } from "./projectPrope
|
|
|
4
4
|
import * as z from "zod/mini";
|
|
5
5
|
import type { V3Config } from "../../common/Config.ts";
|
|
6
6
|
import type { HttpError } from "../../common/HttpError.ts";
|
|
7
|
+
import type { SignalParam } from "../../common/Params.ts";
|
|
8
|
+
import { Grant } from "../../enterprise/grants/Grant.ts";
|
|
7
9
|
export declare class Project implements ProjectInterface {
|
|
8
10
|
#private;
|
|
9
11
|
readonly catalog: ProjectInterface["catalog"];
|
|
@@ -26,6 +28,10 @@ export declare class Project implements ProjectInterface {
|
|
|
26
28
|
activate(): Promise<Result<undefined, HttpError>>;
|
|
27
29
|
delete(): Promise<Result<undefined, HttpError>>;
|
|
28
30
|
update(properties: z.output<typeof projectUpdateSchema>): AsyncResult<Project, HttpError | z.core.util.SafeParseResult<z.output<typeof projectUpdateSchema>>["error"]>;
|
|
31
|
+
grants({ signal }?: SignalParam): AsyncResult<{
|
|
32
|
+
readonly availablePrivileges: Set<"DELETE" | "ALTER" | "INSERT" | "SELECT" | "TRUNCATE" | "UPDATE" | "DROP" | "MODIFY" | "MANAGE_GRANTS" | "ALTER_REFLECTION" | "CREATE_SOURCE" | "CREATE_TABLE" | "EXECUTE" | "EXTERNAL_QUERY" | "MONITOR" | "OPERATE" | "READ_METADATA" | "UPLOAD_FILE" | "USAGE" | "VIEW_JOB_HISTORY" | "VIEW_REFLECTION">;
|
|
33
|
+
readonly grants: Grant<Set<"DELETE" | "ALTER" | "INSERT" | "SELECT" | "TRUNCATE" | "UPDATE" | "DROP" | "MODIFY" | "MANAGE_GRANTS" | "ALTER_REFLECTION" | "CREATE_SOURCE" | "CREATE_TABLE" | "EXECUTE" | "EXTERNAL_QUERY" | "MONITOR" | "OPERATE" | "READ_METADATA" | "UPLOAD_FILE" | "USAGE" | "VIEW_JOB_HISTORY" | "VIEW_REFLECTION">, "PROJECT">[];
|
|
34
|
+
}, HttpError>;
|
|
29
35
|
get settled(): boolean;
|
|
30
36
|
static updateSchema: z.ZodMiniObject<{
|
|
31
37
|
credentials: z.ZodMiniOptional<z.ZodMiniOptional<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
import { AsyncResult, Err } from "ts-results-es";
|
|
17
17
|
import { projectUpdateSchema } from "./projectPropertiesCodec.js";
|
|
18
18
|
import * as z from "zod/mini";
|
|
19
|
+
import { Grant } from "../../enterprise/grants/Grant.js";
|
|
20
|
+
import { RoleGrantee, UserGrantee } from "../../enterprise/Grantee.js";
|
|
19
21
|
export class Project {
|
|
20
22
|
#config;
|
|
21
23
|
catalog;
|
|
@@ -79,9 +81,71 @@ export class Project {
|
|
|
79
81
|
.map((res) => res.json())
|
|
80
82
|
.map((entity) => this.#projectsResource._createFromEntity(entity));
|
|
81
83
|
}
|
|
84
|
+
grants({ signal } = {}) {
|
|
85
|
+
return this.#config
|
|
86
|
+
.v3Request(`projects/${this.id}/grants`, {
|
|
87
|
+
headers: {
|
|
88
|
+
Accept: "application/json",
|
|
89
|
+
},
|
|
90
|
+
signal,
|
|
91
|
+
})
|
|
92
|
+
.map((res) => res.json())
|
|
93
|
+
.map((v) => {
|
|
94
|
+
return {
|
|
95
|
+
availablePrivileges: new Set(v.availablePrivileges),
|
|
96
|
+
grants: v.grants.map((grant) => {
|
|
97
|
+
const grantee = grant.granteeType === "USER"
|
|
98
|
+
? new UserGrantee(grant.granteeId)
|
|
99
|
+
: new RoleGrantee(grant.granteeId);
|
|
100
|
+
return new Grant({
|
|
101
|
+
grantee,
|
|
102
|
+
privileges: new Set(grant.privileges),
|
|
103
|
+
tag: grant.tag,
|
|
104
|
+
type: "PROJECT",
|
|
105
|
+
});
|
|
106
|
+
}),
|
|
107
|
+
};
|
|
108
|
+
});
|
|
109
|
+
}
|
|
82
110
|
get settled() {
|
|
83
111
|
return this.state === "ACTIVE" || this.state === "ARCHIVED" || this.state === "INACTIVE";
|
|
84
112
|
}
|
|
85
113
|
static updateSchema = projectUpdateSchema;
|
|
86
114
|
}
|
|
115
|
+
const projectAvailablePrivileges = z.enum([
|
|
116
|
+
"ALTER",
|
|
117
|
+
"ALTER_REFLECTION",
|
|
118
|
+
"CREATE_SOURCE",
|
|
119
|
+
"CREATE_TABLE",
|
|
120
|
+
"DELETE",
|
|
121
|
+
"DROP",
|
|
122
|
+
"EXECUTE",
|
|
123
|
+
"EXTERNAL_QUERY",
|
|
124
|
+
"INSERT",
|
|
125
|
+
"MANAGE_GRANTS",
|
|
126
|
+
"MODIFY",
|
|
127
|
+
"MONITOR",
|
|
128
|
+
"OPERATE",
|
|
129
|
+
"READ_METADATA",
|
|
130
|
+
"SELECT",
|
|
131
|
+
"TRUNCATE",
|
|
132
|
+
"UPDATE",
|
|
133
|
+
"UPLOAD_FILE",
|
|
134
|
+
"USAGE",
|
|
135
|
+
"VIEW_JOB_HISTORY",
|
|
136
|
+
"VIEW_REFLECTION",
|
|
137
|
+
]);
|
|
138
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
139
|
+
const projectGrantsInSchema = z.object({
|
|
140
|
+
availablePrivileges: z.array(projectAvailablePrivileges),
|
|
141
|
+
grants: z.array(z.object({
|
|
142
|
+
granteeId: z.string(),
|
|
143
|
+
granteeType: z.enum(["USER", "ROLE"]),
|
|
144
|
+
grantType: z.literal("PROJECT"),
|
|
145
|
+
name: z.string(),
|
|
146
|
+
privileges: z.array(projectAvailablePrivileges),
|
|
147
|
+
tag: z.string(),
|
|
148
|
+
})),
|
|
149
|
+
totalResults: z.int().check(z.minimum(0)),
|
|
150
|
+
});
|
|
87
151
|
//# sourceMappingURL=Project.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Project.js","sourceRoot":"","sources":["../../../src/cloud/projects/Project.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAAE,GAAG,EAAe,MAAM,eAAe,CAAC;AAE9D,OAAO,EAAE,mBAAmB,EAA+B,MAAM,6BAA6B,CAAC;AAC/F,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAI9B,MAAM,OAAO,OAAO;IACT,OAAO,CAAW;IAClB,OAAO,CAA8B;IACrC,OAAO,CAA8B;IACrC,SAAS,CAAgC;IACzC,SAAS,CAAgC;IACzC,SAAS,CAAgC;IACzC,WAAW,CAAkC;IAC7C,EAAE,CAAyB;IAC3B,cAAc,CAAqC;IACnD,UAAU,CAAiC;IAC3C,UAAU,CAAiC;IAC3C,IAAI,CAA2B;IAC/B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AClD,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAChD,CAAC;IAED,MAAM,CACJ,UAAgD;QAKhD,MAAM,gBAAgB,GAAG,CAAC,CAAC,UAAU,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAAC;QACvE,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC;YAC9B,OAAO,IAAI,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACvE,CAAC;QACD,OAAO,IAAI,CAAC,OAAO;aAChB,SAAS,CAAC,YAAY,IAAI,CAAC,EAAE,EAAE,EAAE;YAChC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC;YAC3C,OAAO,EAAE;gBACP,MAAM,EAAE,kBAAkB;gBAC1B,cAAc,EAAE,kBAAkB;aACnC;YACD,SAAS,EAAE,IAAI;YACf,MAAM,EAAE,KAAK;SACd,CAAC;aACD,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAqD,CAAC;aAC3E,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;IACvE,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,IAAI,IAAI,CAAC,KAAK,KAAK,UAAU,IAAI,IAAI,CAAC,KAAK,KAAK,UAAU,CAAC;IAC3F,CAAC;IAED,MAAM,CAAC,YAAY,GAAG,mBAAmB,CAAC","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AsyncResult, Err, type Result } from \"ts-results-es\";\nimport type { ProjectsResource } from \"./ProjectsResource.ts\";\nimport { projectUpdateSchema, type projectPropertiesCodec } from \"./projectPropertiesCodec.ts\";\nimport * as z from \"zod/mini\";\nimport type { V3Config } from \"../../common/Config.ts\";\nimport type { HttpError } from \"../../common/HttpError.ts\";\n\nexport class Project implements ProjectInterface {\n readonly #config: V3Config;\n readonly catalog: ProjectInterface[\"catalog\"];\n readonly cloudId: ProjectInterface[\"cloudId\"];\n readonly cloudType: ProjectInterface[\"cloudType\"];\n readonly createdAt: ProjectInterface[\"createdAt\"];\n readonly createdBy: ProjectInterface[\"createdBy\"];\n readonly credentials: ProjectInterface[\"credentials\"];\n readonly id: ProjectInterface[\"id\"];\n readonly lastStateError: ProjectInterface[\"lastStateError\"];\n readonly modifiedAt: ProjectInterface[\"modifiedAt\"];\n readonly modifiedBy: ProjectInterface[\"modifiedBy\"];\n readonly name: ProjectInterface[\"name\"];\n readonly numberOfEngines: ProjectInterface[\"numberOfEngines\"];\n readonly primaryCatalog: ProjectInterface[\"primaryCatalog\"];\n readonly projectStore: ProjectInterface[\"projectStore\"];\n readonly state: ProjectInterface[\"state\"];\n readonly type: ProjectInterface[\"type\"];\n\n #projectsResource: ProjectsResource;\n\n constructor(config: V3Config, properties: ProjectProperties, projectsResource: ProjectsResource) {\n this.#config = config;\n this.catalog = properties.catalog;\n this.cloudId = properties.cloudId;\n this.cloudType = properties.cloudType;\n this.createdAt = properties.createdAt;\n this.createdBy = properties.createdBy;\n this.credentials = properties.credentials;\n this.id = properties.id;\n this.lastStateError = properties.lastStateError;\n this.modifiedAt = properties.modifiedAt;\n this.modifiedBy = properties.modifiedBy;\n this.name = properties.name;\n this.numberOfEngines = properties.numberOfEngines;\n this.primaryCatalog = properties.primaryCatalog;\n this.projectStore = properties.projectStore;\n this.state = properties.state;\n this.type = properties.type;\n this.#projectsResource = projectsResource;\n }\n\n activate() {\n return this.#projectsResource.activate(this.id);\n }\n\n delete() {\n return this.#projectsResource.delete(this.id);\n }\n\n update(\n properties: z.output<typeof projectUpdateSchema>,\n ): AsyncResult<\n Project,\n HttpError | z.core.util.SafeParseResult<z.output<typeof projectUpdateSchema>>[\"error\"]\n > {\n const parsedProperties = z.safeEncode(projectUpdateSchema, properties);\n if (!parsedProperties.success) {\n return new AsyncResult(Promise.resolve(Err(parsedProperties.error)));\n }\n return this.#config\n .v3Request(`projects/${this.id}`, {\n body: JSON.stringify(parsedProperties.data),\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n keepalive: true,\n method: \"PUT\",\n })\n .map((res) => res.json() as Promise<z.input<typeof projectPropertiesCodec>>)\n .map((entity) => this.#projectsResource._createFromEntity(entity));\n }\n\n get settled() {\n return this.state === \"ACTIVE\" || this.state === \"ARCHIVED\" || this.state === \"INACTIVE\";\n }\n\n static updateSchema = projectUpdateSchema;\n}\n\nexport type ProjectProperties = z.output<typeof projectPropertiesCodec>;\n\nexport type ProjectMethods = {\n delete(): Promise<Result<undefined, unknown>>;\n get settled(): boolean;\n};\n\nexport type ProjectInterface = ProjectProperties & ProjectMethods;\n"]}
|
|
1
|
+
{"version":3,"file":"Project.js","sourceRoot":"","sources":["../../../src/cloud/projects/Project.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAAE,GAAG,EAAe,MAAM,eAAe,CAAC;AAE9D,OAAO,EAAE,mBAAmB,EAA+B,MAAM,6BAA6B,CAAC;AAC/F,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAI9B,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,6B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;IACT,SAAS;IACT,eAAe;IACf,QAAQ;IACR,UAAU;IACV,QAAQ;IACR,aAAa;IACb,OAAO;IACP,kBAAkB;IAClB,iBAAiB;CAClB,CAAC,CAAC;AAEH,6DAA6D;AAC7D,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,mBAAmB,EAAE,CAAC,CAAC,KAAK,CAAC,0BAA0B,CAAC;IACxD,MAAM,EAAE,CAAC,CAAC,KAAK,CACb,CAAC,CAAC,MAAM,CAAC;QACP,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;QACrB,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACrC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;QAC/B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,0BAA0B,CAAC;QAC/C,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;KAChB,CAAC,CACH;IACD,YAAY,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;CAC1C,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AsyncResult, Err, type Result } from \"ts-results-es\";\nimport type { ProjectsResource } from \"./ProjectsResource.ts\";\nimport { projectUpdateSchema, type projectPropertiesCodec } from \"./projectPropertiesCodec.ts\";\nimport * as z from \"zod/mini\";\nimport type { V3Config } from \"../../common/Config.ts\";\nimport type { HttpError } from \"../../common/HttpError.ts\";\nimport type { SignalParam } from \"../../common/Params.ts\";\nimport { Grant } from \"../../enterprise/grants/Grant.ts\";\nimport { RoleGrantee, UserGrantee } from \"../../enterprise/Grantee.ts\";\n\nexport class Project implements ProjectInterface {\n readonly #config: V3Config;\n readonly catalog: ProjectInterface[\"catalog\"];\n readonly cloudId: ProjectInterface[\"cloudId\"];\n readonly cloudType: ProjectInterface[\"cloudType\"];\n readonly createdAt: ProjectInterface[\"createdAt\"];\n readonly createdBy: ProjectInterface[\"createdBy\"];\n readonly credentials: ProjectInterface[\"credentials\"];\n readonly id: ProjectInterface[\"id\"];\n readonly lastStateError: ProjectInterface[\"lastStateError\"];\n readonly modifiedAt: ProjectInterface[\"modifiedAt\"];\n readonly modifiedBy: ProjectInterface[\"modifiedBy\"];\n readonly name: ProjectInterface[\"name\"];\n readonly numberOfEngines: ProjectInterface[\"numberOfEngines\"];\n readonly primaryCatalog: ProjectInterface[\"primaryCatalog\"];\n readonly projectStore: ProjectInterface[\"projectStore\"];\n readonly state: ProjectInterface[\"state\"];\n readonly type: ProjectInterface[\"type\"];\n\n #projectsResource: ProjectsResource;\n\n constructor(config: V3Config, properties: ProjectProperties, projectsResource: ProjectsResource) {\n this.#config = config;\n this.catalog = properties.catalog;\n this.cloudId = properties.cloudId;\n this.cloudType = properties.cloudType;\n this.createdAt = properties.createdAt;\n this.createdBy = properties.createdBy;\n this.credentials = properties.credentials;\n this.id = properties.id;\n this.lastStateError = properties.lastStateError;\n this.modifiedAt = properties.modifiedAt;\n this.modifiedBy = properties.modifiedBy;\n this.name = properties.name;\n this.numberOfEngines = properties.numberOfEngines;\n this.primaryCatalog = properties.primaryCatalog;\n this.projectStore = properties.projectStore;\n this.state = properties.state;\n this.type = properties.type;\n this.#projectsResource = projectsResource;\n }\n\n activate() {\n return this.#projectsResource.activate(this.id);\n }\n\n delete() {\n return this.#projectsResource.delete(this.id);\n }\n\n update(\n properties: z.output<typeof projectUpdateSchema>,\n ): AsyncResult<\n Project,\n HttpError | z.core.util.SafeParseResult<z.output<typeof projectUpdateSchema>>[\"error\"]\n > {\n const parsedProperties = z.safeEncode(projectUpdateSchema, properties);\n if (!parsedProperties.success) {\n return new AsyncResult(Promise.resolve(Err(parsedProperties.error)));\n }\n return this.#config\n .v3Request(`projects/${this.id}`, {\n body: JSON.stringify(parsedProperties.data),\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n keepalive: true,\n method: \"PUT\",\n })\n .map((res) => res.json() as Promise<z.input<typeof projectPropertiesCodec>>)\n .map((entity) => this.#projectsResource._createFromEntity(entity));\n }\n\n grants({ signal }: SignalParam = {}) {\n return this.#config\n .v3Request(`projects/${this.id}/grants`, {\n headers: {\n Accept: \"application/json\",\n },\n signal,\n })\n .map((res) => res.json() as Promise<z.infer<typeof projectGrantsInSchema>>)\n .map((v) => {\n return {\n availablePrivileges: new Set(v.availablePrivileges),\n grants: v.grants.map((grant) => {\n const grantee =\n grant.granteeType === \"USER\"\n ? new UserGrantee(grant.granteeId)\n : new RoleGrantee(grant.granteeId);\n\n return new Grant({\n grantee,\n privileges: new Set(grant.privileges),\n tag: grant.tag,\n type: \"PROJECT\",\n });\n }),\n } as const;\n });\n }\n\n get settled() {\n return this.state === \"ACTIVE\" || this.state === \"ARCHIVED\" || this.state === \"INACTIVE\";\n }\n\n static updateSchema = projectUpdateSchema;\n}\n\nexport type ProjectProperties = z.output<typeof projectPropertiesCodec>;\n\nexport type ProjectMethods = {\n delete(): Promise<Result<undefined, unknown>>;\n get settled(): boolean;\n};\n\nexport type ProjectInterface = ProjectProperties & ProjectMethods;\n\nconst projectAvailablePrivileges = z.enum([\n \"ALTER\",\n \"ALTER_REFLECTION\",\n \"CREATE_SOURCE\",\n \"CREATE_TABLE\",\n \"DELETE\",\n \"DROP\",\n \"EXECUTE\",\n \"EXTERNAL_QUERY\",\n \"INSERT\",\n \"MANAGE_GRANTS\",\n \"MODIFY\",\n \"MONITOR\",\n \"OPERATE\",\n \"READ_METADATA\",\n \"SELECT\",\n \"TRUNCATE\",\n \"UPDATE\",\n \"UPLOAD_FILE\",\n \"USAGE\",\n \"VIEW_JOB_HISTORY\",\n \"VIEW_REFLECTION\",\n]);\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst projectGrantsInSchema = z.object({\n availablePrivileges: z.array(projectAvailablePrivileges),\n grants: z.array(\n z.object({\n granteeId: z.string(),\n granteeType: z.enum([\"USER\", \"ROLE\"]),\n grantType: z.literal(\"PROJECT\"),\n name: z.string(),\n privileges: z.array(projectAvailablePrivileges),\n tag: z.string(),\n }),\n ),\n totalResults: z.int().check(z.minimum(0)),\n});\n"]}
|
|
@@ -8,18 +8,15 @@ import * as z from "zod/mini";
|
|
|
8
8
|
import { modelProviderCreateCodec } from "./modelProviderCodec.js";
|
|
9
9
|
import type { SignalParam } from "../../common/Params.ts";
|
|
10
10
|
import { listModelsPropertiesSchema } from "./modelProviderConfigSchemas.js";
|
|
11
|
-
import { Err, Ok } from "ts-results-es";
|
|
12
|
-
import type { HttpError } from "../../common/HttpError.ts";
|
|
13
|
-
import { Problem } from "../../common/Problem.ts";
|
|
14
11
|
import { AgentChatExchange } from "./chat/eventWrappers/AgentChatExchange.ts";
|
|
15
12
|
import { ChatSessionClient } from "./chat/ChatSessionClient.ts";
|
|
16
|
-
export declare function listAvailableModels(config: V4Config): (properties: z.infer<typeof listModelsPropertiesSchema>, { signal }?: SignalParam) => import("ts-results-es").AsyncResult<Set<string>, HttpError>;
|
|
13
|
+
export declare function listAvailableModels(config: V4Config): (properties: z.infer<typeof listModelsPropertiesSchema>, { signal }?: SignalParam) => import("ts-results-es").AsyncResult<Set<string>, import("../index.ts").HttpError>;
|
|
17
14
|
export declare class AIResource {
|
|
18
15
|
#private;
|
|
19
16
|
constructor(config: Logger & V4Config & SonarV4Config);
|
|
20
|
-
createModelProvider(properties: z.output<typeof modelProviderCreateCodec>): import("ts-results-es").AsyncResult<ModelProvider, HttpError>;
|
|
17
|
+
createModelProvider(properties: z.output<typeof modelProviderCreateCodec>): import("ts-results-es").AsyncResult<ModelProvider, import("../index.ts").HttpError>;
|
|
21
18
|
listModelProviders(): {
|
|
22
|
-
data({ signal }?: SignalParam): AsyncGenerator<Ok<ModelProvider> | Err<z.core.$ZodError<{
|
|
19
|
+
data({ signal }?: SignalParam): AsyncGenerator<import("ts-results-es").Ok<ModelProvider> | import("ts-results-es").Err<z.core.$ZodError<{
|
|
23
20
|
name: string;
|
|
24
21
|
id: string;
|
|
25
22
|
tag: string;
|
|
@@ -55,6 +52,7 @@ export declare class AIResource {
|
|
|
55
52
|
} | {
|
|
56
53
|
openAi: {
|
|
57
54
|
organizationId: string;
|
|
55
|
+
region: "GLOBAL" | "US" | "EU";
|
|
58
56
|
};
|
|
59
57
|
};
|
|
60
58
|
defaultModelName: string;
|
|
@@ -64,7 +62,7 @@ export declare class AIResource {
|
|
|
64
62
|
sqlModelNames: Set<string>;
|
|
65
63
|
}>>, void, unknown>;
|
|
66
64
|
getPage: ({ signal }?: SignalParam) => import("ts-results-es").AsyncResult<{
|
|
67
|
-
data: (Ok<ModelProvider> | Err<z.core.$ZodError<{
|
|
65
|
+
data: (import("ts-results-es").Ok<ModelProvider> | import("ts-results-es").Err<z.core.$ZodError<{
|
|
68
66
|
name: string;
|
|
69
67
|
id: string;
|
|
70
68
|
tag: string;
|
|
@@ -100,6 +98,7 @@ export declare class AIResource {
|
|
|
100
98
|
} | {
|
|
101
99
|
openAi: {
|
|
102
100
|
organizationId: string;
|
|
101
|
+
region: "GLOBAL" | "US" | "EU";
|
|
103
102
|
};
|
|
104
103
|
};
|
|
105
104
|
defaultModelName: string;
|
|
@@ -108,10 +107,10 @@ export declare class AIResource {
|
|
|
108
107
|
modifiedAt: import("temporal-polyfill").Temporal.Instant;
|
|
109
108
|
sqlModelNames: Set<string>;
|
|
110
109
|
}>>)[];
|
|
111
|
-
}, HttpError>;
|
|
110
|
+
}, import("../index.ts").HttpError>;
|
|
112
111
|
};
|
|
113
|
-
listAvailableModels(properties: z.infer<typeof listModelsPropertiesSchema>): import("ts-results-es").AsyncResult<Set<string>, HttpError>;
|
|
114
|
-
retrieveModelProvider(id: string, { signal }?: SignalParam): import("ts-results-es").AsyncResult<ModelProvider, HttpError>;
|
|
112
|
+
listAvailableModels(properties: z.infer<typeof listModelsPropertiesSchema>): import("ts-results-es").AsyncResult<Set<string>, import("../index.ts").HttpError>;
|
|
113
|
+
retrieveModelProvider(id: string, { signal }?: SignalParam): import("ts-results-es").AsyncResult<ModelProvider, import("../index.ts").HttpError>;
|
|
115
114
|
/**
|
|
116
115
|
* Creates an Observable that emits each time the `AgentChatExchange` is updated
|
|
117
116
|
* with events from the Agent.
|
|
@@ -124,7 +123,5 @@ export declare class AIResource {
|
|
|
124
123
|
* Sends a chat message to the Dremio AI Agent and returns an Observable containing
|
|
125
124
|
* Agent replies.
|
|
126
125
|
*/
|
|
127
|
-
sendChatMessage(chatSession: ChatSession
|
|
126
|
+
sendChatMessage(chatSession: ChatSession, userChatMessage: UserChatMessage): Observable<import("ts-results-es").Ok<AgentChatResponse<AgentResponseContent>> | import("ts-results-es").Err<import("../index.ts").HttpError | import("../index.ts").Problem<"https://api.dremio.dev/problems/ai-agent/chat/agent-disabled" | "https://api.dremio.dev/problems/ai-agent/chat/input-too-large" | "https://api.dremio.dev/problems/ai-agent/chat/model-provider-not-found" | "https://api.dremio.dev/problems/ai-agent/chat/no-default-model-provider" | "https://api.dremio.dev/problems/ai-agent/chat/no-model-provider-privilege" | "https://api.dremio.dev/problems/ai-agent/chat/preview-disabled" | "https://api.dremio.dev/problems/ai-agent/chat/rate-limit-exceeded", undefined>>>;
|
|
128
127
|
}
|
|
129
|
-
type SendChatMessageProblemCodes = "https://api.dremio.dev/problems/ai-agent/chat/agent-disabled" | "https://api.dremio.dev/problems/ai-agent/chat/input-too-large" | "https://api.dremio.dev/problems/ai-agent/chat/model-provider-not-found" | "https://api.dremio.dev/problems/ai-agent/chat/no-default-model-provider" | "https://api.dremio.dev/problems/ai-agent/chat/no-model-provider-privilege" | "https://api.dremio.dev/problems/ai-agent/chat/preview-disabled" | "https://api.dremio.dev/problems/ai-agent/chat/rate-limit-exceeded";
|
|
130
|
-
export {};
|