weave-typescript 0.51.2 → 0.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/google/protobuf/duration.pb.d.ts +99 -0
- package/dist/google/protobuf/duration.pb.js +93 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/dist/weave/authz/v1/index.d.ts +1 -0
- package/dist/weave/authz/v1/index.js +38 -0
- package/dist/weave/authz/v1/options.pb.d.ts +52 -0
- package/dist/weave/authz/v1/options.pb.js +403 -0
- package/dist/weave/filter/v1/index.d.ts +1 -0
- package/dist/weave/filter/v1/index.js +38 -0
- package/dist/{weaveapi/atc/v1/message.pb.d.ts → weave/filter/v1/options.pb.d.ts} +33 -21
- package/dist/weave/filter/v1/options.pb.js +417 -0
- package/dist/weave/index.d.ts +2 -0
- package/dist/weave/index.js +39 -0
- package/dist/weaveapi/agent/v1/agent.pb.d.ts +137 -188
- package/dist/weaveapi/agent/v1/agent.pb.js +891 -2151
- package/dist/weaveapi/agent/v1/index.d.ts +1 -1
- package/dist/weaveapi/agent/v1/index.js +2 -2
- package/dist/weaveapi/agent/v1/run.pb.d.ts +289 -0
- package/dist/weaveapi/agent/v1/run.pb.js +2763 -0
- package/dist/weaveapi/auth/v1/auth.pb.d.ts +67 -14
- package/dist/weaveapi/auth/v1/auth.pb.js +829 -89
- package/dist/weaveapi/auth/v1/index.d.ts +4 -1
- package/dist/weaveapi/auth/v1/index.js +5 -2
- package/dist/weaveapi/auth/v1/{service.pb.d.ts → organization_admin.pb.d.ts} +39 -530
- package/dist/weaveapi/auth/v1/{service.pb.js → organization_admin.pb.js} +2978 -5812
- package/dist/weaveapi/auth/v1/personal_access_token.pb.d.ts +114 -0
- package/dist/weaveapi/auth/v1/personal_access_token.pb.js +750 -0
- package/dist/weaveapi/auth/v1/profile.pb.d.ts +161 -0
- package/dist/weaveapi/auth/v1/profile.pb.js +1007 -0
- package/dist/weaveapi/auth/v1/session.pb.d.ts +460 -0
- package/dist/weaveapi/auth/v1/session.pb.js +3544 -0
- package/dist/weaveapi/chat/v1/chat.pb.d.ts +377 -149
- package/dist/weaveapi/chat/v1/chat.pb.js +3492 -1614
- package/dist/weaveapi/chat/v1/index.d.ts +0 -1
- package/dist/weaveapi/chat/v1/index.js +1 -2
- package/dist/weaveapi/consolidation/v1/consolidation.pb.d.ts +95 -0
- package/dist/weaveapi/consolidation/v1/consolidation.pb.js +770 -1
- package/dist/weaveapi/consolidation/v1/index.d.ts +0 -1
- package/dist/weaveapi/consolidation/v1/index.js +1 -2
- package/dist/weaveapi/content/v1/content.pb.d.ts +63 -0
- package/dist/weaveapi/content/v1/content.pb.js +470 -0
- package/dist/weaveapi/content/v1/index.d.ts +1 -0
- package/dist/weaveapi/content/v1/index.js +38 -0
- package/dist/weaveapi/gateway/v1/gateway.pb.d.ts +247 -523
- package/dist/weaveapi/gateway/v1/gateway.pb.js +1648 -5783
- package/dist/weaveapi/gateway/v1/index.d.ts +0 -1
- package/dist/weaveapi/gateway/v1/index.js +1 -2
- package/dist/weaveapi/index.d.ts +5 -5
- package/dist/weaveapi/index.js +6 -6
- package/dist/weaveapi/inference/v1/generate.pb.d.ts +120 -0
- package/dist/weaveapi/inference/v1/generate.pb.js +1159 -0
- package/dist/weaveapi/inference/v1/index.d.ts +4 -0
- package/dist/weaveapi/{provider → inference}/v1/index.js +4 -2
- package/dist/weaveapi/{model → inference}/v1/model.pb.d.ts +52 -15
- package/dist/weaveapi/{model → inference}/v1/model.pb.js +529 -116
- package/dist/weaveapi/{model/v1/service.pb.d.ts → inference/v1/model_route.pb.d.ts} +182 -110
- package/dist/weaveapi/{model/v1/service.pb.js → inference/v1/model_route.pb.js} +2197 -1061
- package/dist/weaveapi/inference/v1/provider.pb.d.ts +264 -0
- package/dist/weaveapi/inference/v1/provider.pb.js +2590 -0
- package/dist/weaveapi/ingestion/v1/index.d.ts +0 -2
- package/dist/weaveapi/ingestion/v1/index.js +1 -3
- package/dist/weaveapi/ingestion/v1/ingestion.pb.d.ts +543 -0
- package/dist/weaveapi/ingestion/v1/ingestion.pb.js +5550 -16
- package/dist/weaveapi/initialization/v1/index.d.ts +1 -0
- package/dist/weaveapi/initialization/v1/index.js +38 -0
- package/dist/weaveapi/initialization/v1/initialization.pb.d.ts +99 -0
- package/dist/weaveapi/initialization/v1/initialization.pb.js +510 -0
- package/dist/weaveapi/organization/v1/index.d.ts +0 -1
- package/dist/weaveapi/organization/v1/index.js +1 -2
- package/dist/weaveapi/organization/v1/organization.pb.d.ts +241 -0
- package/dist/weaveapi/organization/v1/organization.pb.js +1838 -1
- package/dist/weaveapi/reporting/index.d.ts +1 -0
- package/dist/weaveapi/reporting/index.js +38 -0
- package/dist/weaveapi/{task → reporting}/v1/index.d.ts +1 -1
- package/dist/weaveapi/{model → reporting}/v1/index.js +2 -2
- package/dist/weaveapi/reporting/v1/service.pb.d.ts +38 -0
- package/dist/weaveapi/reporting/v1/service.pb.js +167 -0
- package/dist/weaveapi/reporting/v1/usage.pb.d.ts +150 -0
- package/dist/weaveapi/reporting/v1/usage.pb.js +1837 -0
- package/dist/weaveapi/retrieval/v1/index.d.ts +0 -1
- package/dist/weaveapi/retrieval/v1/index.js +1 -2
- package/dist/weaveapi/retrieval/v1/retrieval.pb.d.ts +96 -2
- package/dist/weaveapi/retrieval/v1/retrieval.pb.js +690 -10
- package/dist/weaveapi/tool/index.d.ts +1 -0
- package/dist/weaveapi/tool/index.js +38 -0
- package/dist/weaveapi/tool/v1/index.d.ts +1 -0
- package/dist/weaveapi/tool/v1/index.js +38 -0
- package/dist/weaveapi/tool/v1/tool.pb.d.ts +370 -0
- package/dist/weaveapi/tool/v1/tool.pb.js +2717 -0
- package/dist/weaveapi/workflow/v1/index.d.ts +1 -1
- package/dist/weaveapi/workflow/v1/index.js +2 -2
- package/dist/weaveapi/workflow/v1/run.pb.d.ts +244 -0
- package/dist/weaveapi/workflow/v1/run.pb.js +2084 -0
- package/dist/weaveapi/workflow/v1/workflow.pb.d.ts +122 -275
- package/dist/weaveapi/workflow/v1/workflow.pb.js +790 -3261
- package/dist/weavesql/weavedb/agent_sql.d.ts +173 -477
- package/dist/weavesql/weavedb/agent_sql.js +281 -758
- package/dist/weavesql/weavedb/authorization_outbox_sql.d.ts +261 -0
- package/dist/weavesql/weavedb/authorization_outbox_sql.js +445 -0
- package/dist/weavesql/weavedb/chat_sql.d.ts +103 -345
- package/dist/weavesql/weavedb/chat_sql.js +312 -597
- package/dist/weavesql/weavedb/document_consolidation_sql.d.ts +217 -0
- package/dist/weavesql/weavedb/document_consolidation_sql.js +486 -0
- package/dist/weavesql/weavedb/document_ingestion_sql.d.ts +1433 -0
- package/dist/weavesql/weavedb/document_ingestion_sql.js +3488 -0
- package/dist/weavesql/weavedb/document_retrieval_sql.d.ts +314 -0
- package/dist/weavesql/weavedb/document_retrieval_sql.js +965 -0
- package/dist/weavesql/weavedb/document_table_sql.d.ts +6 -6
- package/dist/weavesql/weavedb/document_table_sql.js +12 -12
- package/dist/weavesql/weavedb/identity_sql.d.ts +1014 -0
- package/dist/weavesql/weavedb/identity_sql.js +1811 -0
- package/dist/weavesql/weavedb/inference_model_route_sql.d.ts +161 -0
- package/dist/weavesql/weavedb/inference_model_route_sql.js +408 -0
- package/dist/weavesql/weavedb/inference_provider_sql.d.ts +125 -0
- package/dist/weavesql/weavedb/inference_provider_sql.js +228 -0
- package/dist/weavesql/weavedb/initialization_sql.d.ts +15 -0
- package/dist/weavesql/weavedb/initialization_sql.js +33 -0
- package/dist/weavesql/weavedb/model_catalog_sql.d.ts +6 -6
- package/dist/weavesql/weavedb/model_catalog_sql.js +6 -6
- package/dist/weavesql/weavedb/organization_sql.d.ts +22 -102
- package/dist/weavesql/weavedb/organization_sql.js +54 -262
- package/dist/weavesql/weavedb/tool_sql.d.ts +209 -0
- package/dist/weavesql/weavedb/tool_sql.js +407 -0
- package/dist/weavesql/weavedb/usage_sql.d.ts +356 -0
- package/dist/weavesql/weavedb/usage_sql.js +568 -0
- package/dist/weavesql/weavedb/workflow_sql.d.ts +159 -546
- package/dist/weavesql/weavedb/workflow_sql.js +281 -909
- package/package.json +2 -2
- package/dist/weaveapi/agent/v1/service.pb.d.ts +0 -397
- package/dist/weaveapi/agent/v1/service.pb.js +0 -3152
- package/dist/weaveapi/atc/v1/event.pb.d.ts +0 -134
- package/dist/weaveapi/atc/v1/event.pb.js +0 -1124
- package/dist/weaveapi/atc/v1/index.d.ts +0 -5
- package/dist/weaveapi/atc/v1/index.js +0 -42
- package/dist/weaveapi/atc/v1/message.pb.js +0 -287
- package/dist/weaveapi/atc/v1/process.pb.d.ts +0 -91
- package/dist/weaveapi/atc/v1/process.pb.js +0 -658
- package/dist/weaveapi/atc/v1/run.pb.d.ts +0 -71
- package/dist/weaveapi/atc/v1/run.pb.js +0 -525
- package/dist/weaveapi/atc/v1/service.pb.d.ts +0 -472
- package/dist/weaveapi/atc/v1/service.pb.js +0 -3093
- package/dist/weaveapi/chat/v1/service.pb.d.ts +0 -345
- package/dist/weaveapi/chat/v1/service.pb.js +0 -2545
- package/dist/weaveapi/consolidation/v1/service.pb.d.ts +0 -93
- package/dist/weaveapi/consolidation/v1/service.pb.js +0 -427
- package/dist/weaveapi/gateway/v1/service.pb.d.ts +0 -235
- package/dist/weaveapi/gateway/v1/service.pb.js +0 -651
- package/dist/weaveapi/ingestion/v1/service.pb.d.ts +0 -420
- package/dist/weaveapi/ingestion/v1/service.pb.js +0 -2311
- package/dist/weaveapi/ingestion/v1/table.pb.d.ts +0 -121
- package/dist/weaveapi/ingestion/v1/table.pb.js +0 -1478
- package/dist/weaveapi/model/v1/index.d.ts +0 -2
- package/dist/weaveapi/organization/v1/service.pb.d.ts +0 -261
- package/dist/weaveapi/organization/v1/service.pb.js +0 -1561
- package/dist/weaveapi/project/v1/index.d.ts +0 -2
- package/dist/weaveapi/project/v1/index.js +0 -39
- package/dist/weaveapi/project/v1/project.pb.d.ts +0 -105
- package/dist/weaveapi/project/v1/project.pb.js +0 -1004
- package/dist/weaveapi/project/v1/service.pb.d.ts +0 -247
- package/dist/weaveapi/project/v1/service.pb.js +0 -1994
- package/dist/weaveapi/provider/v1/index.d.ts +0 -2
- package/dist/weaveapi/provider/v1/provider.pb.d.ts +0 -137
- package/dist/weaveapi/provider/v1/provider.pb.js +0 -1000
- package/dist/weaveapi/provider/v1/service.pb.d.ts +0 -223
- package/dist/weaveapi/provider/v1/service.pb.js +0 -1888
- package/dist/weaveapi/retrieval/v1/service.pb.d.ts +0 -93
- package/dist/weaveapi/retrieval/v1/service.pb.js +0 -385
- package/dist/weaveapi/task/v1/index.js +0 -39
- package/dist/weaveapi/task/v1/service.pb.d.ts +0 -172
- package/dist/weaveapi/task/v1/service.pb.js +0 -1436
- package/dist/weaveapi/task/v1/task.pb.d.ts +0 -85
- package/dist/weaveapi/task/v1/task.pb.js +0 -802
- package/dist/weaveapi/workflow/v1/service.pb.d.ts +0 -392
- package/dist/weaveapi/workflow/v1/service.pb.js +0 -3146
- /package/dist/{weaveapi/atc → weave/authz}/index.d.ts +0 -0
- /package/dist/{weaveapi/atc → weave/authz}/index.js +0 -0
- /package/dist/{weaveapi/model → weave/filter}/index.d.ts +0 -0
- /package/dist/{weaveapi/model → weave/filter}/index.js +0 -0
- /package/dist/weaveapi/{project → content}/index.d.ts +0 -0
- /package/dist/weaveapi/{project → content}/index.js +0 -0
- /package/dist/weaveapi/{provider → inference}/index.d.ts +0 -0
- /package/dist/weaveapi/{provider → inference}/index.js +0 -0
- /package/dist/weaveapi/{task → initialization}/index.d.ts +0 -0
- /package/dist/weaveapi/{task → initialization}/index.js +0 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { QueryArrayConfig, QueryArrayResult } from "pg";
|
|
2
|
+
interface Client {
|
|
3
|
+
query: (config: QueryArrayConfig) => Promise<QueryArrayResult>;
|
|
4
|
+
}
|
|
5
|
+
export declare const createInferenceProviderConfigurationQuery = "-- name: CreateInferenceProviderConfiguration :one\nINSERT INTO weave.inference_provider_configuration (\n organization_id,\n kind,\n name,\n slug,\n base_url\n) VALUES (\n $1,\n $2,\n $3,\n $4,\n $5::text\n)\nRETURNING id, organization_id, kind, name, slug, base_url, created_at, updated_at";
|
|
6
|
+
export interface CreateInferenceProviderConfigurationArgs {
|
|
7
|
+
organizationId: string;
|
|
8
|
+
kind: string;
|
|
9
|
+
name: string;
|
|
10
|
+
slug: string;
|
|
11
|
+
baseUrl: string | null;
|
|
12
|
+
}
|
|
13
|
+
export interface CreateInferenceProviderConfigurationRow {
|
|
14
|
+
id: string;
|
|
15
|
+
organizationId: string;
|
|
16
|
+
kind: string;
|
|
17
|
+
name: string;
|
|
18
|
+
slug: string;
|
|
19
|
+
baseUrl: string | null;
|
|
20
|
+
createdAt: Date;
|
|
21
|
+
updatedAt: Date;
|
|
22
|
+
}
|
|
23
|
+
export declare function createInferenceProviderConfiguration(client: Client, args: CreateInferenceProviderConfigurationArgs): Promise<CreateInferenceProviderConfigurationRow | null>;
|
|
24
|
+
export declare const getInferenceProviderConfigurationQuery = "-- name: GetInferenceProviderConfiguration :one\nSELECT id, organization_id, kind, name, slug, base_url, created_at, updated_at FROM weave.inference_provider_configuration\nWHERE organization_id = $1\n AND id = $2";
|
|
25
|
+
export interface GetInferenceProviderConfigurationArgs {
|
|
26
|
+
organizationId: string;
|
|
27
|
+
inferenceProviderConfigurationId: string;
|
|
28
|
+
}
|
|
29
|
+
export interface GetInferenceProviderConfigurationRow {
|
|
30
|
+
id: string;
|
|
31
|
+
organizationId: string;
|
|
32
|
+
kind: string;
|
|
33
|
+
name: string;
|
|
34
|
+
slug: string;
|
|
35
|
+
baseUrl: string | null;
|
|
36
|
+
createdAt: Date;
|
|
37
|
+
updatedAt: Date;
|
|
38
|
+
}
|
|
39
|
+
export declare function getInferenceProviderConfiguration(client: Client, args: GetInferenceProviderConfigurationArgs): Promise<GetInferenceProviderConfigurationRow | null>;
|
|
40
|
+
export declare const updateInferenceProviderConfigurationQuery = "-- name: UpdateInferenceProviderConfiguration :one\nUPDATE weave.inference_provider_configuration\nSET kind = $1,\n name = $2,\n slug = $3,\n base_url = $4::text\nWHERE organization_id = $5\n AND id = $6\nRETURNING id, organization_id, kind, name, slug, base_url, created_at, updated_at";
|
|
41
|
+
export interface UpdateInferenceProviderConfigurationArgs {
|
|
42
|
+
kind: string;
|
|
43
|
+
name: string;
|
|
44
|
+
slug: string;
|
|
45
|
+
baseUrl: string | null;
|
|
46
|
+
organizationId: string;
|
|
47
|
+
inferenceProviderConfigurationId: string;
|
|
48
|
+
}
|
|
49
|
+
export interface UpdateInferenceProviderConfigurationRow {
|
|
50
|
+
id: string;
|
|
51
|
+
organizationId: string;
|
|
52
|
+
kind: string;
|
|
53
|
+
name: string;
|
|
54
|
+
slug: string;
|
|
55
|
+
baseUrl: string | null;
|
|
56
|
+
createdAt: Date;
|
|
57
|
+
updatedAt: Date;
|
|
58
|
+
}
|
|
59
|
+
export declare function updateInferenceProviderConfiguration(client: Client, args: UpdateInferenceProviderConfigurationArgs): Promise<UpdateInferenceProviderConfigurationRow | null>;
|
|
60
|
+
export declare const deleteInferenceProviderConfigurationQuery = "-- name: DeleteInferenceProviderConfiguration :exec\nDELETE FROM weave.inference_provider_configuration\nWHERE organization_id = $1\n AND id = $2";
|
|
61
|
+
export interface DeleteInferenceProviderConfigurationArgs {
|
|
62
|
+
organizationId: string;
|
|
63
|
+
inferenceProviderConfigurationId: string;
|
|
64
|
+
}
|
|
65
|
+
export declare function deleteInferenceProviderConfiguration(client: Client, args: DeleteInferenceProviderConfigurationArgs): Promise<void>;
|
|
66
|
+
export declare const listInferenceProviderConfigurationsQuery = "-- name: ListInferenceProviderConfigurations :many\nSELECT id, organization_id, kind, name, slug, base_url, created_at, updated_at\nFROM weave.inference_provider_configuration\nWHERE organization_id = $1\nORDER BY name ASC, id ASC\nLIMIT COALESCE($3::integer, 100)\nOFFSET COALESCE($2::integer, 0)";
|
|
67
|
+
export interface ListInferenceProviderConfigurationsArgs {
|
|
68
|
+
organizationId: string;
|
|
69
|
+
pageOffset: number | null;
|
|
70
|
+
pageSize: number | null;
|
|
71
|
+
}
|
|
72
|
+
export interface ListInferenceProviderConfigurationsRow {
|
|
73
|
+
id: string;
|
|
74
|
+
organizationId: string;
|
|
75
|
+
kind: string;
|
|
76
|
+
name: string;
|
|
77
|
+
slug: string;
|
|
78
|
+
baseUrl: string | null;
|
|
79
|
+
createdAt: Date;
|
|
80
|
+
updatedAt: Date;
|
|
81
|
+
}
|
|
82
|
+
export declare function listInferenceProviderConfigurations(client: Client, args: ListInferenceProviderConfigurationsArgs): Promise<ListInferenceProviderConfigurationsRow[]>;
|
|
83
|
+
export declare const getInferenceProviderCredentialQuery = "-- name: GetInferenceProviderCredential :one\nSELECT c.inference_provider_configuration_id, c.credential_kind, c.encrypted_credentials, c.credential_hint, c.key_id, c.last_rotated_at, c.created_at, c.updated_at\nFROM weave.inference_provider_credential c\n JOIN weave.inference_provider_configuration p\n ON p.id = c.inference_provider_configuration_id\nWHERE p.organization_id = $1\n AND c.inference_provider_configuration_id = $2";
|
|
84
|
+
export interface GetInferenceProviderCredentialArgs {
|
|
85
|
+
organizationId: string;
|
|
86
|
+
inferenceProviderConfigurationId: string;
|
|
87
|
+
}
|
|
88
|
+
export interface GetInferenceProviderCredentialRow {
|
|
89
|
+
inferenceProviderConfigurationId: string;
|
|
90
|
+
credentialKind: string;
|
|
91
|
+
encryptedCredentials: Buffer;
|
|
92
|
+
credentialHint: string;
|
|
93
|
+
keyId: string;
|
|
94
|
+
lastRotatedAt: Date;
|
|
95
|
+
createdAt: Date;
|
|
96
|
+
updatedAt: Date;
|
|
97
|
+
}
|
|
98
|
+
export declare function getInferenceProviderCredential(client: Client, args: GetInferenceProviderCredentialArgs): Promise<GetInferenceProviderCredentialRow | null>;
|
|
99
|
+
export declare const deleteInferenceProviderCredentialQuery = "-- name: DeleteInferenceProviderCredential :exec\nDELETE FROM weave.inference_provider_credential c\nUSING weave.inference_provider_configuration p\nWHERE p.organization_id = $1\n AND p.id = $2\n AND c.inference_provider_configuration_id = p.id";
|
|
100
|
+
export interface DeleteInferenceProviderCredentialArgs {
|
|
101
|
+
organizationId: string;
|
|
102
|
+
inferenceProviderConfigurationId: string;
|
|
103
|
+
}
|
|
104
|
+
export declare function deleteInferenceProviderCredential(client: Client, args: DeleteInferenceProviderCredentialArgs): Promise<void>;
|
|
105
|
+
export declare const upsertInferenceProviderCredentialQuery = "-- name: UpsertInferenceProviderCredential :one\nINSERT INTO weave.inference_provider_credential (\n inference_provider_configuration_id,\n credential_kind,\n encrypted_credentials,\n credential_hint,\n key_id,\n last_rotated_at\n)\nSELECT\n p.id,\n $1,\n $2,\n COALESCE($3::text, ''),\n $4,\n now()\nFROM weave.inference_provider_configuration p\nWHERE p.organization_id = $5\n AND p.id = $6\nON CONFLICT (inference_provider_configuration_id)\n DO UPDATE SET\n credential_kind = EXCLUDED.credential_kind,\n encrypted_credentials = EXCLUDED.encrypted_credentials,\n credential_hint = EXCLUDED.credential_hint,\n key_id = EXCLUDED.key_id,\n last_rotated_at = EXCLUDED.last_rotated_at\nRETURNING inference_provider_configuration_id, credential_kind, encrypted_credentials, credential_hint, key_id, last_rotated_at, created_at, updated_at";
|
|
106
|
+
export interface UpsertInferenceProviderCredentialArgs {
|
|
107
|
+
credentialKind: string;
|
|
108
|
+
encryptedCredentials: Buffer;
|
|
109
|
+
credentialHint: string | null;
|
|
110
|
+
keyId: string;
|
|
111
|
+
organizationId: string;
|
|
112
|
+
inferenceProviderConfigurationId: string;
|
|
113
|
+
}
|
|
114
|
+
export interface UpsertInferenceProviderCredentialRow {
|
|
115
|
+
inferenceProviderConfigurationId: string;
|
|
116
|
+
credentialKind: string;
|
|
117
|
+
encryptedCredentials: Buffer;
|
|
118
|
+
credentialHint: string;
|
|
119
|
+
keyId: string;
|
|
120
|
+
lastRotatedAt: Date;
|
|
121
|
+
createdAt: Date;
|
|
122
|
+
updatedAt: Date;
|
|
123
|
+
}
|
|
124
|
+
export declare function upsertInferenceProviderCredential(client: Client, args: UpsertInferenceProviderCredentialArgs): Promise<UpsertInferenceProviderCredentialRow | null>;
|
|
125
|
+
export {};
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.upsertInferenceProviderCredentialQuery = exports.deleteInferenceProviderCredentialQuery = exports.getInferenceProviderCredentialQuery = exports.listInferenceProviderConfigurationsQuery = exports.deleteInferenceProviderConfigurationQuery = exports.updateInferenceProviderConfigurationQuery = exports.getInferenceProviderConfigurationQuery = exports.createInferenceProviderConfigurationQuery = void 0;
|
|
4
|
+
exports.createInferenceProviderConfiguration = createInferenceProviderConfiguration;
|
|
5
|
+
exports.getInferenceProviderConfiguration = getInferenceProviderConfiguration;
|
|
6
|
+
exports.updateInferenceProviderConfiguration = updateInferenceProviderConfiguration;
|
|
7
|
+
exports.deleteInferenceProviderConfiguration = deleteInferenceProviderConfiguration;
|
|
8
|
+
exports.listInferenceProviderConfigurations = listInferenceProviderConfigurations;
|
|
9
|
+
exports.getInferenceProviderCredential = getInferenceProviderCredential;
|
|
10
|
+
exports.deleteInferenceProviderCredential = deleteInferenceProviderCredential;
|
|
11
|
+
exports.upsertInferenceProviderCredential = upsertInferenceProviderCredential;
|
|
12
|
+
exports.createInferenceProviderConfigurationQuery = `-- name: CreateInferenceProviderConfiguration :one
|
|
13
|
+
INSERT INTO weave.inference_provider_configuration (
|
|
14
|
+
organization_id,
|
|
15
|
+
kind,
|
|
16
|
+
name,
|
|
17
|
+
slug,
|
|
18
|
+
base_url
|
|
19
|
+
) VALUES (
|
|
20
|
+
$1,
|
|
21
|
+
$2,
|
|
22
|
+
$3,
|
|
23
|
+
$4,
|
|
24
|
+
$5::text
|
|
25
|
+
)
|
|
26
|
+
RETURNING id, organization_id, kind, name, slug, base_url, created_at, updated_at`;
|
|
27
|
+
async function createInferenceProviderConfiguration(client, args) {
|
|
28
|
+
const result = await client.query({
|
|
29
|
+
text: exports.createInferenceProviderConfigurationQuery,
|
|
30
|
+
values: [args.organizationId, args.kind, args.name, args.slug, args.baseUrl],
|
|
31
|
+
rowMode: "array"
|
|
32
|
+
});
|
|
33
|
+
if (result.rows.length !== 1) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
const row = result.rows[0];
|
|
37
|
+
return {
|
|
38
|
+
id: row[0],
|
|
39
|
+
organizationId: row[1],
|
|
40
|
+
kind: row[2],
|
|
41
|
+
name: row[3],
|
|
42
|
+
slug: row[4],
|
|
43
|
+
baseUrl: row[5],
|
|
44
|
+
createdAt: row[6],
|
|
45
|
+
updatedAt: row[7]
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
exports.getInferenceProviderConfigurationQuery = `-- name: GetInferenceProviderConfiguration :one
|
|
49
|
+
SELECT id, organization_id, kind, name, slug, base_url, created_at, updated_at FROM weave.inference_provider_configuration
|
|
50
|
+
WHERE organization_id = $1
|
|
51
|
+
AND id = $2`;
|
|
52
|
+
async function getInferenceProviderConfiguration(client, args) {
|
|
53
|
+
const result = await client.query({
|
|
54
|
+
text: exports.getInferenceProviderConfigurationQuery,
|
|
55
|
+
values: [args.organizationId, args.inferenceProviderConfigurationId],
|
|
56
|
+
rowMode: "array"
|
|
57
|
+
});
|
|
58
|
+
if (result.rows.length !== 1) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
const row = result.rows[0];
|
|
62
|
+
return {
|
|
63
|
+
id: row[0],
|
|
64
|
+
organizationId: row[1],
|
|
65
|
+
kind: row[2],
|
|
66
|
+
name: row[3],
|
|
67
|
+
slug: row[4],
|
|
68
|
+
baseUrl: row[5],
|
|
69
|
+
createdAt: row[6],
|
|
70
|
+
updatedAt: row[7]
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
exports.updateInferenceProviderConfigurationQuery = `-- name: UpdateInferenceProviderConfiguration :one
|
|
74
|
+
UPDATE weave.inference_provider_configuration
|
|
75
|
+
SET kind = $1,
|
|
76
|
+
name = $2,
|
|
77
|
+
slug = $3,
|
|
78
|
+
base_url = $4::text
|
|
79
|
+
WHERE organization_id = $5
|
|
80
|
+
AND id = $6
|
|
81
|
+
RETURNING id, organization_id, kind, name, slug, base_url, created_at, updated_at`;
|
|
82
|
+
async function updateInferenceProviderConfiguration(client, args) {
|
|
83
|
+
const result = await client.query({
|
|
84
|
+
text: exports.updateInferenceProviderConfigurationQuery,
|
|
85
|
+
values: [args.kind, args.name, args.slug, args.baseUrl, args.organizationId, args.inferenceProviderConfigurationId],
|
|
86
|
+
rowMode: "array"
|
|
87
|
+
});
|
|
88
|
+
if (result.rows.length !== 1) {
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
const row = result.rows[0];
|
|
92
|
+
return {
|
|
93
|
+
id: row[0],
|
|
94
|
+
organizationId: row[1],
|
|
95
|
+
kind: row[2],
|
|
96
|
+
name: row[3],
|
|
97
|
+
slug: row[4],
|
|
98
|
+
baseUrl: row[5],
|
|
99
|
+
createdAt: row[6],
|
|
100
|
+
updatedAt: row[7]
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
exports.deleteInferenceProviderConfigurationQuery = `-- name: DeleteInferenceProviderConfiguration :exec
|
|
104
|
+
DELETE FROM weave.inference_provider_configuration
|
|
105
|
+
WHERE organization_id = $1
|
|
106
|
+
AND id = $2`;
|
|
107
|
+
async function deleteInferenceProviderConfiguration(client, args) {
|
|
108
|
+
await client.query({
|
|
109
|
+
text: exports.deleteInferenceProviderConfigurationQuery,
|
|
110
|
+
values: [args.organizationId, args.inferenceProviderConfigurationId],
|
|
111
|
+
rowMode: "array"
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
exports.listInferenceProviderConfigurationsQuery = `-- name: ListInferenceProviderConfigurations :many
|
|
115
|
+
SELECT id, organization_id, kind, name, slug, base_url, created_at, updated_at
|
|
116
|
+
FROM weave.inference_provider_configuration
|
|
117
|
+
WHERE organization_id = $1
|
|
118
|
+
ORDER BY name ASC, id ASC
|
|
119
|
+
LIMIT COALESCE($3::integer, 100)
|
|
120
|
+
OFFSET COALESCE($2::integer, 0)`;
|
|
121
|
+
async function listInferenceProviderConfigurations(client, args) {
|
|
122
|
+
const result = await client.query({
|
|
123
|
+
text: exports.listInferenceProviderConfigurationsQuery,
|
|
124
|
+
values: [args.organizationId, args.pageOffset, args.pageSize],
|
|
125
|
+
rowMode: "array"
|
|
126
|
+
});
|
|
127
|
+
return result.rows.map(row => {
|
|
128
|
+
return {
|
|
129
|
+
id: row[0],
|
|
130
|
+
organizationId: row[1],
|
|
131
|
+
kind: row[2],
|
|
132
|
+
name: row[3],
|
|
133
|
+
slug: row[4],
|
|
134
|
+
baseUrl: row[5],
|
|
135
|
+
createdAt: row[6],
|
|
136
|
+
updatedAt: row[7]
|
|
137
|
+
};
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
exports.getInferenceProviderCredentialQuery = `-- name: GetInferenceProviderCredential :one
|
|
141
|
+
SELECT c.inference_provider_configuration_id, c.credential_kind, c.encrypted_credentials, c.credential_hint, c.key_id, c.last_rotated_at, c.created_at, c.updated_at
|
|
142
|
+
FROM weave.inference_provider_credential c
|
|
143
|
+
JOIN weave.inference_provider_configuration p
|
|
144
|
+
ON p.id = c.inference_provider_configuration_id
|
|
145
|
+
WHERE p.organization_id = $1
|
|
146
|
+
AND c.inference_provider_configuration_id = $2`;
|
|
147
|
+
async function getInferenceProviderCredential(client, args) {
|
|
148
|
+
const result = await client.query({
|
|
149
|
+
text: exports.getInferenceProviderCredentialQuery,
|
|
150
|
+
values: [args.organizationId, args.inferenceProviderConfigurationId],
|
|
151
|
+
rowMode: "array"
|
|
152
|
+
});
|
|
153
|
+
if (result.rows.length !== 1) {
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
const row = result.rows[0];
|
|
157
|
+
return {
|
|
158
|
+
inferenceProviderConfigurationId: row[0],
|
|
159
|
+
credentialKind: row[1],
|
|
160
|
+
encryptedCredentials: row[2],
|
|
161
|
+
credentialHint: row[3],
|
|
162
|
+
keyId: row[4],
|
|
163
|
+
lastRotatedAt: row[5],
|
|
164
|
+
createdAt: row[6],
|
|
165
|
+
updatedAt: row[7]
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
exports.deleteInferenceProviderCredentialQuery = `-- name: DeleteInferenceProviderCredential :exec
|
|
169
|
+
DELETE FROM weave.inference_provider_credential c
|
|
170
|
+
USING weave.inference_provider_configuration p
|
|
171
|
+
WHERE p.organization_id = $1
|
|
172
|
+
AND p.id = $2
|
|
173
|
+
AND c.inference_provider_configuration_id = p.id`;
|
|
174
|
+
async function deleteInferenceProviderCredential(client, args) {
|
|
175
|
+
await client.query({
|
|
176
|
+
text: exports.deleteInferenceProviderCredentialQuery,
|
|
177
|
+
values: [args.organizationId, args.inferenceProviderConfigurationId],
|
|
178
|
+
rowMode: "array"
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
exports.upsertInferenceProviderCredentialQuery = `-- name: UpsertInferenceProviderCredential :one
|
|
182
|
+
INSERT INTO weave.inference_provider_credential (
|
|
183
|
+
inference_provider_configuration_id,
|
|
184
|
+
credential_kind,
|
|
185
|
+
encrypted_credentials,
|
|
186
|
+
credential_hint,
|
|
187
|
+
key_id,
|
|
188
|
+
last_rotated_at
|
|
189
|
+
)
|
|
190
|
+
SELECT
|
|
191
|
+
p.id,
|
|
192
|
+
$1,
|
|
193
|
+
$2,
|
|
194
|
+
COALESCE($3::text, ''),
|
|
195
|
+
$4,
|
|
196
|
+
now()
|
|
197
|
+
FROM weave.inference_provider_configuration p
|
|
198
|
+
WHERE p.organization_id = $5
|
|
199
|
+
AND p.id = $6
|
|
200
|
+
ON CONFLICT (inference_provider_configuration_id)
|
|
201
|
+
DO UPDATE SET
|
|
202
|
+
credential_kind = EXCLUDED.credential_kind,
|
|
203
|
+
encrypted_credentials = EXCLUDED.encrypted_credentials,
|
|
204
|
+
credential_hint = EXCLUDED.credential_hint,
|
|
205
|
+
key_id = EXCLUDED.key_id,
|
|
206
|
+
last_rotated_at = EXCLUDED.last_rotated_at
|
|
207
|
+
RETURNING inference_provider_configuration_id, credential_kind, encrypted_credentials, credential_hint, key_id, last_rotated_at, created_at, updated_at`;
|
|
208
|
+
async function upsertInferenceProviderCredential(client, args) {
|
|
209
|
+
const result = await client.query({
|
|
210
|
+
text: exports.upsertInferenceProviderCredentialQuery,
|
|
211
|
+
values: [args.credentialKind, args.encryptedCredentials, args.credentialHint, args.keyId, args.organizationId, args.inferenceProviderConfigurationId],
|
|
212
|
+
rowMode: "array"
|
|
213
|
+
});
|
|
214
|
+
if (result.rows.length !== 1) {
|
|
215
|
+
return null;
|
|
216
|
+
}
|
|
217
|
+
const row = result.rows[0];
|
|
218
|
+
return {
|
|
219
|
+
inferenceProviderConfigurationId: row[0],
|
|
220
|
+
credentialKind: row[1],
|
|
221
|
+
encryptedCredentials: row[2],
|
|
222
|
+
credentialHint: row[3],
|
|
223
|
+
keyId: row[4],
|
|
224
|
+
lastRotatedAt: row[5],
|
|
225
|
+
createdAt: row[6],
|
|
226
|
+
updatedAt: row[7]
|
|
227
|
+
};
|
|
228
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { QueryArrayConfig, QueryArrayResult } from "pg";
|
|
2
|
+
interface Client {
|
|
3
|
+
query: (config: QueryArrayConfig) => Promise<QueryArrayResult>;
|
|
4
|
+
}
|
|
5
|
+
export declare const lockInitializationQuery = "-- name: LockInitialization :exec\nSELECT pg_advisory_xact_lock(9135620421857066401)";
|
|
6
|
+
export interface LockInitializationRow {
|
|
7
|
+
pgAdvisoryXactLock: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function lockInitialization(client: Client): Promise<void>;
|
|
10
|
+
export declare const getInitializationStateQuery = "-- name: GetInitializationState :one\nSELECT EXISTS(\n SELECT 1\n FROM weave.organization\n) AS initialized";
|
|
11
|
+
export interface GetInitializationStateRow {
|
|
12
|
+
initialized: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function getInitializationState(client: Client): Promise<GetInitializationStateRow | null>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getInitializationStateQuery = exports.lockInitializationQuery = void 0;
|
|
4
|
+
exports.lockInitialization = lockInitialization;
|
|
5
|
+
exports.getInitializationState = getInitializationState;
|
|
6
|
+
exports.lockInitializationQuery = `-- name: LockInitialization :exec
|
|
7
|
+
SELECT pg_advisory_xact_lock(9135620421857066401)`;
|
|
8
|
+
async function lockInitialization(client) {
|
|
9
|
+
await client.query({
|
|
10
|
+
text: exports.lockInitializationQuery,
|
|
11
|
+
values: [],
|
|
12
|
+
rowMode: "array"
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
exports.getInitializationStateQuery = `-- name: GetInitializationState :one
|
|
16
|
+
SELECT EXISTS(
|
|
17
|
+
SELECT 1
|
|
18
|
+
FROM weave.organization
|
|
19
|
+
) AS initialized`;
|
|
20
|
+
async function getInitializationState(client) {
|
|
21
|
+
const result = await client.query({
|
|
22
|
+
text: exports.getInitializationStateQuery,
|
|
23
|
+
values: [],
|
|
24
|
+
rowMode: "array"
|
|
25
|
+
});
|
|
26
|
+
if (result.rows.length !== 1) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
const row = result.rows[0];
|
|
30
|
+
return {
|
|
31
|
+
initialized: row[0]
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -2,7 +2,7 @@ import { QueryArrayConfig, QueryArrayResult } from "pg";
|
|
|
2
2
|
interface Client {
|
|
3
3
|
query: (config: QueryArrayConfig) => Promise<QueryArrayResult>;
|
|
4
4
|
}
|
|
5
|
-
export declare const upsertModelCatalogModelQuery = "-- name: UpsertModelCatalogModel :one\nINSERT INTO weave.
|
|
5
|
+
export declare const upsertModelCatalogModelQuery = "-- name: UpsertModelCatalogModel :one\nINSERT INTO weave.inference_model_catalog (\n provider_kind,\n model_id,\n display_name,\n primary_type,\n capabilities,\n pricing,\n params,\n max_input_tokens,\n max_output_tokens,\n release_order,\n catalog_revision,\n synced_at\n) VALUES (\n $1,\n $2,\n $3,\n $4,\n $5,\n $6,\n $7,\n $8,\n $9,\n $10,\n $11,\n $12\n)\nON CONFLICT (provider_kind, model_id) DO UPDATE\nSET\n display_name = EXCLUDED.display_name,\n primary_type = EXCLUDED.primary_type,\n capabilities = EXCLUDED.capabilities,\n pricing = EXCLUDED.pricing,\n params = EXCLUDED.params,\n max_input_tokens = EXCLUDED.max_input_tokens,\n max_output_tokens = EXCLUDED.max_output_tokens,\n release_order = EXCLUDED.release_order,\n catalog_revision = EXCLUDED.catalog_revision,\n synced_at = EXCLUDED.synced_at,\n updated_at = now()\nRETURNING\n provider_kind,\n model_id,\n display_name,\n primary_type,\n capabilities,\n pricing,\n params,\n max_input_tokens,\n max_output_tokens,\n release_order,\n catalog_revision,\n synced_at,\n updated_at";
|
|
6
6
|
export interface UpsertModelCatalogModelArgs {
|
|
7
7
|
providerKind: string;
|
|
8
8
|
modelId: string;
|
|
@@ -33,16 +33,16 @@ export interface UpsertModelCatalogModelRow {
|
|
|
33
33
|
updatedAt: Date;
|
|
34
34
|
}
|
|
35
35
|
export declare function upsertModelCatalogModel(client: Client, args: UpsertModelCatalogModelArgs): Promise<UpsertModelCatalogModelRow | null>;
|
|
36
|
-
export declare const deleteModelCatalogModelsByProviderQuery = "-- name: DeleteModelCatalogModelsByProvider :execrows\nDELETE FROM weave.
|
|
36
|
+
export declare const deleteModelCatalogModelsByProviderQuery = "-- name: DeleteModelCatalogModelsByProvider :execrows\nDELETE FROM weave.inference_model_catalog\nWHERE provider_kind = $1";
|
|
37
37
|
export interface DeleteModelCatalogModelsByProviderArgs {
|
|
38
38
|
providerKind: string;
|
|
39
39
|
}
|
|
40
|
-
export declare const listModelCatalogProvidersQuery = "-- name: ListModelCatalogProviders :many\nSELECT DISTINCT provider_kind\nFROM weave.
|
|
40
|
+
export declare const listModelCatalogProvidersQuery = "-- name: ListModelCatalogProviders :many\nSELECT DISTINCT provider_kind\nFROM weave.inference_model_catalog\nORDER BY provider_kind ASC";
|
|
41
41
|
export interface ListModelCatalogProvidersRow {
|
|
42
42
|
providerKind: string;
|
|
43
43
|
}
|
|
44
44
|
export declare function listModelCatalogProviders(client: Client): Promise<ListModelCatalogProvidersRow[]>;
|
|
45
|
-
export declare const listModelCatalogModelsByProviderQuery = "-- name: ListModelCatalogModelsByProvider :many\nSELECT\n provider_kind,\n model_id,\n display_name,\n primary_type,\n capabilities,\n pricing,\n params,\n max_input_tokens,\n max_output_tokens,\n release_order,\n catalog_revision,\n synced_at,\n updated_at\nFROM weave.
|
|
45
|
+
export declare const listModelCatalogModelsByProviderQuery = "-- name: ListModelCatalogModelsByProvider :many\nSELECT\n provider_kind,\n model_id,\n display_name,\n primary_type,\n capabilities,\n pricing,\n params,\n max_input_tokens,\n max_output_tokens,\n release_order,\n catalog_revision,\n synced_at,\n updated_at\nFROM weave.inference_model_catalog\nWHERE provider_kind = $1\nORDER BY release_order ASC, model_id ASC";
|
|
46
46
|
export interface ListModelCatalogModelsByProviderArgs {
|
|
47
47
|
providerKind: string;
|
|
48
48
|
}
|
|
@@ -62,7 +62,7 @@ export interface ListModelCatalogModelsByProviderRow {
|
|
|
62
62
|
updatedAt: Date;
|
|
63
63
|
}
|
|
64
64
|
export declare function listModelCatalogModelsByProvider(client: Client, args: ListModelCatalogModelsByProviderArgs): Promise<ListModelCatalogModelsByProviderRow[]>;
|
|
65
|
-
export declare const getModelCatalogModelByProviderAndIDQuery = "-- name: GetModelCatalogModelByProviderAndID :one\nSELECT\n provider_kind,\n model_id,\n display_name,\n primary_type,\n capabilities,\n pricing,\n params,\n max_input_tokens,\n max_output_tokens,\n release_order,\n catalog_revision,\n synced_at,\n updated_at\nFROM weave.
|
|
65
|
+
export declare const getModelCatalogModelByProviderAndIDQuery = "-- name: GetModelCatalogModelByProviderAndID :one\nSELECT\n provider_kind,\n model_id,\n display_name,\n primary_type,\n capabilities,\n pricing,\n params,\n max_input_tokens,\n max_output_tokens,\n release_order,\n catalog_revision,\n synced_at,\n updated_at\nFROM weave.inference_model_catalog\nWHERE provider_kind = $1\n AND model_id = $2";
|
|
66
66
|
export interface GetModelCatalogModelByProviderAndIDArgs {
|
|
67
67
|
providerKind: string;
|
|
68
68
|
modelId: string;
|
|
@@ -83,7 +83,7 @@ export interface GetModelCatalogModelByProviderAndIDRow {
|
|
|
83
83
|
updatedAt: Date;
|
|
84
84
|
}
|
|
85
85
|
export declare function getModelCatalogModelByProviderAndID(client: Client, args: GetModelCatalogModelByProviderAndIDArgs): Promise<GetModelCatalogModelByProviderAndIDRow | null>;
|
|
86
|
-
export declare const getLatestModelCatalogRevisionQuery = "-- name: GetLatestModelCatalogRevision :one\nSELECT catalog_revision\nFROM weave.
|
|
86
|
+
export declare const getLatestModelCatalogRevisionQuery = "-- name: GetLatestModelCatalogRevision :one\nSELECT catalog_revision\nFROM weave.inference_model_catalog\nORDER BY synced_at DESC, updated_at DESC\nLIMIT 1";
|
|
87
87
|
export interface GetLatestModelCatalogRevisionRow {
|
|
88
88
|
catalogRevision: string;
|
|
89
89
|
}
|
|
@@ -7,7 +7,7 @@ exports.listModelCatalogModelsByProvider = listModelCatalogModelsByProvider;
|
|
|
7
7
|
exports.getModelCatalogModelByProviderAndID = getModelCatalogModelByProviderAndID;
|
|
8
8
|
exports.getLatestModelCatalogRevision = getLatestModelCatalogRevision;
|
|
9
9
|
exports.upsertModelCatalogModelQuery = `-- name: UpsertModelCatalogModel :one
|
|
10
|
-
INSERT INTO weave.
|
|
10
|
+
INSERT INTO weave.inference_model_catalog (
|
|
11
11
|
provider_kind,
|
|
12
12
|
model_id,
|
|
13
13
|
display_name,
|
|
@@ -88,11 +88,11 @@ async function upsertModelCatalogModel(client, args) {
|
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
90
|
exports.deleteModelCatalogModelsByProviderQuery = `-- name: DeleteModelCatalogModelsByProvider :execrows
|
|
91
|
-
DELETE FROM weave.
|
|
91
|
+
DELETE FROM weave.inference_model_catalog
|
|
92
92
|
WHERE provider_kind = $1`;
|
|
93
93
|
exports.listModelCatalogProvidersQuery = `-- name: ListModelCatalogProviders :many
|
|
94
94
|
SELECT DISTINCT provider_kind
|
|
95
|
-
FROM weave.
|
|
95
|
+
FROM weave.inference_model_catalog
|
|
96
96
|
ORDER BY provider_kind ASC`;
|
|
97
97
|
async function listModelCatalogProviders(client) {
|
|
98
98
|
const result = await client.query({
|
|
@@ -121,7 +121,7 @@ SELECT
|
|
|
121
121
|
catalog_revision,
|
|
122
122
|
synced_at,
|
|
123
123
|
updated_at
|
|
124
|
-
FROM weave.
|
|
124
|
+
FROM weave.inference_model_catalog
|
|
125
125
|
WHERE provider_kind = $1
|
|
126
126
|
ORDER BY release_order ASC, model_id ASC`;
|
|
127
127
|
async function listModelCatalogModelsByProvider(client, args) {
|
|
@@ -163,7 +163,7 @@ SELECT
|
|
|
163
163
|
catalog_revision,
|
|
164
164
|
synced_at,
|
|
165
165
|
updated_at
|
|
166
|
-
FROM weave.
|
|
166
|
+
FROM weave.inference_model_catalog
|
|
167
167
|
WHERE provider_kind = $1
|
|
168
168
|
AND model_id = $2`;
|
|
169
169
|
async function getModelCatalogModelByProviderAndID(client, args) {
|
|
@@ -194,7 +194,7 @@ async function getModelCatalogModelByProviderAndID(client, args) {
|
|
|
194
194
|
}
|
|
195
195
|
exports.getLatestModelCatalogRevisionQuery = `-- name: GetLatestModelCatalogRevision :one
|
|
196
196
|
SELECT catalog_revision
|
|
197
|
-
FROM weave.
|
|
197
|
+
FROM weave.inference_model_catalog
|
|
198
198
|
ORDER BY synced_at DESC, updated_at DESC
|
|
199
199
|
LIMIT 1`;
|
|
200
200
|
async function getLatestModelCatalogRevision(client) {
|