add support for XunFei Spark (#2017)

### What problem does this PR solve?

#1853  add support for XunFei Spark

### 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 16:56:42 +08:00
committed by GitHub
parent 02985fc905
commit be431449bd
12 changed files with 190 additions and 6 deletions

View File

@@ -190,6 +190,33 @@ export const useSubmitHunyuan = () => {
};
};
export const useSubmitSpark = () => {
const { addLlm, loading } = useAddLlm();
const {
visible: SparkAddingVisible,
hideModal: hideSparkAddingModal,
showModal: showSparkAddingModal,
} = useSetModalState();
const onSparkAddingOk = useCallback(
async (payload: IAddLlmRequestBody) => {
const ret = await addLlm(payload);
if (ret === 0) {
hideSparkAddingModal();
}
},
[hideSparkAddingModal, addLlm],
);
return {
SparkAddingLoading: loading,
onSparkAddingOk,
SparkAddingVisible,
hideSparkAddingModal,
showSparkAddingModal,
};
};
export const useSubmitBedrock = () => {
const { addLlm, loading } = useAddLlm();
const {