Add --refresh flag to models command (#4707)
This commit is contained in:
parent
d39bcd9c55
commit
dd6113c9d1
1 changed files with 10 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
import type { Argv } from "yargs"
|
import type { Argv } from "yargs"
|
||||||
import { Instance } from "../../project/instance"
|
import { Instance } from "../../project/instance"
|
||||||
import { Provider } from "../../provider/provider"
|
import { Provider } from "../../provider/provider"
|
||||||
|
import { ModelsDev } from "../../provider/models"
|
||||||
import { cmd } from "./cmd"
|
import { cmd } from "./cmd"
|
||||||
import { UI } from "../ui"
|
import { UI } from "../ui"
|
||||||
import { EOL } from "os"
|
import { EOL } from "os"
|
||||||
|
|
@ -19,8 +20,17 @@ export const ModelsCommand = cmd({
|
||||||
describe: "use more verbose model output (includes metadata like costs)",
|
describe: "use more verbose model output (includes metadata like costs)",
|
||||||
type: "boolean",
|
type: "boolean",
|
||||||
})
|
})
|
||||||
|
.option("refresh", {
|
||||||
|
describe: "refresh the models cache from models.dev",
|
||||||
|
type: "boolean",
|
||||||
|
})
|
||||||
},
|
},
|
||||||
handler: async (args) => {
|
handler: async (args) => {
|
||||||
|
if (args.refresh) {
|
||||||
|
await ModelsDev.refresh()
|
||||||
|
UI.println(UI.Style.TEXT_SUCCESS_BOLD + "Models cache refreshed" + UI.Style.TEXT_NORMAL)
|
||||||
|
}
|
||||||
|
|
||||||
await Instance.provide({
|
await Instance.provide({
|
||||||
directory: process.cwd(),
|
directory: process.cwd(),
|
||||||
async fn() {
|
async fn() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue