fix(pi): converge worker failures and thinking state
This commit is contained in:
@@ -1,5 +1,15 @@
|
||||
export type ImportedModelModality = 'text' | 'audio' | 'image' | 'pdf';
|
||||
export type ImportedVisionTokenEstimator = 'qwen-32px-grid';
|
||||
export type ImportedThinkingLevel = 'off' | 'minimal' | 'low' | 'medium' | 'high';
|
||||
|
||||
export interface ImportedPiModelProfile {
|
||||
reasoning: boolean;
|
||||
thinkingLevelMap?: Partial<Record<ImportedThinkingLevel, string | null>>;
|
||||
compat?: {
|
||||
thinkingFormat?: 'deepseek' | 'openrouter';
|
||||
requiresReasoningContentOnAssistantMessages?: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export interface ImportedModelProfile {
|
||||
modalities: {
|
||||
@@ -11,6 +21,7 @@ export interface ImportedModelProfile {
|
||||
output: number;
|
||||
};
|
||||
visionTokenEstimator?: ImportedVisionTokenEstimator;
|
||||
pi?: ImportedPiModelProfile;
|
||||
}
|
||||
|
||||
const VERIFIED_QWEN_PLUS_MODEL_IDS = new Set([
|
||||
@@ -31,6 +42,32 @@ function imageModalities(): ImportedModelProfile['modalities'] {
|
||||
|
||||
export function getImportedModelProfile(rawModelId: string): ImportedModelProfile | null {
|
||||
const modelId = rawModelId.trim();
|
||||
if (modelId.toLowerCase() === 'deepseek-v4-pro') {
|
||||
return {
|
||||
modalities: {
|
||||
input: ['text'],
|
||||
output: ['text'],
|
||||
},
|
||||
limit: {
|
||||
context: 1_000_000,
|
||||
output: 384_000,
|
||||
},
|
||||
pi: {
|
||||
reasoning: true,
|
||||
thinkingLevelMap: {
|
||||
off: null,
|
||||
minimal: null,
|
||||
low: null,
|
||||
medium: null,
|
||||
high: 'high',
|
||||
},
|
||||
compat: {
|
||||
thinkingFormat: 'deepseek',
|
||||
requiresReasoningContentOnAssistantMessages: true,
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
if (VERIFIED_QWEN_PLUS_MODEL_IDS.has(modelId.toLowerCase())) {
|
||||
return {
|
||||
modalities: imageModalities(),
|
||||
|
||||
Reference in New Issue
Block a user