add support for Tencent Hunyuan (#2015)

### What problem does this PR solve?

#1853 

### Type of change


- [X] New Feature (non-breaking change which adds functionality)

Co-authored-by: Zhedong Cen <cenzhedong2@126.com>
This commit is contained in:
黄腾
2024-08-20 15:27:13 +08:00
committed by GitHub
parent 5efb3476f2
commit 6f438e0a49
15 changed files with 327 additions and 9 deletions

View File

@@ -163,6 +163,33 @@ export const useSubmitVolcEngine = () => {
};
};
export const useSubmitHunyuan = () => {
const { addLlm, loading } = useAddLlm();
const {
visible: HunyuanAddingVisible,
hideModal: hideHunyuanAddingModal,
showModal: showHunyuanAddingModal,
} = useSetModalState();
const onHunyuanAddingOk = useCallback(
async (payload: IAddLlmRequestBody) => {
const ret = await addLlm(payload);
if (ret === 0) {
hideHunyuanAddingModal();
}
},
[hideHunyuanAddingModal, addLlm],
);
return {
HunyuanAddingLoading: loading,
onHunyuanAddingOk,
HunyuanAddingVisible,
hideHunyuanAddingModal,
showHunyuanAddingModal,
};
};
export const useSubmitBedrock = () => {
const { addLlm, loading } = useAddLlm();
const {