fix style css in ts
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
import { requestUrl } from 'obsidian'
|
||||
|
||||
type OllamaTagsResponse = {
|
||||
models: { name: string }[]
|
||||
}
|
||||
|
||||
export async function getOllamaModels(ollamaUrl: string) {
|
||||
try {
|
||||
const response = (await requestUrl(`${ollamaUrl}/api/tags`)).json as {
|
||||
models: { name: string }[]
|
||||
}
|
||||
const response: OllamaTagsResponse = await requestUrl(`${ollamaUrl}/api/tags`).json
|
||||
return response.models.map((model) => model.name)
|
||||
} catch (error) {
|
||||
return []
|
||||
|
||||
Reference in New Issue
Block a user