Slightly better typings for ModelProviders

Still not great because the `any`s loosen some call sites up more than I'd like, but better than the broken types before.
This commit is contained in:
Kyle Corbitt
2023-07-21 06:50:05 -07:00
parent a5d972005e
commit 7e1fbb3767
6 changed files with 12 additions and 16 deletions

View File

@@ -70,7 +70,6 @@ export default async function parseConstructFn(
// We've validated the JSON schema so this should be safe
const input = prompt.input as Parameters<(typeof provider)["getModel"]>[0];
// @ts-expect-error TODO FIX ASAP
const model = provider.getModel(input);
if (!model) {
return {
@@ -80,8 +79,6 @@ export default async function parseConstructFn(
return {
modelProvider: prompt.modelProvider as keyof typeof modelProviders,
// @ts-expect-error TODO FIX ASAP
model,
modelInput: input,
};