mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-08 01:39:12 +00:00
sync
This commit is contained in:
@@ -4,13 +4,9 @@ import path from "path"
|
||||
|
||||
export namespace ModelsDev {
|
||||
const log = Log.create({ service: "models.dev" })
|
||||
|
||||
function filepath() {
|
||||
return path.join(Global.Path.data, "models.json")
|
||||
}
|
||||
const file = Bun.file(path.join(Global.Path.cache, "models.json"))
|
||||
|
||||
export async function get() {
|
||||
const file = Bun.file(filepath())
|
||||
if (await file.exists()) {
|
||||
refresh()
|
||||
return file.json()
|
||||
@@ -24,6 +20,6 @@ export namespace ModelsDev {
|
||||
const result = await fetch("https://models.dev/api.json")
|
||||
if (!result.ok)
|
||||
throw new Error(`Failed to fetch models.dev: ${result.statusText}`)
|
||||
await Bun.write(filepath(), result)
|
||||
await Bun.write(file, result)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ import { LspHoverTool } from "../tool/lsp-hover"
|
||||
import { PatchTool } from "../tool/patch"
|
||||
import { ReadTool } from "../tool/read"
|
||||
import type { Tool } from "../tool/tool"
|
||||
|
||||
import { WriteTool } from "../tool/write"
|
||||
import { TodoReadTool, TodoWriteTool } from "../tool/todo"
|
||||
import { AuthAnthropic } from "../auth/anthropic"
|
||||
|
||||
Reference in New Issue
Block a user