Merge pull request #10127 from uinstinct/hub-local
fix: show error for blank inputs when using hub blocks in local config
This commit is contained in:
commit
998425438b
3 changed files with 17 additions and 2 deletions
|
|
@ -407,7 +407,7 @@ class Anthropic extends BaseLLM {
|
|||
): AsyncGenerator<ChatMessage> {
|
||||
if (!this.apiKey || this.apiKey === "") {
|
||||
throw new Error(
|
||||
"Request not sent. You have an Anthropic model configured in your config.json, but the API key is not set.",
|
||||
"Request not sent. You have an Anthropic model configured in your config.yaml, but the API key is not set.",
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -488,7 +488,7 @@ describe("Anthropic", () => {
|
|||
},
|
||||
}),
|
||||
).rejects.toThrow(
|
||||
"Request not sent. You have an Anthropic model configured in your config.json, but the API key is not set.",
|
||||
"Request not sent. You have an Anthropic model configured in your config.yaml, but the API key is not set.",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -740,6 +740,21 @@ export async function resolveBlock(
|
|||
secrets: extractFQSNMap(rawYaml, [id]),
|
||||
});
|
||||
|
||||
// Check for unresolved input template variables (missing required inputs)
|
||||
const unresolvedInputs = getTemplateVariables(templatedYaml).filter((v) =>
|
||||
v.startsWith("inputs."),
|
||||
);
|
||||
if (unresolvedInputs.length > 0) {
|
||||
const missingInputNames = unresolvedInputs.map((v) =>
|
||||
v.replace("inputs.", ""),
|
||||
);
|
||||
const blockName = packageIdentifierToShorthandSlug(id);
|
||||
throw new Error(
|
||||
`Missing required input(s) for block "${blockName}": ${missingInputNames.join(", ")}. ` +
|
||||
`Please provide these values in the "with" block.`,
|
||||
);
|
||||
}
|
||||
|
||||
// Add source slug for mcp servers
|
||||
const parsed = parseMarkdownRuleOrAssistantUnrolled(templatedYaml, id);
|
||||
if (
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue