feat: support Xinference (#319)

### What problem does this PR solve?

support xorbitsai inference as model provider

Issue link:#299

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-04-11 18:17:45 +08:00
committed by GitHub
parent 4fa768e733
commit cb2cbf500c
9 changed files with 77 additions and 19 deletions

View File

@ -132,6 +132,7 @@ export const useSelectModelProvidersLoading = () => {
export const useSubmitOllama = () => {
const loading = useOneNamespaceEffectsLoading('settingModel', ['add_llm']);
const [selectedLlmFactory, setSelectedLlmFactory] = useState<string>('');
const addLlm = useAddLlm();
const {
visible: llmAddingVisible,
@ -149,11 +150,17 @@ export const useSubmitOllama = () => {
[hideLlmAddingModal, addLlm],
);
const handleShowLlmAddingModal = (llmFactory: string) => {
setSelectedLlmFactory(llmFactory);
showLlmAddingModal();
};
return {
llmAddingLoading: loading,
onLlmAddingOk,
llmAddingVisible,
hideLlmAddingModal,
showLlmAddingModal,
showLlmAddingModal: handleShowLlmAddingModal,
selectedLlmFactory,
};
};