weave-typescript 0.5.1 → 0.9.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/weaveapi/llmx/v1/architecture.pb.d.ts +377 -0
- package/dist/weaveapi/llmx/v1/architecture.pb.js +2756 -0
- package/dist/weaveapi/llmx/v1/capabilities.pb.d.ts +491 -0
- package/dist/weaveapi/llmx/v1/capabilities.pb.js +3159 -0
- package/dist/weaveapi/{modex → llmx}/v1/model.pb.d.ts +86 -42
- package/dist/weaveapi/{modex → llmx}/v1/model.pb.js +119 -442
- package/dist/weaveapi/llmx/v1/pricing.pb.d.ts +142 -0
- package/dist/weaveapi/llmx/v1/pricing.pb.js +825 -0
- package/dist/weaveapi/{modex → llmx}/v1/provider.pb.d.ts +1 -3
- package/dist/weaveapi/{modex → llmx}/v1/provider.pb.js +3 -57
- package/dist/weaveapi/{modex → llmx}/v1/service.pb.d.ts +20 -20
- package/dist/weaveapi/{modex → llmx}/v1/service.pb.js +17 -17
- package/dist/weavesql/llmxdb/capabilities_sql.d.ts +151 -0
- package/dist/weavesql/llmxdb/capabilities_sql.js +241 -0
- package/dist/weavesql/llmxdb/changes_sql.d.ts +81 -0
- package/dist/weavesql/llmxdb/changes_sql.js +118 -0
- package/dist/weavesql/llmxdb/models_sql.d.ts +198 -0
- package/dist/weavesql/llmxdb/models_sql.js +244 -0
- package/dist/weavesql/llmxdb/providers_sql.d.ts +122 -0
- package/dist/weavesql/llmxdb/providers_sql.js +179 -0
- package/dist/weavesql/llmxdb/scraper_runs_sql.d.ts +83 -0
- package/dist/weavesql/llmxdb/scraper_runs_sql.js +137 -0
- package/dist/weavesql/llmxdb/search_sql.d.ts +272 -0
- package/dist/weavesql/llmxdb/search_sql.js +348 -0
- package/dist/weavesql/weavedb/dataset_sql.d.ts +17 -0
- package/dist/weavesql/weavedb/dataset_sql.js +21 -0
- package/dist/weavesql/weavedb/relationships_sql.d.ts +16 -0
- package/dist/weavesql/weavedb/relationships_sql.js +32 -0
- package/dist/weavesql/weavedb/storage_sql.d.ts +33 -0
- package/dist/weavesql/weavedb/storage_sql.js +54 -0
- package/dist/weavesql/weavedb/synthesizer_sql.d.ts +28 -0
- package/dist/weavesql/weavedb/synthesizer_sql.js +42 -0
- package/package.json +4 -1
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRunStatsQuery = exports.getRecentRunsQuery = exports.getLastSuccessfulRunQuery = exports.updateScraperRunQuery = exports.createScraperRunQuery = void 0;
|
|
4
|
+
exports.createScraperRun = createScraperRun;
|
|
5
|
+
exports.updateScraperRun = updateScraperRun;
|
|
6
|
+
exports.getLastSuccessfulRun = getLastSuccessfulRun;
|
|
7
|
+
exports.getRecentRuns = getRecentRuns;
|
|
8
|
+
exports.getRunStats = getRunStats;
|
|
9
|
+
exports.createScraperRunQuery = `-- name: CreateScraperRun :one
|
|
10
|
+
INSERT INTO scraper_runs (provider_slug, status)
|
|
11
|
+
VALUES ($1, $2)
|
|
12
|
+
RETURNING id, provider_slug, status, models_found, models_updated, models_added, started_at, completed_at, error_message, created_at`;
|
|
13
|
+
async function createScraperRun(client, args) {
|
|
14
|
+
const result = await client.query({
|
|
15
|
+
text: exports.createScraperRunQuery,
|
|
16
|
+
values: [args.providerSlug, args.status],
|
|
17
|
+
rowMode: "array"
|
|
18
|
+
});
|
|
19
|
+
if (result.rows.length !== 1) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
const row = result.rows[0];
|
|
23
|
+
return {
|
|
24
|
+
id: row[0],
|
|
25
|
+
providerSlug: row[1],
|
|
26
|
+
status: row[2],
|
|
27
|
+
modelsFound: row[3],
|
|
28
|
+
modelsUpdated: row[4],
|
|
29
|
+
modelsAdded: row[5],
|
|
30
|
+
startedAt: row[6],
|
|
31
|
+
completedAt: row[7],
|
|
32
|
+
errorMessage: row[8],
|
|
33
|
+
createdAt: row[9]
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
exports.updateScraperRunQuery = `-- name: UpdateScraperRun :exec
|
|
37
|
+
UPDATE scraper_runs
|
|
38
|
+
SET status = $1,
|
|
39
|
+
models_found = $2,
|
|
40
|
+
models_updated = $3,
|
|
41
|
+
models_added = $4,
|
|
42
|
+
completed_at = $5,
|
|
43
|
+
error_message = $6
|
|
44
|
+
WHERE id = $7`;
|
|
45
|
+
async function updateScraperRun(client, args) {
|
|
46
|
+
await client.query({
|
|
47
|
+
text: exports.updateScraperRunQuery,
|
|
48
|
+
values: [args.status, args.modelsFound, args.modelsUpdated, args.modelsAdded, args.completedAt, args.errorMessage, args.id],
|
|
49
|
+
rowMode: "array"
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
exports.getLastSuccessfulRunQuery = `-- name: GetLastSuccessfulRun :one
|
|
53
|
+
SELECT id, provider_slug, status, models_found, models_updated, models_added, started_at, completed_at, error_message, created_at
|
|
54
|
+
FROM scraper_runs
|
|
55
|
+
WHERE provider_slug = $1
|
|
56
|
+
AND status = 'success'
|
|
57
|
+
ORDER BY completed_at DESC
|
|
58
|
+
LIMIT 1`;
|
|
59
|
+
async function getLastSuccessfulRun(client, args) {
|
|
60
|
+
const result = await client.query({
|
|
61
|
+
text: exports.getLastSuccessfulRunQuery,
|
|
62
|
+
values: [args.providerSlug],
|
|
63
|
+
rowMode: "array"
|
|
64
|
+
});
|
|
65
|
+
if (result.rows.length !== 1) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
const row = result.rows[0];
|
|
69
|
+
return {
|
|
70
|
+
id: row[0],
|
|
71
|
+
providerSlug: row[1],
|
|
72
|
+
status: row[2],
|
|
73
|
+
modelsFound: row[3],
|
|
74
|
+
modelsUpdated: row[4],
|
|
75
|
+
modelsAdded: row[5],
|
|
76
|
+
startedAt: row[6],
|
|
77
|
+
completedAt: row[7],
|
|
78
|
+
errorMessage: row[8],
|
|
79
|
+
createdAt: row[9]
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
exports.getRecentRunsQuery = `-- name: GetRecentRuns :many
|
|
83
|
+
SELECT id, provider_slug, status, models_found, models_updated, models_added, started_at, completed_at, error_message, created_at
|
|
84
|
+
FROM scraper_runs
|
|
85
|
+
WHERE ($1::text IS NULL OR provider_slug = $1)
|
|
86
|
+
ORDER BY created_at DESC
|
|
87
|
+
LIMIT $2`;
|
|
88
|
+
async function getRecentRuns(client, args) {
|
|
89
|
+
const result = await client.query({
|
|
90
|
+
text: exports.getRecentRunsQuery,
|
|
91
|
+
values: [args.providerSlug, args.limitCount],
|
|
92
|
+
rowMode: "array"
|
|
93
|
+
});
|
|
94
|
+
return result.rows.map(row => {
|
|
95
|
+
return {
|
|
96
|
+
id: row[0],
|
|
97
|
+
providerSlug: row[1],
|
|
98
|
+
status: row[2],
|
|
99
|
+
modelsFound: row[3],
|
|
100
|
+
modelsUpdated: row[4],
|
|
101
|
+
modelsAdded: row[5],
|
|
102
|
+
startedAt: row[6],
|
|
103
|
+
completedAt: row[7],
|
|
104
|
+
errorMessage: row[8],
|
|
105
|
+
createdAt: row[9]
|
|
106
|
+
};
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
exports.getRunStatsQuery = `-- name: GetRunStats :one
|
|
110
|
+
SELECT COUNT(*) as total_runs,
|
|
111
|
+
COUNT(*) FILTER (WHERE status = 'success') as successful_runs,
|
|
112
|
+
COUNT(*) FILTER (WHERE status = 'failed') as failed_runs,
|
|
113
|
+
AVG(EXTRACT(EPOCH FROM (completed_at - started_at))) as avg_duration_seconds,
|
|
114
|
+
SUM(models_added) as total_models_added,
|
|
115
|
+
SUM(models_updated) as total_models_updated
|
|
116
|
+
FROM scraper_runs
|
|
117
|
+
WHERE created_at > $1
|
|
118
|
+
AND ($2::text IS NULL OR provider_slug = $2)`;
|
|
119
|
+
async function getRunStats(client, args) {
|
|
120
|
+
const result = await client.query({
|
|
121
|
+
text: exports.getRunStatsQuery,
|
|
122
|
+
values: [args.since, args.providerSlug],
|
|
123
|
+
rowMode: "array"
|
|
124
|
+
});
|
|
125
|
+
if (result.rows.length !== 1) {
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
const row = result.rows[0];
|
|
129
|
+
return {
|
|
130
|
+
totalRuns: row[0],
|
|
131
|
+
successfulRuns: row[1],
|
|
132
|
+
failedRuns: row[2],
|
|
133
|
+
avgDurationSeconds: row[3],
|
|
134
|
+
totalModelsAdded: row[4],
|
|
135
|
+
totalModelsUpdated: row[5]
|
|
136
|
+
};
|
|
137
|
+
}
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import { QueryArrayConfig, QueryArrayResult } from "pg";
|
|
2
|
+
interface Client {
|
|
3
|
+
query: (config: QueryArrayConfig) => Promise<QueryArrayResult>;
|
|
4
|
+
}
|
|
5
|
+
export declare const searchModelsQuery = "-- name: SearchModels :many\nSELECT id, provider_id, model_id, slug, name, display_name, description, version, capabilities, classification, architecture, performance, token_info, pricing, api_details, training, licensing, safety, availability, technical_specs, release_date, training_data_cutoff, deprecation_date, metadata, last_scraped_at, is_active, is_deprecated, created_at, updated_at\nFROM llm_models\nWHERE is_active = true\n AND ($1::uuid IS NULL OR provider_id = $1)\n AND ($2::text IS NULL OR classification ->> 'model_type' = $2)\n AND ($3::int IS NULL OR (token_info ->> 'context_window')::int >= $3)\n AND ($4::numeric IS NULL OR (pricing ->> 'input_price')::numeric <= $4)\n AND ($5::text IS NULL OR capabilities->'configs' ? $5)\nORDER BY CASE WHEN $6 = 'price' THEN (pricing ->> 'input_price')::numeric END ASC,\n CASE WHEN $6 = 'context' THEN (token_info ->> 'context_window')::int END DESC,\n name ASC\nLIMIT $8 OFFSET $7";
|
|
6
|
+
export interface SearchModelsArgs {
|
|
7
|
+
providerId: string;
|
|
8
|
+
modelType: string;
|
|
9
|
+
minContext: number;
|
|
10
|
+
maxInputPrice: string;
|
|
11
|
+
hasCapability: string;
|
|
12
|
+
orderBy: string | null;
|
|
13
|
+
offsetCount: string;
|
|
14
|
+
limitCount: string;
|
|
15
|
+
}
|
|
16
|
+
export interface SearchModelsRow {
|
|
17
|
+
id: string;
|
|
18
|
+
providerId: string;
|
|
19
|
+
modelId: string;
|
|
20
|
+
slug: string;
|
|
21
|
+
name: string;
|
|
22
|
+
displayName: string | null;
|
|
23
|
+
description: string | null;
|
|
24
|
+
version: string | null;
|
|
25
|
+
capabilities: any;
|
|
26
|
+
classification: any;
|
|
27
|
+
architecture: any;
|
|
28
|
+
performance: any;
|
|
29
|
+
tokenInfo: any;
|
|
30
|
+
pricing: any;
|
|
31
|
+
apiDetails: any;
|
|
32
|
+
training: any;
|
|
33
|
+
licensing: any;
|
|
34
|
+
safety: any;
|
|
35
|
+
availability: any;
|
|
36
|
+
technicalSpecs: any;
|
|
37
|
+
releaseDate: Date | null;
|
|
38
|
+
trainingDataCutoff: Date | null;
|
|
39
|
+
deprecationDate: Date | null;
|
|
40
|
+
metadata: any;
|
|
41
|
+
lastScrapedAt: Date | null;
|
|
42
|
+
isActive: boolean | null;
|
|
43
|
+
isDeprecated: boolean | null;
|
|
44
|
+
createdAt: Date | null;
|
|
45
|
+
updatedAt: Date | null;
|
|
46
|
+
}
|
|
47
|
+
export declare function searchModels(client: Client, args: SearchModelsArgs): Promise<SearchModelsRow[]>;
|
|
48
|
+
export declare const searchModelsByArchitectureQuery = "-- name: SearchModelsByArchitecture :many\nSELECT id, provider_id, model_id, slug, name, display_name, description, version, capabilities, classification, architecture, performance, token_info, pricing, api_details, training, licensing, safety, availability, technical_specs, release_date, training_data_cutoff, deprecation_date, metadata, last_scraped_at, is_active, is_deprecated, created_at, updated_at\nFROM llm_models\nWHERE is_active = true\n AND ($1::text IS NULL OR architecture->>'base_architecture' = $1)\n AND ($2::bigint IS NULL OR (architecture->>'parameter_count')::bigint >= $2)\n AND ($3::bigint IS NULL OR (architecture->>'parameter_count')::bigint <= $3)\n AND ($4::boolean IS NULL OR (architecture->>'is_mixture_of_experts')::boolean = $4)\nORDER BY (architecture->>'parameter_count')::bigint DESC";
|
|
49
|
+
export interface SearchModelsByArchitectureArgs {
|
|
50
|
+
baseArchitecture: string;
|
|
51
|
+
minParams: string;
|
|
52
|
+
maxParams: string;
|
|
53
|
+
isMoe: boolean;
|
|
54
|
+
}
|
|
55
|
+
export interface SearchModelsByArchitectureRow {
|
|
56
|
+
id: string;
|
|
57
|
+
providerId: string;
|
|
58
|
+
modelId: string;
|
|
59
|
+
slug: string;
|
|
60
|
+
name: string;
|
|
61
|
+
displayName: string | null;
|
|
62
|
+
description: string | null;
|
|
63
|
+
version: string | null;
|
|
64
|
+
capabilities: any;
|
|
65
|
+
classification: any;
|
|
66
|
+
architecture: any;
|
|
67
|
+
performance: any;
|
|
68
|
+
tokenInfo: any;
|
|
69
|
+
pricing: any;
|
|
70
|
+
apiDetails: any;
|
|
71
|
+
training: any;
|
|
72
|
+
licensing: any;
|
|
73
|
+
safety: any;
|
|
74
|
+
availability: any;
|
|
75
|
+
technicalSpecs: any;
|
|
76
|
+
releaseDate: Date | null;
|
|
77
|
+
trainingDataCutoff: Date | null;
|
|
78
|
+
deprecationDate: Date | null;
|
|
79
|
+
metadata: any;
|
|
80
|
+
lastScrapedAt: Date | null;
|
|
81
|
+
isActive: boolean | null;
|
|
82
|
+
isDeprecated: boolean | null;
|
|
83
|
+
createdAt: Date | null;
|
|
84
|
+
updatedAt: Date | null;
|
|
85
|
+
}
|
|
86
|
+
export declare function searchModelsByArchitecture(client: Client, args: SearchModelsByArchitectureArgs): Promise<SearchModelsByArchitectureRow[]>;
|
|
87
|
+
export declare const getOpenSourceModelsQuery = "-- name: GetOpenSourceModels :many\nSELECT id, provider_id, model_id, slug, name, display_name, description, version, capabilities, classification, architecture, performance, token_info, pricing, api_details, training, licensing, safety, availability, technical_specs, release_date, training_data_cutoff, deprecation_date, metadata, last_scraped_at, is_active, is_deprecated, created_at, updated_at\nFROM llm_models\nWHERE is_active = true\n AND (licensing->>'is_open_source')::boolean = true\n AND ($1::boolean IS NULL OR (licensing->>'commercial_use')::boolean = $1)\nORDER BY provider_id, name";
|
|
88
|
+
export interface GetOpenSourceModelsArgs {
|
|
89
|
+
commercialUse: boolean;
|
|
90
|
+
}
|
|
91
|
+
export interface GetOpenSourceModelsRow {
|
|
92
|
+
id: string;
|
|
93
|
+
providerId: string;
|
|
94
|
+
modelId: string;
|
|
95
|
+
slug: string;
|
|
96
|
+
name: string;
|
|
97
|
+
displayName: string | null;
|
|
98
|
+
description: string | null;
|
|
99
|
+
version: string | null;
|
|
100
|
+
capabilities: any;
|
|
101
|
+
classification: any;
|
|
102
|
+
architecture: any;
|
|
103
|
+
performance: any;
|
|
104
|
+
tokenInfo: any;
|
|
105
|
+
pricing: any;
|
|
106
|
+
apiDetails: any;
|
|
107
|
+
training: any;
|
|
108
|
+
licensing: any;
|
|
109
|
+
safety: any;
|
|
110
|
+
availability: any;
|
|
111
|
+
technicalSpecs: any;
|
|
112
|
+
releaseDate: Date | null;
|
|
113
|
+
trainingDataCutoff: Date | null;
|
|
114
|
+
deprecationDate: Date | null;
|
|
115
|
+
metadata: any;
|
|
116
|
+
lastScrapedAt: Date | null;
|
|
117
|
+
isActive: boolean | null;
|
|
118
|
+
isDeprecated: boolean | null;
|
|
119
|
+
createdAt: Date | null;
|
|
120
|
+
updatedAt: Date | null;
|
|
121
|
+
}
|
|
122
|
+
export declare function getOpenSourceModels(client: Client, args: GetOpenSourceModelsArgs): Promise<GetOpenSourceModelsRow[]>;
|
|
123
|
+
export declare const getModelsBySafetyQuery = "-- name: GetModelsBySafety :many\nSELECT id, provider_id, model_id, slug, name, display_name, description, version, capabilities, classification, architecture, performance, token_info, pricing, api_details, training, licensing, safety, availability, technical_specs, release_date, training_data_cutoff, deprecation_date, metadata, last_scraped_at, is_active, is_deprecated, created_at, updated_at\nFROM llm_models\nWHERE is_active = true\n AND ($1::text IS NULL OR safety->>'moderation_level' = $1)\n AND ($2::boolean IS NULL OR (safety->>'gdpr_compliant')::boolean = $2)\n AND ($3::boolean IS NULL OR (safety->>'hipaa_compliant')::boolean = $3)\nORDER BY provider_id, name";
|
|
124
|
+
export interface GetModelsBySafetyArgs {
|
|
125
|
+
moderationLevel: string;
|
|
126
|
+
gdprCompliant: boolean;
|
|
127
|
+
hipaaCompliant: boolean;
|
|
128
|
+
}
|
|
129
|
+
export interface GetModelsBySafetyRow {
|
|
130
|
+
id: string;
|
|
131
|
+
providerId: string;
|
|
132
|
+
modelId: string;
|
|
133
|
+
slug: string;
|
|
134
|
+
name: string;
|
|
135
|
+
displayName: string | null;
|
|
136
|
+
description: string | null;
|
|
137
|
+
version: string | null;
|
|
138
|
+
capabilities: any;
|
|
139
|
+
classification: any;
|
|
140
|
+
architecture: any;
|
|
141
|
+
performance: any;
|
|
142
|
+
tokenInfo: any;
|
|
143
|
+
pricing: any;
|
|
144
|
+
apiDetails: any;
|
|
145
|
+
training: any;
|
|
146
|
+
licensing: any;
|
|
147
|
+
safety: any;
|
|
148
|
+
availability: any;
|
|
149
|
+
technicalSpecs: any;
|
|
150
|
+
releaseDate: Date | null;
|
|
151
|
+
trainingDataCutoff: Date | null;
|
|
152
|
+
deprecationDate: Date | null;
|
|
153
|
+
metadata: any;
|
|
154
|
+
lastScrapedAt: Date | null;
|
|
155
|
+
isActive: boolean | null;
|
|
156
|
+
isDeprecated: boolean | null;
|
|
157
|
+
createdAt: Date | null;
|
|
158
|
+
updatedAt: Date | null;
|
|
159
|
+
}
|
|
160
|
+
export declare function getModelsBySafety(client: Client, args: GetModelsBySafetyArgs): Promise<GetModelsBySafetyRow[]>;
|
|
161
|
+
export declare const getModelsByParameterCountQuery = "-- name: GetModelsByParameterCount :many\nSELECT id, provider_id, model_id, slug, name, display_name, description, version, capabilities, classification, architecture, performance, token_info, pricing, api_details, training, licensing, safety, availability, technical_specs, release_date, training_data_cutoff, deprecation_date, metadata, last_scraped_at, is_active, is_deprecated, created_at, updated_at\nFROM llm_models\nWHERE is_active = true\n AND ($1::bigint IS NULL OR (architecture->>'parameter_count')::bigint >= $1)\n AND ($2::bigint IS NULL OR (architecture->>'parameter_count')::bigint <= $2)\nORDER BY (architecture->>'parameter_count')::bigint DESC";
|
|
162
|
+
export interface GetModelsByParameterCountArgs {
|
|
163
|
+
minParams: string;
|
|
164
|
+
maxParams: string;
|
|
165
|
+
}
|
|
166
|
+
export interface GetModelsByParameterCountRow {
|
|
167
|
+
id: string;
|
|
168
|
+
providerId: string;
|
|
169
|
+
modelId: string;
|
|
170
|
+
slug: string;
|
|
171
|
+
name: string;
|
|
172
|
+
displayName: string | null;
|
|
173
|
+
description: string | null;
|
|
174
|
+
version: string | null;
|
|
175
|
+
capabilities: any;
|
|
176
|
+
classification: any;
|
|
177
|
+
architecture: any;
|
|
178
|
+
performance: any;
|
|
179
|
+
tokenInfo: any;
|
|
180
|
+
pricing: any;
|
|
181
|
+
apiDetails: any;
|
|
182
|
+
training: any;
|
|
183
|
+
licensing: any;
|
|
184
|
+
safety: any;
|
|
185
|
+
availability: any;
|
|
186
|
+
technicalSpecs: any;
|
|
187
|
+
releaseDate: Date | null;
|
|
188
|
+
trainingDataCutoff: Date | null;
|
|
189
|
+
deprecationDate: Date | null;
|
|
190
|
+
metadata: any;
|
|
191
|
+
lastScrapedAt: Date | null;
|
|
192
|
+
isActive: boolean | null;
|
|
193
|
+
isDeprecated: boolean | null;
|
|
194
|
+
createdAt: Date | null;
|
|
195
|
+
updatedAt: Date | null;
|
|
196
|
+
}
|
|
197
|
+
export declare function getModelsByParameterCount(client: Client, args: GetModelsByParameterCountArgs): Promise<GetModelsByParameterCountRow[]>;
|
|
198
|
+
export declare const getModelsByContextWindowQuery = "-- name: GetModelsByContextWindow :many\nSELECT id, provider_id, model_id, slug, name, display_name, description, version, capabilities, classification, architecture, performance, token_info, pricing, api_details, training, licensing, safety, availability, technical_specs, release_date, training_data_cutoff, deprecation_date, metadata, last_scraped_at, is_active, is_deprecated, created_at, updated_at\nFROM llm_models \nWHERE is_active = true\n AND ($1::int IS NULL OR (token_info->>'context_window')::int >= $1)\n AND ($2::int IS NULL OR (token_info->>'context_window')::int <= $2)\nORDER BY (token_info->>'context_window')::int DESC";
|
|
199
|
+
export interface GetModelsByContextWindowArgs {
|
|
200
|
+
minContext: number;
|
|
201
|
+
maxContext: number;
|
|
202
|
+
}
|
|
203
|
+
export interface GetModelsByContextWindowRow {
|
|
204
|
+
id: string;
|
|
205
|
+
providerId: string;
|
|
206
|
+
modelId: string;
|
|
207
|
+
slug: string;
|
|
208
|
+
name: string;
|
|
209
|
+
displayName: string | null;
|
|
210
|
+
description: string | null;
|
|
211
|
+
version: string | null;
|
|
212
|
+
capabilities: any;
|
|
213
|
+
classification: any;
|
|
214
|
+
architecture: any;
|
|
215
|
+
performance: any;
|
|
216
|
+
tokenInfo: any;
|
|
217
|
+
pricing: any;
|
|
218
|
+
apiDetails: any;
|
|
219
|
+
training: any;
|
|
220
|
+
licensing: any;
|
|
221
|
+
safety: any;
|
|
222
|
+
availability: any;
|
|
223
|
+
technicalSpecs: any;
|
|
224
|
+
releaseDate: Date | null;
|
|
225
|
+
trainingDataCutoff: Date | null;
|
|
226
|
+
deprecationDate: Date | null;
|
|
227
|
+
metadata: any;
|
|
228
|
+
lastScrapedAt: Date | null;
|
|
229
|
+
isActive: boolean | null;
|
|
230
|
+
isDeprecated: boolean | null;
|
|
231
|
+
createdAt: Date | null;
|
|
232
|
+
updatedAt: Date | null;
|
|
233
|
+
}
|
|
234
|
+
export declare function getModelsByContextWindow(client: Client, args: GetModelsByContextWindowArgs): Promise<GetModelsByContextWindowRow[]>;
|
|
235
|
+
export declare const getModelsByPriceRangeQuery = "-- name: GetModelsByPriceRange :many\nSELECT id, provider_id, model_id, slug, name, display_name, description, version, capabilities, classification, architecture, performance, token_info, pricing, api_details, training, licensing, safety, availability, technical_specs, release_date, training_data_cutoff, deprecation_date, metadata, last_scraped_at, is_active, is_deprecated, created_at, updated_at\nFROM llm_models\nWHERE is_active = true\n AND ($1::numeric IS NULL OR (pricing->>'input_price')::numeric <= $1)\n AND ($2::numeric IS NULL OR (pricing->>'output_price')::numeric <= $2)\nORDER BY (pricing->>'input_price')::numeric ASC";
|
|
236
|
+
export interface GetModelsByPriceRangeArgs {
|
|
237
|
+
maxInputPrice: string;
|
|
238
|
+
maxOutputPrice: string;
|
|
239
|
+
}
|
|
240
|
+
export interface GetModelsByPriceRangeRow {
|
|
241
|
+
id: string;
|
|
242
|
+
providerId: string;
|
|
243
|
+
modelId: string;
|
|
244
|
+
slug: string;
|
|
245
|
+
name: string;
|
|
246
|
+
displayName: string | null;
|
|
247
|
+
description: string | null;
|
|
248
|
+
version: string | null;
|
|
249
|
+
capabilities: any;
|
|
250
|
+
classification: any;
|
|
251
|
+
architecture: any;
|
|
252
|
+
performance: any;
|
|
253
|
+
tokenInfo: any;
|
|
254
|
+
pricing: any;
|
|
255
|
+
apiDetails: any;
|
|
256
|
+
training: any;
|
|
257
|
+
licensing: any;
|
|
258
|
+
safety: any;
|
|
259
|
+
availability: any;
|
|
260
|
+
technicalSpecs: any;
|
|
261
|
+
releaseDate: Date | null;
|
|
262
|
+
trainingDataCutoff: Date | null;
|
|
263
|
+
deprecationDate: Date | null;
|
|
264
|
+
metadata: any;
|
|
265
|
+
lastScrapedAt: Date | null;
|
|
266
|
+
isActive: boolean | null;
|
|
267
|
+
isDeprecated: boolean | null;
|
|
268
|
+
createdAt: Date | null;
|
|
269
|
+
updatedAt: Date | null;
|
|
270
|
+
}
|
|
271
|
+
export declare function getModelsByPriceRange(client: Client, args: GetModelsByPriceRangeArgs): Promise<GetModelsByPriceRangeRow[]>;
|
|
272
|
+
export {};
|