Update package.json version and refactor service calls
This commit is contained in:
parent
03db4631d7
commit
40a6f0d1b3
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "pageassist",
|
"name": "pageassist",
|
||||||
"displayName": "Page Assist - A Web UI for Local AI Models",
|
"displayName": "Page Assist - A Web UI for Local AI Models",
|
||||||
"version": "1.0.3",
|
"version": "1.0.4",
|
||||||
"description": "Use your locally running AI models to assist you in your web browsing.",
|
"description": "Use your locally running AI models to assist you in your web browsing.",
|
||||||
"author": "n4ze3m",
|
"author": "n4ze3m",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -4,7 +4,7 @@ import { useLocation, NavLink } from "react-router-dom"
|
|||||||
import { Sidebar } from "./Sidebar"
|
import { Sidebar } from "./Sidebar"
|
||||||
import { Drawer, Layout, Modal, Select, Tooltip } from "antd"
|
import { Drawer, Layout, Modal, Select, Tooltip } from "antd"
|
||||||
import { useQuery } from "@tanstack/react-query"
|
import { useQuery } from "@tanstack/react-query"
|
||||||
import { fetchChatModels } from "~services/ollama"
|
import { getAllModels } from "~services/ollama"
|
||||||
import { useMessageOption } from "~hooks/useMessageOption"
|
import { useMessageOption } from "~hooks/useMessageOption"
|
||||||
import { Settings } from "./Settings"
|
import { Settings } from "./Settings"
|
||||||
import { BrainCircuit, ChevronLeft, CogIcon, GithubIcon, PanelLeftIcon, SquarePen } from "lucide-react"
|
import { BrainCircuit, ChevronLeft, CogIcon, GithubIcon, PanelLeftIcon, SquarePen } from "lucide-react"
|
||||||
@ -24,7 +24,7 @@ export default function OptionLayout({
|
|||||||
isFetching: isModelsFetching
|
isFetching: isModelsFetching
|
||||||
} = useQuery({
|
} = useQuery({
|
||||||
queryKey: ["fetchModel"],
|
queryKey: ["fetchModel"],
|
||||||
queryFn: fetchChatModels,
|
queryFn: getAllModels,
|
||||||
refetchInterval: 15000
|
refetchInterval: 15000
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import { RotateCcw } from "lucide-react"
|
|||||||
import { useEffect, useState } from "react"
|
import { useEffect, useState } from "react"
|
||||||
import { useMessage } from "~hooks/useMessage"
|
import { useMessage } from "~hooks/useMessage"
|
||||||
import {
|
import {
|
||||||
fetchChatModels,
|
getAllModels,
|
||||||
getOllamaURL,
|
getOllamaURL,
|
||||||
isOllamaRunning,
|
isOllamaRunning,
|
||||||
setOllamaURL as saveOllamaURL
|
setOllamaURL as saveOllamaURL
|
||||||
@ -22,7 +22,7 @@ export const EmptySidePanel = () => {
|
|||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const ollamaURL = await getOllamaURL()
|
const ollamaURL = await getOllamaURL()
|
||||||
const isOk = await isOllamaRunning()
|
const isOk = await isOllamaRunning()
|
||||||
const models = await fetchChatModels()
|
const models = await getAllModels()
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isOk,
|
isOk,
|
||||||
|
@ -126,8 +126,8 @@ export const fetchChatModels = async () => {
|
|||||||
}[]
|
}[]
|
||||||
return models.filter((model) => {
|
return models.filter((model) => {
|
||||||
return (
|
return (
|
||||||
!model.details.families.includes("bert") &&
|
!model?.details?.families?.includes("bert") &&
|
||||||
!model.details.families.includes("nomic-bert")
|
!model?.details?.families?.includes("nomic-bert")
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user