feat(models): version official specifications and preserve catalog provenance
This commit is contained in:
@@ -51,10 +51,10 @@ export function messagesBody(config, messages, tools, native) {
|
||||
});
|
||||
return { model: config.model, ...(system.length ? { system } : {}), messages: wire,
|
||||
...(definitions.length ? { tools: definitions, tool_choice: { type: 'auto' } } : {}),
|
||||
// Messages requires max_tokens, even in passthrough mode. Prefer the
|
||||
// synchronized upstream maximum; native parameters below remain exact.
|
||||
// Standard Anthropic requires max_tokens; a reviewed compatible HTTP
|
||||
// dialect may explicitly permit omission. Native parameters remain exact.
|
||||
// A saved connection declaration is a fallback, never a verified maximum.
|
||||
max_tokens: isPassthrough(config) ? protocolOutput : config.maxOutputTokens,
|
||||
...(!isPassthrough(config) || protocolOutput !== undefined ? { max_tokens: isPassthrough(config) ? protocolOutput : config.maxOutputTokens } : {}),
|
||||
stream: config.streaming === true, ...native.nativeParameters };
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ export function modelSnapshot(config) {
|
||||
...(config.protocol === 'anthropic-messages' ? { messagesAuth: config.messagesAuth ?? 'api-key' } : {}),
|
||||
...(config.nativeParameters ? { nativeParameters: structuredClone(config.nativeParameters), outputTokenField: config.outputTokenField } : {}),
|
||||
...(config.parameterProfile ? { parameterProfile: config.parameterProfile } : {}),
|
||||
...(config.modelSpecification ? { modelSpecification: structuredClone(config.modelSpecification), modelSpecificationFrozen: config.modelSpecificationFrozen === true } : {}),
|
||||
...(config.modelConnectionId ? { modelConnectionId: config.modelConnectionId, modelCredentialRevision: config.modelCredentialRevision } : {}),
|
||||
...(config.modelRouting ? { routing: structuredClone(config.modelRouting) } : {}),
|
||||
};
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { resolveModelSpecification } from './official-model-registry.mjs';
|
||||
|
||||
export const MODEL_PROTOCOLS = ['chat-completions', 'responses', 'anthropic-messages'];
|
||||
export const MODEL_CAPABILITIES = ['text', 'tools', 'streaming', 'vision', 'audio'];
|
||||
const failure = message => Object.assign(new Error(message), { status: 400 });
|
||||
@@ -19,12 +21,13 @@ export function capabilityDeclarations(input, previous = null) {
|
||||
}
|
||||
|
||||
export function capabilityView(connection, credentialRevision = 0) {
|
||||
const declarations = capabilityDeclarations(undefined, connection.capabilityDeclarations);
|
||||
const evidence = connection.capabilityEvidence;
|
||||
const current = evidence?.connectionRevision === connection.revision && evidence?.credentialRevision === credentialRevision;
|
||||
return Object.fromEntries(MODEL_CAPABILITIES.map(key => [key,
|
||||
declarations[key] === 'unsupported' ? 'unsupported' : current && evidence.results?.[key] === 'verified' ? 'verified'
|
||||
: declarations[key] === 'supported' ? 'protocol_declared' : 'unknown']));
|
||||
const specification = resolveModelSpecification({ ...connection, capabilityDeclarations: capabilityDeclarations(undefined, connection.capabilityDeclarations),
|
||||
...(!connection.capabilityDeclarations ? { capabilityDeclarationSources: { text: 'protocol', tools: 'protocol' } } : {}) }, credentialRevision);
|
||||
return Object.fromEntries(MODEL_CAPABILITIES.map(key => {
|
||||
const fact = specification.fields['capabilities.' + key];
|
||||
return [key, fact?.value === 'unsupported' ? 'unsupported' : fact?.kind === 'revision_bound_observation' ? 'verified'
|
||||
: fact?.value === 'supported' ? 'protocol_declared' : 'unknown'];
|
||||
}));
|
||||
}
|
||||
|
||||
export function capabilityRejections(connection, requirements, credentialRevision = 0) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
export const DEFAULT_MODEL_CAPACITY: Readonly<{ contextLimit: number; maxOutputTokens: number }>;
|
||||
export const CAPACITY_RANGES: Readonly<Record<'contextLimit' | 'maxOutputTokens', number[]>>;
|
||||
export function capacitySettings(input?: { contextLimit?: number; maxOutputTokens?: number }, previous?: { contextLimit?: number; maxOutputTokens?: number }): { contextLimit: number; maxOutputTokens: number };
|
||||
export function capacityMode(value?: string): 'model' | 'manual';
|
||||
export function messagesOutputSetting(config: { model?: string; nativeParameters?: Record<string, unknown>; maxOutputTokens?: number; upstreamModel?: { id: string; maxOutputTokens?: number | null } }): { value: unknown; source: string };
|
||||
export function modelCapacityDeclaration(config: { model?: string; upstreamModel?: { id: string; contextLimit?: number | null; maxOutputTokens?: number | null } }, field: 'contextLimit' | 'maxOutputTokens'): { value: number; source: 'upstream_catalog' | 'official_model_spec'; sourceUrl?: string; checkedAt?: string } | null;
|
||||
export function capacityMode(value?: string): 'passthrough' | 'model' | 'manual';
|
||||
export function messagesOutputSetting(config: import('./official-model-registry.mjs').ModelSpecConnection & { maxOutputTokens?: number }): { value: unknown; source: string };
|
||||
export function modelCapacityDeclaration(config: import('./official-model-registry.mjs').ModelSpecConnection, field: 'contextLimit' | 'maxOutputTokens'): { value: number; source: string; sourceUrl?: string | null; checkedAt?: string | null; sourceSha256?: string | null; conflict?: boolean; provider?: string } | null;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { unrestricted } from './execution-policy.mjs';
|
||||
import { officialModelCapacity } from './official-model-capacity.mjs';
|
||||
import { resolveModelSpecification } from './official-model-registry.mjs';
|
||||
|
||||
// Editable fallbacks for upstreams that do not publish capacity. These values
|
||||
// are not verified model capabilities or ceilings on larger models.
|
||||
@@ -20,16 +21,19 @@ export const isPassthrough = config => config.capacityMode === 'passthrough';
|
||||
export function modelCapacityDeclaration(config, field) {
|
||||
if (!['contextLimit', 'maxOutputTokens'].includes(field)) return null;
|
||||
const member = config.modelRouting?.members?.find(value => value.id === config.modelConnectionId) ?? config;
|
||||
const upstream = member.upstreamModel;
|
||||
if (upstream?.id === member.model && Number.isSafeInteger(upstream[field]) && upstream[field] > 0) return { value: upstream[field], source: 'upstream_catalog' };
|
||||
const official = officialModelCapacity(member.model);
|
||||
return official ? { value: official[field], source: official.source, sourceUrl: official.sourceUrl, checkedAt: official.checkedAt } : null;
|
||||
const fact = resolveModelSpecification(member).fields[field];
|
||||
if (fact) return Number.isSafeInteger(fact.value) && fact.value > 0 ? { value: fact.value, source: fact.kind, sourceUrl: fact.url, checkedAt: fact.checkedAt,
|
||||
sourceSha256: fact.sha256, provider: fact.provider, conflict: fact.conflict, alternatives: fact.alternatives } : null;
|
||||
const official = officialModelCapacity(member.model, { providerId: member.providerId, apiVersion: member.apiVersion, protocol: member.protocol });
|
||||
return official && Number.isSafeInteger(official[field]) && official[field] > 0 ? { value: official[field], source: official.source, sourceUrl: official.sourceUrl, checkedAt: official.checkedAt,
|
||||
sourceSha256: official.sourceSha256, provider: official.provider } : null;
|
||||
}
|
||||
|
||||
export function messagesOutputSetting(config) {
|
||||
const member = config.modelRouting?.members?.find(value => value.id === config.modelConnectionId) ?? config;
|
||||
const native = config.nativeParameters ?? member.nativeParameters ?? {};
|
||||
if (Object.hasOwn(native, 'max_tokens')) return { value: native.max_tokens, source: 'explicit_native' };
|
||||
if (resolveModelSpecification(member).fields['request.maxTokensRequired']?.value === false) return { value: undefined, source: 'upstream_optional' };
|
||||
const declaration = modelCapacityDeclaration(config, 'maxOutputTokens');
|
||||
if (declaration) return declaration;
|
||||
return { value: member.maxOutputTokens ?? config.maxOutputTokens ?? DEFAULT_MODEL_CAPACITY.maxOutputTokens, source: 'connection_declaration' };
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
export interface CatalogModel {
|
||||
id: string; name: string; owner: string; lifecycle: string | null; contextLimit: number | null; maxOutputTokens: number | null;
|
||||
id: string; name: string; owner: string; lifecycle: string | null; contextLimit: number | null; maxOutputTokens: number | null; maxInputTokens?: number | null;
|
||||
capabilityDeclarations: Record<string, string>; features: Record<string, string>; efforts: string[]; modes: string[]; parameters: string[]; metadataSource: string;
|
||||
effortSupport?: Record<string, string>; modeSupport?: Record<string, string>;
|
||||
reportedFields?: string[]; defaultEffort?: string; defaultMode?: string; modeEfforts?: Record<string, string[]>;
|
||||
inputModalities?: string[]; outputModalities?: string[]; nativeTools?: string[];
|
||||
apiCapabilities?: Record<string, Record<string, unknown>>; rawItem?: Record<string, unknown>; rawRepresentation?: string; rawSha256?: string; rawBytes?: number;
|
||||
endpoint?: string; fetchedAt?: string;
|
||||
}
|
||||
export interface CatalogPreview {
|
||||
id: string; entries: CatalogModel[]; fetchedAt: string; expiresAt: string; complete: boolean; warning: string;
|
||||
@@ -9,4 +13,4 @@ export interface CatalogPreview {
|
||||
}
|
||||
export function catalogRoute(config: { protocol?: string; baseUrl: string }): string;
|
||||
export function catalogModel(item: unknown, config?: { executionMode?: string }): CatalogModel;
|
||||
export function catalogPage(response: unknown, config?: { executionMode?: string }): { entries: CatalogModel[]; hasMore: boolean; cursor: string };
|
||||
export function catalogPage(response: unknown, config?: { executionMode?: string }): { entries: CatalogModel[]; hasMore: boolean; cursor: string; cursorParameter: 'pageToken' | 'after_id' };
|
||||
|
||||
@@ -7,6 +7,14 @@ const supported = value => typeof value === 'boolean' ? value ? 'supported' : 'u
|
||||
: typeof value?.supported === 'boolean' ? value.supported ? 'supported' : 'unsupported'
|
||||
: ['supported', 'unsupported', 'unknown'].includes(value) ? value : 'unknown';
|
||||
const positive = value => Number.isSafeInteger(value) && value > 0 ? value : null;
|
||||
const object = value => value && typeof value === 'object' && !Array.isArray(value) ? value : {};
|
||||
const strings = value => Array.isArray(value) ? [...new Set(value.filter(item => typeof item === 'string' && item && !/[\x00-\x1f\x7f]/.test(item)))] : [];
|
||||
const sensitiveFields = /^(?:api[-_]?key|access[-_]?token|refresh[-_]?token|authorization|x-api-key|secret|password|credential)$/i;
|
||||
function rawDeclaration(value) {
|
||||
if (Array.isArray(value)) return value.map(rawDeclaration);
|
||||
if (value && typeof value === 'object') return Object.fromEntries(Object.entries(value).map(([key, data]) => [key, sensitiveFields.test(key) ? '[redacted]' : rawDeclaration(data)]));
|
||||
return value;
|
||||
}
|
||||
|
||||
export function catalogRoute(config) {
|
||||
const protocol = modelProtocol(config.protocol);
|
||||
@@ -15,18 +23,19 @@ export function catalogRoute(config) {
|
||||
}
|
||||
|
||||
// Metadata is an upstream declaration, never capability-test evidence. Keep
|
||||
// unsupported adapter features visible without passing arbitrary vendor fields.
|
||||
// unsupported adapter features visible. Retain unknown vendor fields as a
|
||||
// redacted declaration; none of those fields is copied into a model request.
|
||||
export function catalogModel(item, config = {}) {
|
||||
if (typeof item === 'string') item = { id: item };
|
||||
if (!item || typeof item !== 'object' || Array.isArray(item)) throw fail('上游模型目录含无效条目。');
|
||||
const field = (value, maximum = 200) => text(value, ceiling(config, maximum));
|
||||
const id = field(item.id ?? item.name);
|
||||
if (!id || id.length !== String(item.id ?? item.name).trim().length || /[\x00-\x1f\x7f]/.test(id)) throw fail('上游模型名称为空、过长或含控制字符。');
|
||||
const caps = item.capabilities && typeof item.capabilities === 'object' && !Array.isArray(item.capabilities) ? item.capabilities : {};
|
||||
const caps = object(item.capabilities), reportedFields = [];
|
||||
const declarations = Object.fromEntries(['text', 'tools', 'streaming', 'vision', 'audio'].map(key => [key,
|
||||
supported(caps[key] ?? (key === 'vision' ? caps.image_input : key === 'tools' ? caps.tool_calling ?? caps.function_calling : undefined))]));
|
||||
const input = item.input_modalities ?? item.architecture?.input_modalities;
|
||||
const output = item.output_modalities ?? item.architecture?.output_modalities;
|
||||
const input = item.input_modalities ?? item.architecture?.input_modalities ?? item.modalities?.input;
|
||||
const output = item.output_modalities ?? item.architecture?.output_modalities ?? item.modalities?.output;
|
||||
if (Array.isArray(input)) {
|
||||
if (input.includes('image') && declarations.vision === 'unknown') declarations.vision = 'supported';
|
||||
if (input.includes('audio') && declarations.audio === 'unknown') declarations.audio = 'supported';
|
||||
@@ -34,25 +43,48 @@ export function catalogModel(item, config = {}) {
|
||||
if (Array.isArray(output) && output.includes('text') && declarations.text === 'unknown') declarations.text = 'supported';
|
||||
const parameters = Array.isArray(item.supported_parameters) ? [...new Set(item.supported_parameters.filter(value => typeof value === 'string' && (unrestricted(config) || value.length <= 80)))].slice(0, ceiling(config, 80)) : [];
|
||||
if (declarations.tools === 'unknown' && parameters.includes('tools')) declarations.tools = 'supported';
|
||||
const effortSupport = Object.fromEntries(['minimal', 'low', 'medium', 'high', 'xhigh', 'max'].map(value => [value, supported(caps.effort?.[value])]));
|
||||
const modeSupport = Object.fromEntries(['disabled', 'enabled', 'adaptive', 'between_tools'].map(value => [value, supported(caps.thinking?.types?.[value])]));
|
||||
const efforts = Object.keys(effortSupport).filter(value => effortSupport[value] === 'supported');
|
||||
const modes = Object.keys(modeSupport).filter(value => modeSupport[value] === 'supported');
|
||||
const features = Object.fromEntries(['thinking', 'effort', 'pdf_input', 'structured_outputs', 'server_tools', 'code_execution', 'batch', 'citations', 'context_management'].map(key => [key, supported(caps[key])]));
|
||||
const effortDeclaration = item.effort ?? caps.effort;
|
||||
const reportedEfforts = effortDeclaration?.supported_levels ?? item.reasoning_efforts;
|
||||
const reportedModes = caps.thinking?.supported_types ?? item.thinking?.supported_types;
|
||||
const effortSupport = Object.fromEntries([...new Set(['none', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max', ...Object.keys(object(caps.effort)), ...strings(reportedEfforts)])]
|
||||
.filter(value => !['supported', 'supported_levels', 'default_level'].includes(value)).map(value => [value, supported(caps.effort?.[value])]));
|
||||
const modeSupport = Object.fromEntries([...new Set(['disabled', 'enabled', 'adaptive', 'between_tools', ...Object.keys(object(caps.thinking?.types)), ...strings(reportedModes)])]
|
||||
.map(value => [value, supported(caps.thinking?.types?.[value])]));
|
||||
if (Array.isArray(reportedEfforts)) {
|
||||
reportedFields.push('efforts');
|
||||
for (const value of strings(reportedEfforts)) if (effortSupport[value] !== 'unsupported') effortSupport[value] = 'supported';
|
||||
}
|
||||
if (Array.isArray(reportedModes)) {
|
||||
reportedFields.push('modes');
|
||||
for (const value of strings(reportedModes)) if (modeSupport[value] !== 'unsupported') modeSupport[value] = 'supported';
|
||||
}
|
||||
const efforts = (Array.isArray(reportedEfforts) ? strings(reportedEfforts) : Object.keys(effortSupport)).filter(value => effortSupport[value] === 'supported');
|
||||
const modes = (Array.isArray(reportedModes) ? strings(reportedModes) : Object.keys(modeSupport)).filter(value => modeSupport[value] === 'supported');
|
||||
const features = Object.fromEntries(['thinking', 'effort', 'pdf_input', 'structured_outputs', 'json_output', 'prompt_caching', 'server_tools', 'code_execution', 'batch', 'citations', 'context_management'].map(key => [key, supported(caps[key])]));
|
||||
if (features.effort === 'unknown' && Array.isArray(reportedEfforts)) features.effort = reportedEfforts.length ? 'supported' : 'unsupported';
|
||||
return { id, name: field(item.display_name ?? item.displayName ?? item.name ?? id), owner: field(item.owned_by ?? item.provider, 100),
|
||||
lifecycle: ['active', 'deprecated', 'retired'].includes(item.lifecycle) ? item.lifecycle : null,
|
||||
contextLimit: positive(item.context_length ?? item.max_input_tokens ?? item.context_window ?? item.inputTokenLimit),
|
||||
contextLimit: positive(item.context_length ?? item.context_window), maxInputTokens: positive(item.max_input_tokens ?? item.inputTokenLimit),
|
||||
maxOutputTokens: positive(item.max_output_tokens ?? item.max_tokens ?? item.top_provider?.max_completion_tokens ?? item.outputTokenLimit),
|
||||
capabilityDeclarations: declarations, features, efforts, modes, effortSupport, modeSupport, parameters,
|
||||
metadataSource: 'upstream-model-list' };
|
||||
...(typeof effortDeclaration?.default_level === 'string' ? { defaultEffort: effortDeclaration.default_level } : {}),
|
||||
...(typeof item.thinking?.default_type === 'string' ? { defaultMode: item.thinking.default_type } : {}),
|
||||
...(Array.isArray(input) ? { inputModalities: strings(input) } : {}), ...(Array.isArray(output) ? { outputModalities: strings(output) } : {}),
|
||||
...(Array.isArray(item.native_tools) ? { nativeTools: strings(item.native_tools) } : {}),
|
||||
apiCapabilities: structuredClone(object(item.api_capabilities)), reportedFields,
|
||||
rawItem: rawDeclaration(item), rawRepresentation: 'parsed-redacted-item-json-v1', metadataSource: 'upstream-model-list' };
|
||||
}
|
||||
|
||||
export function catalogPage(response, config = {}) {
|
||||
const data = response?.data ?? response?.models;
|
||||
if (!Array.isArray(data)) throw fail('上游未返回 data 或 models 模型列表;可核对接口或使用手动兼容入口。');
|
||||
const entries = data.map(item => catalogModel(item, config));
|
||||
const hasMore = response.has_more === true;
|
||||
const cursor = hasMore ? text(response.last_id ?? entries.at(-1)?.id, ceiling(config, 200)) : '';
|
||||
const pageToken = response.nextPageToken ?? response.next_page_token;
|
||||
const hasMore = response.has_more === true || typeof pageToken === 'string' && pageToken.length > 0;
|
||||
const cursorParameter = typeof pageToken === 'string' && pageToken ? 'pageToken' : 'after_id';
|
||||
const value = hasMore ? cursorParameter === 'pageToken' ? pageToken : response.last_id ?? entries.at(-1)?.id : '';
|
||||
const cursor = text(value, ceiling(config, 200));
|
||||
if (hasMore && (typeof value !== 'string' || cursor.length !== value.trim().length || /[\x00-\x1f\x7f]/.test(cursor))) throw fail('上游下一页游标无效。');
|
||||
if (hasMore && !cursor) throw fail('上游声明还有下一页,却未提供有效游标。');
|
||||
return { entries, hasMore, cursor };
|
||||
return { entries, hasMore, cursor, cursorParameter };
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
export interface ParameterConnection {
|
||||
import type { ModelSpecConnection } from './official-model-registry.mjs';
|
||||
export interface ParameterConnection extends ModelSpecConnection {
|
||||
protocol?: string; parameterProfile?: string; brand?: string; model?: string; baseUrl?: string;
|
||||
nativeParameters?: Record<string, unknown>; capabilities?: Record<string, string>; capabilityDeclarations?: Record<string, string>;
|
||||
upstreamModel?: import('./model-catalog.mjs').CatalogModel;
|
||||
@@ -8,8 +9,9 @@ export const messagesEfforts: string[];
|
||||
export function parameterProfiles(protocol: string): { id: string; label: string }[];
|
||||
export function parameterProfileSettings(protocol: string, value?: string): string;
|
||||
export function modelParameterProfile(connection: ParameterConnection): { id: string; label: string; source: string; sourceKind: string;
|
||||
officialSource: { url: string; effortUrl: string; checkedAt: string } | null; efforts: string[]; thinking: boolean; modes: string[];
|
||||
modeEfforts: Record<string, readonly string[]>; defaultMode: string | null; defaultEffort: string | null };
|
||||
officialSource: { url: string; effortUrl: string; checkedAt: string; provider: string; apiVersion: string } | null; efforts: string[]; thinking: boolean; modes: string[];
|
||||
modeEfforts: Record<string, readonly string[]>; defaultMode: string | null; defaultEffort: string | null; thinkingBudget: string;
|
||||
specification: import('./official-model-registry.mjs').ModelSpecification };
|
||||
export function assertModelParameterSupport(connection: ParameterConnection, parameters: Record<string, unknown>): void;
|
||||
export function reasoningSetting(connection: ParameterConnection, parameters: Record<string, unknown>): { mode: string; effort: string; budget: number; canResetMode: boolean; thinkingSiblings: boolean };
|
||||
export function changeReasoningSetting(connection: ParameterConnection, parameters: Record<string, unknown>, field: string, value: string | number): Record<string, unknown>;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { officialModelParameters } from './official-model-parameters.mjs';
|
||||
import { modelProvider, officialModelRecord, matchingUpstreamModel, resolveModelSpecification } from './official-model-registry.mjs';
|
||||
|
||||
export const reasoningEfforts = ['none', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'];
|
||||
export const messagesEfforts = ['low', 'medium', 'high', 'xhigh', 'max'];
|
||||
@@ -18,6 +18,7 @@ export function parameterProfileSettings(protocol, value = 'auto') {
|
||||
// proxy or particular model supports every field in that protocol.
|
||||
function declaredChoices(metadata, field, supportField, feature, fallback, official) {
|
||||
if (metadata?.features?.[feature] === 'unsupported') return [];
|
||||
if (metadata?.reportedFields?.includes(field)) return (metadata[field] ?? []).filter(value => metadata[supportField]?.[value] !== 'unsupported');
|
||||
const values = metadata?.[field] ?? [], support = metadata?.[supportField];
|
||||
if (support && Object.values(support).some(value => value !== 'unknown')) {
|
||||
return [...new Set([...fallback, ...values, ...Object.keys(support)])].filter(value => support[value] === 'supported'
|
||||
@@ -29,31 +30,49 @@ function declaredChoices(metadata, field, supportField, feature, fallback, offic
|
||||
export function modelParameterProfile(connection) {
|
||||
const protocol = connection.protocol ?? 'chat-completions';
|
||||
const selected = parameterProfileSettings(protocol, connection.parameterProfile);
|
||||
const official = selected === 'auto' && protocol === 'anthropic-messages' ? officialModelParameters(connection.model) : null;
|
||||
const deepseek = connection.brand === 'DeepSeek' || /^deepseek(?:-|$)/i.test(connection.model ?? '')
|
||||
|| /^https:\/\/api\.deepseek\.com(?:\/|$)/i.test(connection.baseUrl ?? '') || !!connection.nativeParameters?.thinking && protocol === 'chat-completions';
|
||||
const id = selected !== 'auto' ? selected : official ? 'anthropic' : deepseek ? 'deepseek' : protocol === 'anthropic-messages' ? 'anthropic' : 'openai';
|
||||
const metadata = !connection.model || connection.upstreamModel?.id === connection.model ? connection.upstreamModel : null;
|
||||
const provider = modelProvider(connection), official = selected === 'auto' ? officialModelRecord(connection) : null;
|
||||
const id = selected !== 'auto' ? selected : ['openai', 'anthropic', 'deepseek'].includes(provider.id) ? provider.id : protocol === 'anthropic-messages' ? 'anthropic' : 'openai';
|
||||
const metadata = matchingUpstreamModel(connection), specification = resolveModelSpecification(connection);
|
||||
const field = key => {
|
||||
const fact = specification.fields[key];
|
||||
if (!fact) return null;
|
||||
if (selected === 'auto' || fact.kind !== 'official_model_spec') return fact;
|
||||
return fact.alternatives.find(value => value.kind !== 'official_model_spec') ?? null;
|
||||
};
|
||||
const choices = id === 'deepseek' ? ['low', 'high', 'max'] : protocol === 'anthropic-messages' ? messagesEfforts : reasoningEfforts.filter(value => value !== 'none');
|
||||
const modes = official?.modes ?? ['disabled', 'enabled', ...(protocol === 'anthropic-messages' ? ['adaptive', 'between_tools'] : [])];
|
||||
return { id, label: labels[id], source: metadata ? '优先采用相符型号的上游目录声明,缺失项再匹配官方规格或兼容格式'
|
||||
: official ? '按 Anthropic 官方精确型号规格匹配' : selected === 'auto' ? '按品牌、型号与协议匹配;未取得的型号能力待确认' : '用户选择的兼容格式,不套用官方型号后备选项',
|
||||
sourceKind: metadata ? 'upstream_model_list' : official ? 'official_model_spec' : 'compatibility_profile',
|
||||
officialSource: official ? { url: official.sourceUrl, effortUrl: official.effortSourceUrl, checkedAt: official.checkedAt } : null,
|
||||
efforts: declaredChoices(metadata, 'efforts', 'effortSupport', 'effort', official?.efforts ?? choices, !!official),
|
||||
modes: declaredChoices(metadata, 'modes', 'modeSupport', 'thinking', modes, !!official),
|
||||
modeEfforts: official?.modeEfforts ?? {}, defaultMode: official?.defaultMode ?? null, defaultEffort: official?.defaultEffort ?? null,
|
||||
thinking: protocol === 'anthropic-messages' || id === 'deepseek' && protocol === 'chat-completions' };
|
||||
const optionValues = (key, supportKey, feature, fallback) => {
|
||||
const fact = field(key), featureFact = field('features.' + feature);
|
||||
if (featureFact?.value === 'unsupported') return [];
|
||||
if (fact?.kind === 'explicit_compatibility') return fact.value;
|
||||
const known = fact?.value ?? fallback;
|
||||
return declaredChoices(metadata, key, supportKey, feature, known, !!official || !!fact);
|
||||
};
|
||||
const modes = optionValues('modes', 'modeSupport', 'thinking', ['disabled', 'enabled', ...(protocol === 'anthropic-messages' ? ['adaptive', 'between_tools'] : [])]);
|
||||
const modeFact = field('modes'), effortFact = field('efforts');
|
||||
const origin = modeFact?.kind ?? effortFact?.kind;
|
||||
const sourceKind = origin === 'explicit_compatibility' ? origin : metadata ? 'upstream_model_list' : official ? 'official_model_spec' : 'compatibility_profile';
|
||||
const officialFact = [modeFact, effortFact].find(value => value?.kind === 'official_model_spec');
|
||||
return { id, label: labels[id], source: sourceKind === 'explicit_compatibility' ? '采用用户显式兼容覆盖;原目录与官方来源另行保留'
|
||||
: metadata ? '优先采用相符型号的上游目录声明,缺失项再匹配精确官方规格或兼容格式'
|
||||
: official ? '按供应商、精确型号和协议匹配官方规格' : selected === 'auto' ? '未取得精确型号能力;以下为协议兼容选项,支持情况待确认' : '用户选择的兼容格式,不套用官方型号后备选项',
|
||||
sourceKind, officialSource: officialFact ? { url: officialFact.url.split('#')[0], effortUrl: effortFact?.url?.split('#')[0] ?? officialFact.url.split('#')[0], checkedAt: officialFact.checkedAt,
|
||||
provider: provider.id, apiVersion: official?.apiVersion ?? specification.officialRecord?.apiVersion ?? null } : null,
|
||||
efforts: optionValues('efforts', 'effortSupport', 'effort', choices).filter(value => value !== 'none'), modes,
|
||||
modeEfforts: field('modeEfforts')?.value ?? {}, defaultMode: field('defaultMode')?.value ?? null, defaultEffort: field('defaultEffort')?.value ?? null,
|
||||
thinking: protocol === 'anthropic-messages' || id === 'deepseek' && protocol === 'chat-completions',
|
||||
thinkingBudget: field('request.thinkingBudget')?.value === 'ignored' || id === 'deepseek' ? 'ignored' : protocol === 'anthropic-messages' ? 'required' : 'unknown',
|
||||
specification };
|
||||
}
|
||||
|
||||
export function assertModelParameterSupport(connection, parameters) {
|
||||
const metadata = !connection.model || connection.upstreamModel?.id === connection.model ? connection.upstreamModel : null;
|
||||
const metadata = matchingUpstreamModel(connection);
|
||||
if (!metadata) return;
|
||||
const overrides = connection.modelOverrides ?? {};
|
||||
const effort = parameters.reasoning_effort ?? parameters.reasoning?.effort ?? parameters.output_config?.effort;
|
||||
const mode = parameters.thinking?.type;
|
||||
if (effort && (metadata.features?.effort === 'unsupported' || metadata.effortSupport?.[effort] === 'unsupported' || effort !== 'none' && metadata.efforts?.length && !metadata.efforts.includes(effort)))
|
||||
if (effort && !overrides.efforts?.includes(effort) && overrides.features?.effort !== 'supported' && (metadata.features?.effort === 'unsupported' || metadata.effortSupport?.[effort] === 'unsupported' || effort !== 'none' && (metadata.efforts?.length || metadata.reportedFields?.includes('efforts')) && !metadata.efforts.includes(effort)))
|
||||
throw Object.assign(new Error('上游目录声明该型号不支持所选推理强度,请选择支持的档位或保留默认。'), { status: 400 });
|
||||
if (mode && (metadata.features?.thinking === 'unsupported' || metadata.modeSupport?.[mode] === 'unsupported' || metadata.modes?.length && !metadata.modes.includes(mode)))
|
||||
if (mode && !overrides.modes?.includes(mode) && overrides.features?.thinking !== 'supported' && (metadata.features?.thinking === 'unsupported' || metadata.modeSupport?.[mode] === 'unsupported' || (metadata.modes?.length || metadata.reportedFields?.includes('modes')) && !metadata.modes.includes(mode)))
|
||||
throw Object.assign(new Error('上游目录声明该型号不支持所选推理模式,请选择支持的模式或保留默认。'), { status: 400 });
|
||||
}
|
||||
|
||||
@@ -92,9 +111,10 @@ export function changeReasoningSetting(connection, parameters, field, value) {
|
||||
}
|
||||
}
|
||||
else if (profile.thinking) {
|
||||
editObject('thinking', value === 'enabled' && protocol === 'anthropic-messages'
|
||||
const budgetRequired = value === 'enabled' && profile.thinkingBudget === 'required';
|
||||
editObject('thinking', budgetRequired
|
||||
? { type: value, budget_tokens: parameters.thinking?.budget_tokens ?? 1024 } : { type: value },
|
||||
value === 'enabled' && protocol === 'anthropic-messages' ? [] : ['budget_tokens']);
|
||||
value === 'enabled' ? [] : ['budget_tokens']);
|
||||
} else {
|
||||
setEffort(value === 'disabled' ? 'none' : reasoningSetting(connection, parameters).effort || (profile.efforts.includes('medium') ? 'medium' : profile.efforts[0] ?? ''));
|
||||
}
|
||||
@@ -104,14 +124,17 @@ export function changeReasoningSetting(connection, parameters, field, value) {
|
||||
|
||||
export function modelFeatureRows(connection) {
|
||||
const states = { supported: '声明支持', unsupported: '声明不支持', unknown: '待确认', verified: '已验证', protocol_declared: '声明支持' };
|
||||
const declared = key => states[connection.capabilities?.[key] ?? connection.capabilityDeclarations?.[key] ?? 'unknown'] ?? '待确认';
|
||||
const specification = resolveModelSpecification(connection);
|
||||
const declared = key => states[connection.capabilities?.[key] ?? specification.fields['capabilities.' + key]?.value ?? 'unknown'] ?? '待确认';
|
||||
const feature = key => states[specification.fields['features.' + key]?.value ?? 'unknown'];
|
||||
return [
|
||||
{ name: '文本 / 工具调用', upstream: declared('text') + ' / ' + declared('tools'), local: '已接入,可单独检测' },
|
||||
{ name: '流式输出', upstream: declared('streaming'), local: '已接入,按连接开关发送' },
|
||||
{ name: '图像输入', upstream: declared('vision'), local: '已接入 PNG,可单独检测' },
|
||||
{ name: '推理模式 / 强度', upstream: modelParameterProfile(connection).source, local: '按原生字段发送;本地默认不限,协议条件以上游为准' },
|
||||
{ name: '语音 / 视频 / 服务端工具', upstream: '需供应商提供相应协议', local: '尚未接入' },
|
||||
{ name: '结构化输出约束', upstream: states[connection.upstreamModel?.features?.structured_outputs ?? 'unknown'], local: '开放模式可透传约束参数;完整结果校验流程待接入' },
|
||||
...(connection.upstreamModel ? [{ name: 'PDF / 服务端工具 / 批处理', upstream: ['pdf_input', 'server_tools', 'batch'].map(key => states[connection.upstreamModel.features?.[key] ?? 'unknown']).join(' / '), local: '目录声明已同步,执行能力尚未接入' }] : []),
|
||||
{ name: '结构化输出约束', upstream: feature('structured_outputs'), local: '开放模式可透传约束参数;完整结果校验流程待接入' },
|
||||
{ name: 'PDF / 服务端工具 / 批处理', upstream: ['pdf_input', 'server_tools', 'batch'].map(feature).join(' / '), local: '来源声明已同步,执行能力尚未接入' },
|
||||
{ name: '提示缓存', upstream: feature('prompt_caching'), local: '自动前缀缓存用量已记录;显式缓存块接入另行验证' },
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { capabilityView } from './model-capabilities.mjs';
|
||||
import { matchingUpstreamModel, resolveModelSpecification } from './official-model-registry.mjs';
|
||||
|
||||
// This is an automatic-selection policy, not a gate on an explicitly selected
|
||||
// connection. Keep the observations bound to the frozen member/revisions.
|
||||
@@ -8,24 +9,30 @@ export function modelRoutingDecision(routing, requirements, { open = false, prob
|
||||
const candidates = routing.members.map(member => {
|
||||
const required = probe ? [] : [...new Set([...requirements, ...(member.streaming ? ['streaming'] : [])])];
|
||||
const view = capabilityView(member, member.credentialRevision);
|
||||
const upstream = member.upstreamModel;
|
||||
const catalog = upstream?.id === member.model && (!upstream.endpoint || upstream.endpoint === member.baseUrl) ? upstream : null;
|
||||
const specification = resolveModelSpecification(member, member.credentialRevision), catalog = matchingUpstreamModel(member);
|
||||
const capabilities = Object.fromEntries(required.map(capability => {
|
||||
let state = view[capability] ?? 'unknown';
|
||||
let source = state === 'verified' ? 'revision-bound-observation' : state === 'unknown' ? 'unknown' : 'connection-declaration';
|
||||
if (automatic && catalog?.capabilityDeclarations?.[capability] === 'unsupported') {
|
||||
const fact = specification.fields['capabilities.' + capability];
|
||||
let source = state === 'unknown' ? 'unknown' : ({ revision_bound_observation: 'revision-bound-observation', upstream_catalog: 'upstream-model-list', official_model_spec: 'official-model-spec',
|
||||
explicit_compatibility: 'explicit-compatibility', protocol_declaration: 'protocol-declaration' }[fact?.kind] ?? 'connection-declaration');
|
||||
if (state === 'protocol_declared' && fact?.kind === 'upstream_catalog') state = 'upstream_declared';
|
||||
if (state === 'protocol_declared' && fact?.kind === 'official_model_spec') state = 'official_declared';
|
||||
if (automatic && catalog?.capabilityDeclarations?.[capability] === 'unsupported' && fact?.kind !== 'explicit_compatibility' && state !== 'verified') {
|
||||
state = 'unsupported'; source = 'upstream-model-list';
|
||||
} else if (automatic && state === 'unknown' && catalog?.capabilityDeclarations?.[capability] === 'supported') {
|
||||
state = 'upstream_declared'; source = 'upstream-model-list';
|
||||
}
|
||||
return [capability, { state, source }];
|
||||
return [capability, { state, source, ...(fact ? { specification: { kind: fact.kind, conflict: fact.conflict, sourceId: fact.sourceId ?? null, apiVersion: fact.apiVersion ?? null, url: fact.url ?? null } } : {}) }];
|
||||
}));
|
||||
const reasons = required.filter(capability => capabilities[capability].state === 'unsupported' || !passthrough && !automatic && capabilities[capability].state === 'unknown')
|
||||
.map(capability => ({ capability, ...capabilities[capability], reason: capabilities[capability].state === 'unsupported' ? '明确声明不支持所需能力' : '尚未声明或验证所需能力' }));
|
||||
if (automatic && catalog?.lifecycle === 'retired') reasons.push({ capability: 'lifecycle', state: 'retired', source: 'upstream-model-list', reason: '相符上游目录已标记型号退役' });
|
||||
const lifecycle = specification.fields.lifecycle;
|
||||
if (automatic && lifecycle?.value === 'retired') reasons.push({ capability: 'lifecycle', state: 'retired', source: lifecycle.kind === 'upstream_catalog' ? 'upstream-model-list' : lifecycle.kind,
|
||||
reason: '当前型号来源已标记退役' });
|
||||
const unavailable = availability(member);
|
||||
return { connectionId: member.id, connectionName: member.name, model: member.model, protocol: member.protocol ?? 'chat-completions',
|
||||
connectionRevision: member.revision, credentialRevision: member.credentialRevision, requirements: required, capabilities,
|
||||
registryVersion: specification.registryVersion, officialRecord: specification.officialRecord,
|
||||
...(catalog ? { catalog: { id: catalog.id, fetchedAt: catalog.fetchedAt ?? null, lifecycle: catalog.lifecycle ?? null, source: 'upstream-model-list' } } : {}),
|
||||
tier: passthrough ? 'passthrough' : reasons.length ? 'unsupported' : Object.values(capabilities).some(value => value.state === 'unknown') ? 'unverified' : 'known',
|
||||
reasons, unavailable, disposition: unavailable ? 'unavailable' : !passthrough && reasons.length ? 'excluded' : 'eligible' };
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
// Exact pinned IDs from Anthropic's Models overview, checked 2026-11-06.
|
||||
// These are synchronous Messages declarations, not measured gateway limits.
|
||||
// The separate 300K Message Batches beta is not used for ordinary requests.
|
||||
const sourceUrl = 'https://platform.claude.com/docs/en/models/overview';
|
||||
const claude = Object.freeze(Object.fromEntries([
|
||||
'claude-fable-5-1', 'claude-opus-5-5', 'claude-sonnet-5-5', 'claude-haiku-5-5',
|
||||
].map(model => [model, Object.freeze({ model, contextLimit: 1000000, maxOutputTokens: 128000,
|
||||
sourceUrl, checkedAt: '2026-11-06', source: 'official_model_spec' })])));
|
||||
import { modelRegistry, officialModelRecord } from './official-model-registry.mjs';
|
||||
|
||||
export function officialModelCapacity(model) {
|
||||
return typeof model === 'string' && Object.hasOwn(claude, model) ? claude[model] : null;
|
||||
// Capacity is a published model reference, independent of whether the selected
|
||||
// gateway/protocol was actually validated. Retain the legacy model-only view.
|
||||
export function officialModelCapacity(model, options = {}) {
|
||||
if (typeof model !== 'string') return null;
|
||||
let entry = officialModelRecord({ model, ...options });
|
||||
if (!entry && !options.providerId && !options.apiVersion) {
|
||||
const rows = modelRegistry.records.filter(value => value.model === model);
|
||||
if (rows.length && new Set(rows.map(value => JSON.stringify([value.fields.contextLimit?.value, value.fields.maxOutputTokens?.value]))).size === 1) entry = rows[0];
|
||||
}
|
||||
const capacity = entry?.fields.contextLimit, output = entry?.fields.maxOutputTokens;
|
||||
if (!capacity && !output) return null;
|
||||
const source = modelRegistry.sources.find(value => value.id === (capacity ?? output).source);
|
||||
return { model, contextLimit: capacity?.value ?? null, maxOutputTokens: output?.value ?? null,
|
||||
sourceUrl: source.url, checkedAt: source.checkedAt, source: 'official_model_spec',
|
||||
provider: entry.provider, protocol: entry.protocol, apiVersion: entry.apiVersion, registryVersion: modelRegistry.version, sourceSha256: source.sha256 };
|
||||
}
|
||||
|
||||
@@ -1,20 +1,12 @@
|
||||
// Exact Messages IDs checked against Anthropic's thinking and effort articles
|
||||
// on 2026-11-06. These are published defaults, not proof of proxy support.
|
||||
// Broader provider/version discovery belongs to the capability registry.
|
||||
const sourceUrl = 'https://platform.claude.com/docs/en/build-with-claude/thinking';
|
||||
const effortSourceUrl = 'https://platform.claude.com/docs/en/build-with-claude/effort';
|
||||
const efforts = Object.freeze(['low', 'medium', 'high', 'xhigh', 'max']);
|
||||
const lowerEfforts = Object.freeze(['low', 'medium', 'high']);
|
||||
const entries = [
|
||||
['claude-fable-5-1', ['adaptive'], 'high', {}],
|
||||
['claude-opus-5-5', ['adaptive'], 'medium', {}],
|
||||
['claude-sonnet-5-5', ['adaptive', 'between_tools'], 'high', { between_tools: lowerEfforts }],
|
||||
['claude-haiku-5-5', ['disabled', 'adaptive'], 'medium', { disabled: lowerEfforts }],
|
||||
];
|
||||
const models = Object.freeze(Object.fromEntries(entries.map(([model, modes, defaultEffort, modeEfforts]) => [model,
|
||||
Object.freeze({ model, modes: Object.freeze(modes), efforts, defaultMode: 'adaptive', defaultEffort, modeEfforts: Object.freeze(modeEfforts),
|
||||
sourceUrl, effortSourceUrl, checkedAt: '2026-11-06', source: 'official_model_spec' })])));
|
||||
import { modelRegistry, officialModelRecord } from './official-model-registry.mjs';
|
||||
|
||||
// Retained exact Anthropic view. The registry owns the reviewed options and
|
||||
// conditional combinations, so old helpers and new UI use the same facts.
|
||||
export function officialModelParameters(model) {
|
||||
return typeof model === 'string' && Object.hasOwn(models, model) ? models[model] : null;
|
||||
const entry = officialModelRecord({ model, providerId: 'anthropic', protocol: 'anthropic-messages' });
|
||||
if (!entry) return null;
|
||||
const field = key => entry.fields[key]?.value;
|
||||
const source = key => modelRegistry.sources.find(value => value.id === entry.fields[key]?.source);
|
||||
return { model, modes: field('modes'), efforts: field('efforts'), defaultMode: field('defaultMode'), defaultEffort: field('defaultEffort'), modeEfforts: field('modeEfforts') ?? {},
|
||||
sourceUrl: source('modes')?.url, effortSourceUrl: source('efforts')?.url, checkedAt: source('modes')?.checkedAt, source: 'official_model_spec' };
|
||||
}
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
// Reviewed exact IDs and protocol conditions from the pinned official sources.
|
||||
// A declaration here never means that a particular credential/route was tested.
|
||||
const fact = (value, source, anchor = '') => ({ value, source, anchor });
|
||||
const record = (provider, protocol, apiVersion, model, fields) => ({ provider, protocol, apiVersion, model, fields });
|
||||
|
||||
const openaiModels = [
|
||||
{ model: 'gpt-6-astra', efforts: ['low', 'medium', 'high', 'xhigh', 'max'], defaultEffort: null },
|
||||
{ model: 'gpt-6-sol', efforts: ['none', 'low', 'medium', 'high', 'xhigh', 'max'], defaultEffort: 'medium', chatTools: 'reasoning-none' },
|
||||
{ model: 'gpt-6-luna', efforts: ['none', 'low', 'medium', 'high', 'xhigh', 'max'], defaultEffort: 'medium', chatTools: 'reasoning-none' },
|
||||
{ model: 'gpt-6.1-sol', efforts: ['low', 'medium', 'high', 'xhigh', 'max'], defaultEffort: 'medium', chatTools: 'responses-only' },
|
||||
{ model: 'gpt-6.1-terra', efforts: ['none', 'low', 'medium', 'high', 'xhigh', 'max'], defaultEffort: 'medium', chatTools: 'responses-only' },
|
||||
];
|
||||
const nativeTools = ['web_search', 'file_search', 'image_generation', 'code_interpreter', 'hosted_shell', 'apply_patch', 'skills', 'computer_use', 'mcp', 'tool_search'];
|
||||
const openai = openaiModels.flatMap(item => ['chat-completions', 'responses'].map(protocol => {
|
||||
const source = 'openai-' + item.model, value = (data, anchor) => fact(data, source, anchor);
|
||||
return record('openai', protocol, 'v1', item.model, {
|
||||
contextLimit: value(1050000, 'current-snapshot-details'), maxInputTokens: value(922000, 'current-snapshot-details'), maxOutputTokens: value(128000, 'current-snapshot-details'),
|
||||
'capabilities.text': value('supported', 'current-snapshot-details'), 'capabilities.vision': value('supported', 'current-snapshot-details'),
|
||||
'capabilities.tools': value(protocol === 'chat-completions' && item.chatTools === 'responses-only' ? 'unsupported' : 'supported', ''),
|
||||
'capabilities.streaming': value('supported', 'current-snapshot-details'),
|
||||
'features.thinking': value('supported', ''), 'features.effort': value('supported', ''),
|
||||
'features.structured_outputs': value('supported', 'current-snapshot-details'), 'features.prompt_caching': value('supported', 'current-snapshot-details'),
|
||||
inputModalities: value(['text', 'image'], 'current-snapshot-details'), outputModalities: value(['text'], 'current-snapshot-details'),
|
||||
efforts: value(item.efforts, ''), modes: value(item.efforts.includes('none') ? ['disabled', 'enabled'] : ['enabled'], ''),
|
||||
defaultEffort: value(item.defaultEffort, ''),
|
||||
...(protocol === 'responses' ? { nativeTools: value(nativeTools, 'supported-tools') } : {}),
|
||||
...(protocol === 'chat-completions' && item.chatTools ? { toolsCondition: value(item.chatTools, '') } : {}),
|
||||
});
|
||||
}));
|
||||
|
||||
const claudeModels = [
|
||||
['claude-fable-5-1', ['adaptive'], 'high', {}],
|
||||
['claude-opus-5-5', ['adaptive'], 'medium', {}],
|
||||
['claude-sonnet-5-5', ['adaptive', 'between_tools'], 'high', { between_tools: ['low', 'medium', 'high'] }],
|
||||
['claude-haiku-5-5', ['disabled', 'adaptive'], 'medium', { disabled: ['low', 'medium', 'high'] }],
|
||||
];
|
||||
const claude = claudeModels.map(([model, modes, defaultEffort, modeEfforts]) => {
|
||||
const overview = value => fact(value, 'claude-models__overview', 'latest-models-comparison');
|
||||
const thinking = value => fact(value, 'claude-build-with-claude__thinking', 'configuring-thinking');
|
||||
const effort = value => fact(value, 'claude-effort', 'effort-levels');
|
||||
return record('anthropic', 'anthropic-messages', '2026-10-21', model, {
|
||||
contextLimit: overview(1000000), maxOutputTokens: overview(128000),
|
||||
'capabilities.text': overview('supported'), 'capabilities.tools': overview('supported'), 'capabilities.vision': overview('supported'),
|
||||
inputModalities: overview(['text', 'image']), outputModalities: overview(['text']),
|
||||
'features.thinking': thinking('supported'), 'features.effort': effort('supported'),
|
||||
modes: thinking(modes), efforts: effort(['low', 'medium', 'high', 'xhigh', 'max']), modeEfforts: thinking(modeEfforts),
|
||||
defaultMode: thinking('adaptive'), defaultEffort: fact(defaultEffort, 'claude-build-with-claude__thinking-steering-and-cost', 'effort-levels'),
|
||||
'features.prompt_caching': fact('supported', 'claude-build-with-claude__prompt-caching', ''),
|
||||
});
|
||||
});
|
||||
|
||||
const deepseek = ['deepseek-flash', 'deepseek-v4-pro', 'deepseek-v4-flash', 'deepseek-v4-flash-vision-exp'].flatMap(model => ['chat-completions', 'responses', 'anthropic-messages'].map(protocol => {
|
||||
const flash = model !== 'deepseek-v4-pro', alias = !['deepseek-flash', 'deepseek-v4-pro'].includes(model);
|
||||
const limits = value => fact(value, 'deepseek-model-list', ''), pricing = value => fact(value, 'deepseek-models', 'model-details');
|
||||
const protocolSource = protocol === 'anthropic-messages' ? 'deepseek-message' : protocol === 'responses' ? 'deepseek-response' : 'deepseek-create';
|
||||
const native = value => fact(value, protocolSource, '');
|
||||
return record('deepseek', protocol, protocol === 'anthropic-messages' ? '2023-06-01' : 'v1', model, {
|
||||
contextLimit: limits(1048576), maxOutputTokens: limits(393216),
|
||||
'capabilities.text': pricing('supported'), 'capabilities.tools': pricing('supported'), 'capabilities.vision': pricing(flash ? 'supported' : 'unsupported'),
|
||||
inputModalities: limits(flash ? ['text', 'image'] : ['text']), outputModalities: limits(['text']),
|
||||
'features.thinking': native('supported'), 'features.effort': native('supported'),
|
||||
efforts: limits(['low', 'high', 'max']), defaultEffort: limits('high'),
|
||||
modes: native(protocol === 'anthropic-messages' ? ['disabled', 'enabled', 'adaptive'] : ['disabled', 'enabled']),
|
||||
defaultMode: native('enabled'),
|
||||
'features.prompt_caching': fact('supported', 'deepseek-cache', ''),
|
||||
...(protocol === 'anthropic-messages' ? {
|
||||
'request.systemPromptUpdate': limits(flash ? 'in-history' : 'leading-only'),
|
||||
'request.versionHandling': native('ignored'),
|
||||
'request.thinkingBudget': native('ignored'),
|
||||
'features.structured_outputs': native('unsupported'),
|
||||
} : { 'features.structured_outputs': native(protocol === 'responses' ? 'supported' : 'unsupported'), 'features.json_output': native('supported') }),
|
||||
'request.maxTokensRequired': native(false),
|
||||
...(alias ? { lifecycle: pricing('deprecated'), aliasOf: pricing('deepseek-flash'), 'request.aliasAccepted': pricing(true), 'request.originalModelRetired': pricing(true) } : {}),
|
||||
});
|
||||
}));
|
||||
|
||||
export const officialModelRecords = [...openai, ...claude, ...deepseek];
|
||||
@@ -0,0 +1,13 @@
|
||||
export interface ModelSpecField { value: unknown; kind: string; note?: string; provider?: string; apiVersion?: string; url?: string | null; checkedAt?: string | null; sha256?: string | null; sourceId?: string; alternatives: Omit<ModelSpecField, 'alternatives' | 'conflict'>[]; conflict: boolean }
|
||||
export interface ModelSpecification { schemaVersion: number; registryVersion: string; model: string; protocol: string; provider: string | null; providerSource: string; apiVersion: string | null; officialRecord: { provider: string; protocol: string; apiVersion: string; model: string } | null; fields: Record<string, ModelSpecField>; conflicts: string[]; liveCompatibility: string }
|
||||
export interface ModelSpecConnection { model?: string; protocol?: string; baseUrl?: string; providerId?: string; apiVersion?: string; nativeParameters?: Record<string, unknown>; modelOverrides?: Record<string, unknown>; modelSpecification?: ModelSpecification; modelSpecificationFrozen?: boolean; upstreamModel?: import('./model-catalog.mjs').CatalogModel; capabilityDeclarations?: Record<string, string>; capabilityDeclarationSources?: Record<string, string>; credentialRevision?: number; revision?: number; capabilityEvidence?: { connectionRevision?: number; credentialRevision?: number; results?: Record<string, string>; checkedAt?: string } }
|
||||
export const MODEL_REGISTRY_SCHEMA: number;
|
||||
export const MODEL_REGISTRY_VERSION: string;
|
||||
export const modelRegistry: Readonly<{ schemaVersion: number; version: string; sources: readonly { id: string; provider: string; url: string; checkedAt: string; sha256: string }[]; records: readonly { provider: string; protocol: string; apiVersion: string; model: string; fields: Record<string, { value: unknown; source: string; anchor: string }> }[] }>;
|
||||
export function validateModelRegistry(input: unknown): unknown;
|
||||
export function modelProvider(connection?: ModelSpecConnection): { id: string | null; source: string };
|
||||
export function officialModelRecord(connection?: ModelSpecConnection): (typeof modelRegistry.records)[number] | null;
|
||||
export function matchingUpstreamModel(connection?: ModelSpecConnection): import('./model-catalog.mjs').CatalogModel | null;
|
||||
export function modelOverrideSettings(input?: unknown, previous?: Record<string, unknown>): Record<string, unknown>;
|
||||
export function resolveModelSpecification(connection?: ModelSpecConnection, credentialRevision?: number): ModelSpecification;
|
||||
export function specificationField(connection: ModelSpecConnection, field: string): ModelSpecField | null;
|
||||
@@ -0,0 +1,153 @@
|
||||
import sources from './official-model-sources.json' with { type: 'json' };
|
||||
import { officialModelRecords } from './official-model-registry-data.mjs';
|
||||
|
||||
export const MODEL_REGISTRY_SCHEMA = 1;
|
||||
export const MODEL_REGISTRY_VERSION = sources.registryVersion;
|
||||
const capabilities = ['text', 'tools', 'streaming', 'vision', 'audio'];
|
||||
const providers = { 'api.openai.com': 'openai', 'api.anthropic.com': 'anthropic', 'api.deepseek.com': 'deepseek', 'api.moonshot.ai': 'moonshot', 'api.moonshot.cn': 'moonshot', 'generativelanguage.googleapis.com': 'google' };
|
||||
const state = value => ['supported', 'unsupported', 'unknown'].includes(value);
|
||||
const officialHosts = { openai: ['developers.openai.com', 'platform.openai.com', 'learn.chatgpt.com'], anthropic: ['platform.claude.com', 'docs.anthropic.com', 'docs.claude.com'], deepseek: ['api-docs.deepseek.com'], google: ['ai.google.dev', 'cloud.google.com', 'docs.cloud.google.com'], moonshot: ['platform.moonshot.ai', 'platform.moonshot.cn'] };
|
||||
const stringList = value => Array.isArray(value) && value.every(item => typeof item === 'string' && item && !/[\x00-\x1f\x7f]/.test(item));
|
||||
const failure = message => Object.assign(new Error(message), { status: 400 });
|
||||
function jsonValue(value, active = new Set()) {
|
||||
if (value === null || typeof value === 'string' || typeof value === 'boolean' || typeof value === 'number' && Number.isFinite(value)) return true;
|
||||
if (!value || typeof value !== 'object' || active.has(value) || !Array.isArray(value) && ![Object.prototype, null].includes(Object.getPrototypeOf(value))) return false;
|
||||
active.add(value); const valid = Object.values(value).every(item => jsonValue(item, active)); active.delete(value); return valid;
|
||||
}
|
||||
const freeze = value => { if (value && typeof value === 'object' && !Object.isFrozen(value)) { Object.values(value).forEach(freeze); Object.freeze(value); } return value; };
|
||||
|
||||
export function validateModelRegistry(input) {
|
||||
if (!jsonValue(input) || input?.schemaVersion !== MODEL_REGISTRY_SCHEMA || typeof input.version !== 'string' || !input.version || !Array.isArray(input.records) || !Array.isArray(input.sources)) throw failure('模型注册表版本或结构无效。');
|
||||
const ids = new Set(), sourceIds = new Map();
|
||||
for (const source of input.sources) {
|
||||
if (!source || typeof source !== 'object' || Array.isArray(source)) throw failure('官方来源记录结构无效。');
|
||||
let url; try { url = new URL(source.url); } catch { throw failure('官方来源地址无效。'); }
|
||||
if (typeof source.id !== 'string' || !source.id || sourceIds.has(source.id) || url.protocol !== 'https:' || url.username || url.password || !officialHosts[source.provider]?.includes(url.hostname)
|
||||
|| !/^[a-f0-9]{64}$/.test(source.sha256) || !/^\d{4}-\d{2}-\d{2}$/.test(source.checkedAt) || !Number.isFinite(Date.parse(source.checkedAt))) throw failure('官方来源标识、供应商地址、日期或 SHA256 无效。');
|
||||
sourceIds.set(source.id, source.provider);
|
||||
}
|
||||
for (const entry of input.records) {
|
||||
if (!entry || typeof entry !== 'object' || Array.isArray(entry)) throw failure('官方型号记录结构无效。');
|
||||
const id = JSON.stringify([entry.provider, entry.protocol, entry.apiVersion, entry.model]);
|
||||
if (ids.has(id) || [entry.provider, entry.protocol, entry.apiVersion, entry.model].some(value => typeof value !== 'string' || !value || /[\x00-\x1f\x7f]/.test(value)) || !entry.fields || typeof entry.fields !== 'object' || Array.isArray(entry.fields)) throw failure('官方型号、协议、版本或重复记录无效。');
|
||||
ids.add(id);
|
||||
for (const [key, field] of Object.entries(entry.fields)) {
|
||||
if (!key || !field || sourceIds.get(field.source) !== entry.provider || !jsonValue(field.value) || field.anchor !== undefined && typeof field.anchor !== 'string') throw failure('官方字段必须引用所属供应商的已固定来源并保存合法 JSON 值。');
|
||||
if (['contextLimit', 'maxInputTokens', 'maxOutputTokens'].includes(key) && field.value !== null && (!Number.isSafeInteger(field.value) || field.value < 1)) throw failure('官方容量字段需要正安全整数或明确未知。');
|
||||
if (/^(?:capabilities|features)\./.test(key) && !state(field.value)) throw failure('官方能力字段只能声明支持、不支持或未知。');
|
||||
if (['efforts', 'modes', 'inputModalities', 'outputModalities', 'nativeTools'].includes(key) && !stringList(field.value)) throw failure('官方模型选项必须保存字符串数组。');
|
||||
if (['defaultMode', 'defaultEffort', 'aliasOf'].includes(key) && field.value !== null && (typeof field.value !== 'string' || !field.value)) throw failure('官方默认选项或别名无效。');
|
||||
if (key === 'modeEfforts' && (!field.value || typeof field.value !== 'object' || Array.isArray(field.value) || Object.values(field.value).some(value => !stringList(value)))) throw failure('官方模式强度组合无效。');
|
||||
if (key === 'lifecycle' && !['active', 'deprecated', 'retired', 'unknown'].includes(field.value)) throw failure('官方模型生命周期无效。');
|
||||
}
|
||||
}
|
||||
return input;
|
||||
}
|
||||
|
||||
export const modelRegistry = freeze(validateModelRegistry({ schemaVersion: MODEL_REGISTRY_SCHEMA, version: MODEL_REGISTRY_VERSION, sources: sources.sources, records: officialModelRecords }));
|
||||
const sourceMap = new Map(modelRegistry.sources.map(source => [source.id, source]));
|
||||
|
||||
export function modelProvider(connection = {}) {
|
||||
if (connection.providerId && !['auto', 'custom'].includes(connection.providerId)) return { id: connection.providerId, source: 'explicit-provider' };
|
||||
if (connection.providerId !== 'custom') {
|
||||
try { const id = providers[new URL(connection.baseUrl).hostname]; if (id) return { id, source: 'official-endpoint' }; } catch { /* Unfinished draft or absent endpoint. */ }
|
||||
}
|
||||
const exact = [...new Set(modelRegistry.records.filter(entry => entry.model === connection.model).map(entry => entry.provider))];
|
||||
return { id: exact.length === 1 ? exact[0] : null, source: exact.length === 1 ? 'exact-model-reference' : 'unknown' };
|
||||
}
|
||||
|
||||
export function officialModelRecord(connection = {}) {
|
||||
const provider = modelProvider(connection), protocol = connection.protocol ?? 'chat-completions';
|
||||
const rows = modelRegistry.records.filter(entry => entry.provider === provider.id && entry.model === connection.model && entry.protocol === protocol);
|
||||
if (connection.apiVersion && connection.apiVersion !== 'auto') return rows.find(entry => entry.apiVersion === connection.apiVersion
|
||||
|| entry.fields['request.versionHandling']?.value === 'ignored') ?? null;
|
||||
return rows.length === 1 ? rows[0] : null;
|
||||
}
|
||||
|
||||
export function matchingUpstreamModel(connection = {}) {
|
||||
const item = connection.upstreamModel;
|
||||
return item?.id === connection.model && (!item.endpoint || item.endpoint === connection.baseUrl) ? item : null;
|
||||
}
|
||||
|
||||
export function modelOverrideSettings(input, previous = {}) {
|
||||
if (input === undefined) return structuredClone(previous);
|
||||
if (!input || typeof input !== 'object' || Array.isArray(input) || !jsonValue(input)) throw failure('模型兼容覆盖需要合法 JSON 对象。');
|
||||
const result = {};
|
||||
for (const [key, value] of Object.entries(input)) {
|
||||
if (['contextLimit', 'maxInputTokens', 'maxOutputTokens'].includes(key)) {
|
||||
if (value !== null && (!Number.isSafeInteger(value) || value < 1)) throw failure('模型容量覆盖需要正安全整数或 null(未知)。');
|
||||
} else if (['efforts', 'modes', 'inputModalities', 'outputModalities', 'nativeTools'].includes(key)) {
|
||||
if (!stringList(value)) throw failure('模型选项覆盖需要字符串数组。');
|
||||
} else if (['capabilities', 'features'].includes(key)) {
|
||||
if (!value || typeof value !== 'object' || Array.isArray(value) || Object.values(value).some(item => !state(item)) || key === 'capabilities' && Object.keys(value).some(item => !capabilities.includes(item))) throw failure('能力覆盖只能声明支持、不支持或未知。');
|
||||
} else if (['defaultMode', 'defaultEffort', 'lifecycle', 'note'].includes(key)) {
|
||||
if (value !== null && typeof value !== 'string') throw failure('模型默认选项或备注格式无效。');
|
||||
if (key === 'lifecycle' && !['active', 'deprecated', 'retired', 'unknown', null].includes(value)) throw failure('模型生命周期覆盖无效。');
|
||||
} else if (key === 'modeEfforts') {
|
||||
if (!value || typeof value !== 'object' || Array.isArray(value) || Object.values(value).some(item => !Array.isArray(item) || item.some(level => typeof level !== 'string'))) throw failure('模式强度组合覆盖格式无效。');
|
||||
} else throw failure('不支持的模型规格覆盖字段:' + key);
|
||||
Object.defineProperty(result, key, { value: structuredClone(value), enumerable: true, writable: true, configurable: true });
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function catalogFacts(item) {
|
||||
if (!item) return {};
|
||||
const fields = {};
|
||||
for (const key of ['contextLimit', 'maxInputTokens', 'maxOutputTokens', 'lifecycle', 'defaultEffort', 'defaultMode', 'inputModalities', 'outputModalities', 'nativeTools']) if (item[key] !== null && item[key] !== undefined) fields[key] = item[key];
|
||||
for (const [key, value] of Object.entries(item.capabilityDeclarations ?? {})) if (value !== 'unknown') fields['capabilities.' + key] = value;
|
||||
for (const [key, value] of Object.entries(item.features ?? {})) if (value !== 'unknown') fields['features.' + key] = value;
|
||||
for (const key of ['efforts', 'modes']) if (item[key]?.length || item.reportedFields?.includes(key) || item.features?.[key === 'efforts' ? 'effort' : 'thinking'] === 'unsupported') fields[key] = item[key] ?? [];
|
||||
if (item.modeEfforts) fields.modeEfforts = item.modeEfforts;
|
||||
if (item.apiCapabilities?.anthropic_messages?.system_prompt_update) fields['request.systemPromptUpdate'] = item.apiCapabilities.anthropic_messages.system_prompt_update;
|
||||
return fields;
|
||||
}
|
||||
|
||||
function overrideFacts(value) {
|
||||
const fields = {};
|
||||
for (const [key, item] of Object.entries(value ?? {})) if (['capabilities', 'features'].includes(key)) {
|
||||
for (const [name, data] of Object.entries(item)) fields[key + '.' + name] = data;
|
||||
} else if (key !== 'note') fields[key] = item;
|
||||
return fields;
|
||||
}
|
||||
|
||||
export function resolveModelSpecification(connection = {}, credentialRevision = connection.credentialRevision ?? 0) {
|
||||
if (connection.modelSpecificationFrozen === true && connection.modelSpecification?.model === connection.model && connection.modelSpecification.protocol === (connection.protocol ?? 'chat-completions')) return structuredClone(connection.modelSpecification);
|
||||
const provider = modelProvider(connection), entry = officialModelRecord(connection), catalog = matchingUpstreamModel(connection);
|
||||
const candidates = new Map(), add = (key, value, origin) => {
|
||||
const values = candidates.get(key) ?? [];
|
||||
values.push({ value: structuredClone(value), ...origin }); candidates.set(key, values);
|
||||
};
|
||||
const explicit = { kind: 'explicit_compatibility', note: connection.modelOverrides?.note ?? '用户显式兼容覆盖' };
|
||||
for (const [key, value] of Object.entries(overrideFacts(connection.modelOverrides))) add(key, value, explicit);
|
||||
// Legacy declarations have no trustworthy edit provenance. Preserve them as
|
||||
// explicit legacy settings, rather than guessing which ones were defaults.
|
||||
for (const [key, value] of Object.entries(connection.capabilityDeclarations ?? {})) {
|
||||
const origin = connection.capabilityDeclarationSources?.[key] ?? 'legacy_connection';
|
||||
if (['user', 'legacy_connection'].includes(origin) && value !== 'unknown') add('capabilities.' + key, value, { kind: origin === 'user' ? 'connection_declaration' : 'legacy_connection_declaration' });
|
||||
}
|
||||
const evidence = connection.capabilityEvidence;
|
||||
const current = evidence?.connectionRevision === connection.revision && evidence?.credentialRevision === credentialRevision;
|
||||
if (current) for (const key of capabilities) if (evidence.results?.[key] === 'verified') add('capabilities.' + key, 'supported', { kind: 'revision_bound_observation', checkedAt: evidence.checkedAt ?? null, connectionRevision: connection.revision, credentialRevision });
|
||||
for (const [key, value] of Object.entries(catalogFacts(catalog))) add(key, value, { kind: 'upstream_catalog', url: catalog.endpoint ?? null, checkedAt: catalog.fetchedAt ?? null, sha256: catalog.rawSha256 ?? null });
|
||||
if (entry) for (const [key, field] of Object.entries(entry.fields)) {
|
||||
const source = sourceMap.get(field.source);
|
||||
let value = field.value;
|
||||
if (key === 'capabilities.tools' && entry.fields.toolsCondition?.value === 'reasoning-none') value = connection.nativeParameters?.reasoning_effort === 'none' ? 'supported' : 'unsupported';
|
||||
add(key, value, { kind: 'official_model_spec', provider: entry.provider, apiVersion: entry.apiVersion, url: source.url + (field.anchor ? '#' + field.anchor : ''), checkedAt: source.checkedAt, sha256: source.sha256, sourceId: source.id });
|
||||
}
|
||||
for (const [key, value] of Object.entries(connection.capabilityDeclarations ?? {})) if (!candidates.has('capabilities.' + key) && value !== 'unknown') add('capabilities.' + key, value, { kind: 'protocol_declaration' });
|
||||
const fields = Object.fromEntries([...candidates].map(([key, values]) => {
|
||||
// Verified observations can strengthen support, but do not override an
|
||||
// explicit denial. Keep every conflicting declaration in the result.
|
||||
const selected = key.startsWith('capabilities.') && values[0].value === 'supported' ? values.find(value => value.kind === 'revision_bound_observation') ?? values[0] : values[0];
|
||||
return [key, { ...selected, alternatives: values.filter(value => value !== selected), conflict: values.some(value => JSON.stringify(value.value) !== JSON.stringify(selected.value)) }];
|
||||
}));
|
||||
return { schemaVersion: MODEL_REGISTRY_SCHEMA, registryVersion: MODEL_REGISTRY_VERSION, model: connection.model ?? '', protocol: connection.protocol ?? 'chat-completions',
|
||||
provider: provider.id, providerSource: provider.source, apiVersion: connection.apiVersion && connection.apiVersion !== 'auto' ? connection.apiVersion : entry?.apiVersion ?? null,
|
||||
officialRecord: entry ? { provider: entry.provider, protocol: entry.protocol, apiVersion: entry.apiVersion, model: entry.model } : null,
|
||||
fields, conflicts: Object.entries(fields).filter(([, value]) => value.conflict).map(([key]) => key),
|
||||
liveCompatibility: 'not_established_by_registry' };
|
||||
}
|
||||
|
||||
export function specificationField(connection, field) { return resolveModelSpecification(connection).fields[field] ?? null; }
|
||||
@@ -0,0 +1,194 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"registryVersion": "2026-11-07.1",
|
||||
"sources": [
|
||||
{
|
||||
"id": "claude-models__overview",
|
||||
"provider": "anthropic",
|
||||
"url": "https://platform.claude.com/docs/en/models/overview",
|
||||
"checkedAt": "2026-11-06",
|
||||
"sha256": "58a0bd14d9badfe29071397995bc87c1ced653a8b0acde20d34d85e3a9df5562",
|
||||
"file": "sources/claude-models-overview.md",
|
||||
"originalSha256": "04ced1978ad32f6015dfd82c4b4a89812f673411d4d0bd10aedb2957431d9907",
|
||||
"representation": "extracted-official-markdown",
|
||||
"scope": "complete-target-article-excerpt"
|
||||
},
|
||||
{
|
||||
"id": "claude-build-with-claude__thinking",
|
||||
"provider": "anthropic",
|
||||
"url": "https://platform.claude.com/docs/en/build-with-claude/thinking",
|
||||
"checkedAt": "2026-11-06",
|
||||
"sha256": "ff24b4c309610835c57611e4f5b6f8870b27950a8d4548bfae680c9eec1dfb42",
|
||||
"file": "sources/claude-build-with-claude-thinking.md",
|
||||
"originalSha256": "ff24b4c309610835c57611e4f5b6f8870b27950a8d4548bfae680c9eec1dfb42",
|
||||
"representation": "extracted-official-markdown",
|
||||
"scope": "complete-captured-source"
|
||||
},
|
||||
{
|
||||
"id": "claude-build-with-claude__thinking-steering-and-cost",
|
||||
"provider": "anthropic",
|
||||
"url": "https://platform.claude.com/docs/en/build-with-claude/thinking-steering-and-cost",
|
||||
"checkedAt": "2026-11-06",
|
||||
"sha256": "28b1226b41557efa8d43e3eb28aa038c70b96866939bf1e7cbfd976d82482854",
|
||||
"file": "sources/claude-build-with-claude-thinking-steering-and-cost.md",
|
||||
"originalSha256": "28b1226b41557efa8d43e3eb28aa038c70b96866939bf1e7cbfd976d82482854",
|
||||
"representation": "extracted-official-markdown",
|
||||
"scope": "complete-captured-source"
|
||||
},
|
||||
{
|
||||
"id": "claude-build-with-claude__prompt-caching",
|
||||
"provider": "anthropic",
|
||||
"url": "https://platform.claude.com/docs/en/build-with-claude/prompt-caching",
|
||||
"checkedAt": "2026-11-06",
|
||||
"sha256": "ff35232788f3f7fbd0f9aae002351567a9ea8e68e5b749069d96dab52882747d",
|
||||
"file": "sources/claude-build-with-claude-prompt-caching.md",
|
||||
"originalSha256": "ff35232788f3f7fbd0f9aae002351567a9ea8e68e5b749069d96dab52882747d",
|
||||
"representation": "extracted-official-markdown",
|
||||
"scope": "complete-captured-source"
|
||||
},
|
||||
{
|
||||
"id": "deepseek-create",
|
||||
"provider": "deepseek",
|
||||
"url": "https://api-docs.deepseek.com/api/create-chat-completion",
|
||||
"checkedAt": "2026-11-06",
|
||||
"sha256": "b43ca950bd04ae7f6f537b42e6cb729f543d942dcd848ec43ad4e9bfe059fe1f",
|
||||
"file": "sources/deepseek-create.body",
|
||||
"originalSha256": "b43ca950bd04ae7f6f537b42e6cb729f543d942dcd848ec43ad4e9bfe059fe1f",
|
||||
"representation": "received-html-bytes",
|
||||
"scope": "complete-captured-source"
|
||||
},
|
||||
{
|
||||
"id": "deepseek-thinking",
|
||||
"provider": "deepseek",
|
||||
"url": "https://api-docs.deepseek.com/guides/thinking_mode",
|
||||
"checkedAt": "2026-11-06",
|
||||
"sha256": "42151b5f86827bff663a61693080a61cdbf99074dee94af756c9fce855baa7cd",
|
||||
"file": "sources/deepseek-thinking.body",
|
||||
"originalSha256": "42151b5f86827bff663a61693080a61cdbf99074dee94af756c9fce855baa7cd",
|
||||
"representation": "received-html-bytes",
|
||||
"scope": "complete-captured-source"
|
||||
},
|
||||
{
|
||||
"id": "deepseek-cache",
|
||||
"provider": "deepseek",
|
||||
"url": "https://api-docs.deepseek.com/guides/kv_cache",
|
||||
"checkedAt": "2026-11-06",
|
||||
"sha256": "061c0c7055ceb96d0a522ae1829ff5f7126ff08f26af217643e371abb740a081",
|
||||
"file": "sources/deepseek-cache.body",
|
||||
"originalSha256": "061c0c7055ceb96d0a522ae1829ff5f7126ff08f26af217643e371abb740a081",
|
||||
"representation": "received-html-bytes",
|
||||
"scope": "complete-captured-source"
|
||||
},
|
||||
{
|
||||
"id": "openai-gpt-6.1-sol",
|
||||
"provider": "openai",
|
||||
"url": "https://developers.openai.com/api/docs/models/gpt-6.1-sol",
|
||||
"checkedAt": "2026-11-07",
|
||||
"sha256": "a128083565678e6a47a74a737a891a7df050309df19925db6902535fcb1f5f23",
|
||||
"file": "sources/openai-gpt-6.1-sol.md",
|
||||
"originalSha256": "a128083565678e6a47a74a737a891a7df050309df19925db6902535fcb1f5f23",
|
||||
"representation": "official-documentation-tool-text",
|
||||
"scope": "complete-captured-source"
|
||||
},
|
||||
{
|
||||
"id": "openai-gpt-6-astra",
|
||||
"provider": "openai",
|
||||
"url": "https://developers.openai.com/api/docs/models/gpt-6-astra",
|
||||
"checkedAt": "2026-11-07",
|
||||
"sha256": "7f2f28cf1a8dfdf2557eb1a51f1540e41396397795fe6c39f1f419c922d896ca",
|
||||
"file": "sources/openai-gpt-6-astra.md",
|
||||
"originalSha256": "7f2f28cf1a8dfdf2557eb1a51f1540e41396397795fe6c39f1f419c922d896ca",
|
||||
"representation": "official-documentation-tool-text",
|
||||
"scope": "complete-captured-source"
|
||||
},
|
||||
{
|
||||
"id": "openai-gpt-6-sol",
|
||||
"provider": "openai",
|
||||
"url": "https://developers.openai.com/api/docs/models/gpt-6-sol",
|
||||
"checkedAt": "2026-11-07",
|
||||
"sha256": "cae6df84b71d6ce278072a5e565db585ad8f946fd5a92492a9fdfa23eaca4e7f",
|
||||
"file": "sources/openai-gpt-6-sol.md",
|
||||
"originalSha256": "cae6df84b71d6ce278072a5e565db585ad8f946fd5a92492a9fdfa23eaca4e7f",
|
||||
"representation": "official-documentation-tool-text",
|
||||
"scope": "complete-captured-source"
|
||||
},
|
||||
{
|
||||
"id": "openai-gpt-6-luna",
|
||||
"provider": "openai",
|
||||
"url": "https://developers.openai.com/api/docs/models/gpt-6-luna",
|
||||
"checkedAt": "2026-11-07",
|
||||
"sha256": "be1678c26b17547a9b004286dd18065c9e08dfcaf53cb9e80517284fd1cba76e",
|
||||
"file": "sources/openai-gpt-6-luna.md",
|
||||
"originalSha256": "be1678c26b17547a9b004286dd18065c9e08dfcaf53cb9e80517284fd1cba76e",
|
||||
"representation": "official-documentation-tool-text",
|
||||
"scope": "complete-captured-source"
|
||||
},
|
||||
{
|
||||
"id": "openai-gpt-6.1-terra",
|
||||
"provider": "openai",
|
||||
"url": "https://developers.openai.com/api/docs/models/gpt-6.1-terra",
|
||||
"checkedAt": "2026-11-07",
|
||||
"sha256": "bab1c30e8d49d9be5e7ad0edf90508fb06fffb908123b97c4779f933e8b4bd2a",
|
||||
"file": "sources/openai-gpt-6.1-terra.md",
|
||||
"originalSha256": "bab1c30e8d49d9be5e7ad0edf90508fb06fffb908123b97c4779f933e8b4bd2a",
|
||||
"representation": "official-documentation-tool-text",
|
||||
"scope": "complete-captured-source"
|
||||
},
|
||||
{
|
||||
"id": "deepseek-model-list",
|
||||
"provider": "deepseek",
|
||||
"url": "https://api-docs.deepseek.com/api/list-models",
|
||||
"checkedAt": "2026-11-07",
|
||||
"sha256": "5c8a4e4fe7256742a2d11218e6b155bb7210524a048cd0a14e733bee90194723",
|
||||
"file": "sources/deepseek-model-list.html",
|
||||
"originalSha256": "5c8a4e4fe7256742a2d11218e6b155bb7210524a048cd0a14e733bee90194723",
|
||||
"representation": "received-html-bytes",
|
||||
"scope": "complete-captured-source"
|
||||
},
|
||||
{
|
||||
"id": "deepseek-models",
|
||||
"provider": "deepseek",
|
||||
"url": "https://api-docs.deepseek.com/quick_start/pricing",
|
||||
"checkedAt": "2026-11-07",
|
||||
"sha256": "af6679690eb9a7838c47727bfc5ffdc4ac91c4445a0c1219741ffe00c076ece5",
|
||||
"file": "sources/deepseek-models.html",
|
||||
"originalSha256": "af6679690eb9a7838c47727bfc5ffdc4ac91c4445a0c1219741ffe00c076ece5",
|
||||
"representation": "received-html-bytes",
|
||||
"scope": "complete-captured-source"
|
||||
},
|
||||
{
|
||||
"id": "deepseek-response",
|
||||
"provider": "deepseek",
|
||||
"url": "https://api-docs.deepseek.com/api/create-response.md",
|
||||
"checkedAt": "2026-11-07",
|
||||
"sha256": "5e56e45d25db47f2b6966bbb0b2471d324035c33f0c8f81eaaf8fc444e6869da",
|
||||
"file": "sources/deepseek-response.md",
|
||||
"originalSha256": "5e56e45d25db47f2b6966bbb0b2471d324035c33f0c8f81eaaf8fc444e6869da",
|
||||
"representation": "received-document-bytes",
|
||||
"scope": "complete-captured-source"
|
||||
},
|
||||
{
|
||||
"id": "deepseek-message",
|
||||
"provider": "deepseek",
|
||||
"url": "https://api-docs.deepseek.com/api/create-message.md",
|
||||
"checkedAt": "2026-11-07",
|
||||
"sha256": "46b31d10f429910bf93ea2166537fb803cd2f49f7c5b4ad2ee4f08257b2e17e8",
|
||||
"file": "sources/deepseek-message.md",
|
||||
"originalSha256": "46b31d10f429910bf93ea2166537fb803cd2f49f7c5b4ad2ee4f08257b2e17e8",
|
||||
"representation": "received-document-bytes",
|
||||
"scope": "complete-captured-source"
|
||||
},
|
||||
{
|
||||
"id": "claude-effort",
|
||||
"provider": "anthropic",
|
||||
"url": "https://platform.claude.com/docs/en/build-with-claude/effort",
|
||||
"checkedAt": "2026-11-06",
|
||||
"sha256": "b19219d51d1ced67deb1451b8a0e243b13925d6e49454f0165d45e06a739704d",
|
||||
"file": "sources/claude-effort.md",
|
||||
"originalSha256": "b19219d51d1ced67deb1451b8a0e243b13925d6e49454f0165d45e06a739704d",
|
||||
"representation": "extracted-official-markdown",
|
||||
"scope": "complete-captured-source"
|
||||
}
|
||||
],
|
||||
"note": "Pinned official declarations and contract examples; not live-provider evidence. Original whole captures and first failures remain in the owned QA roots."
|
||||
}
|
||||
Reference in New Issue
Block a user