feat: add support for ollama #221 (#260)

### What problem does this PR solve?

add support for ollama

Issue link:#221

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-04-08 19:13:45 +08:00
committed by GitHub
parent d0a1ffe6e2
commit 265a7a283a
22 changed files with 275 additions and 26 deletions

View File

@ -4,6 +4,7 @@ import {
IMyLlmValue,
IThirdOAIModelCollection,
} from '@/interfaces/database/llm';
import { IAddLlmRequestBody } from '@/interfaces/request/llm';
import { useCallback, useEffect, useMemo } from 'react';
import { useDispatch, useSelector } from 'umi';
@ -206,3 +207,19 @@ export const useSaveTenantInfo = () => {
return saveTenantInfo;
};
export const useAddLlm = () => {
const dispatch = useDispatch();
const saveTenantInfo = useCallback(
(requestBody: IAddLlmRequestBody) => {
return dispatch<any>({
type: 'settingModel/add_llm',
payload: requestBody,
});
},
[dispatch],
);
return saveTenantInfo;
};