mirror of
https://github.com/ivanfioravanti/chatbot-ollama.git
synced 2023-12-01 22:17:38 +03:00
added type declaration on getModels(), to resolve type error
This commit is contained in:
@@ -2,12 +2,14 @@ import { useCallback } from 'react';
|
|||||||
|
|
||||||
import { useFetch } from '@/hooks/useFetch';
|
import { useFetch } from '@/hooks/useFetch';
|
||||||
|
|
||||||
|
import {OllamaModel, OllamaModelDetail} from '@/types/ollama'
|
||||||
|
|
||||||
|
|
||||||
const useApiService = () => {
|
const useApiService = () => {
|
||||||
const fetchService = useFetch();
|
const fetchService = useFetch();
|
||||||
|
|
||||||
const getModels = useCallback(
|
const getModels = useCallback(
|
||||||
() => {
|
(): Promise<OllamaModel[]> => {
|
||||||
return fetchService.get(`/api/models`, {
|
return fetchService.get(`/api/models`, {
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
|||||||
Reference in New Issue
Block a user