fix(coding): close PI-100 review findings
This commit is contained in:
@@ -14,6 +14,7 @@ import type {
|
||||
ForkConversationInput,
|
||||
ForkResult,
|
||||
PrepareConversationInput,
|
||||
ProductModelRef,
|
||||
PromptAcceptance,
|
||||
PromptConversationInput,
|
||||
QueueAcceptance,
|
||||
@@ -316,6 +317,17 @@ export class InMemoryConversationRuntime implements CodingConversationRuntime {
|
||||
}, current.runId);
|
||||
}
|
||||
|
||||
async validateModel(model: ProductModelRef): Promise<ProductModelRef> {
|
||||
if (!model.accountId.trim() || !model.modelId.trim()) {
|
||||
throw new CodingRuntimeContractError(
|
||||
'CODING_MODEL_UNAVAILABLE',
|
||||
'The selected model is unavailable',
|
||||
true,
|
||||
);
|
||||
}
|
||||
return clone(model);
|
||||
}
|
||||
|
||||
async setModel(input: SetConversationModelInput): Promise<ConversationModelState> {
|
||||
const snapshot = this.snapshot(input.conversationId);
|
||||
const thinkingLevel = snapshot.conversation.model.model?.thinkingLevel ?? 'off';
|
||||
|
||||
Reference in New Issue
Block a user