-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Use baseUrl, no header * Fix urls * Add log * Logs IP * Fix chat service url * Fix download * Remove logs
- Loading branch information
1 parent
25f6d4e
commit 34b7711
Showing
12 changed files
with
30 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,11 @@ | ||
import axios from "axios"; | ||
import { isProxyEnabled } from "shared/helpers/utils"; | ||
|
||
import useSettingStore from "../../../shared/store/setting"; | ||
import type { Service } from "../../service/types"; | ||
import type { ImageGeneration } from "../types"; | ||
|
||
const generateImage = async (service: Service, data: ImageGeneration) => { | ||
const isIP = useSettingStore.getState().isIP; | ||
const headers = { "Content-Type": "application/json" }; | ||
if (isProxyEnabled() && isIP && service?.invokeMethod.header) { | ||
const [key, value] = service.invokeMethod.header.split(":"); | ||
Object.assign(headers, { [key]: value }); | ||
} | ||
return axios.post(`${service.invokeMethod.baseUrl}/v1/images/generation`, data, { headers }); | ||
return axios.post(`${service.baseUrl}/v1/images/generation`, data, { headers }); | ||
}; | ||
|
||
export default generateImage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,11 @@ | ||
import axios from "axios"; | ||
import { isProxyEnabled } from "shared/helpers/utils"; | ||
|
||
import useSettingStore from "../../../shared/store/setting"; | ||
import type { Service } from "../../service/types"; | ||
import type { AudioGenerationData } from "../types"; | ||
|
||
const generateAudio = async (service: Service, data: AudioGenerationData) => { | ||
const isIP = useSettingStore.getState().isIP; | ||
const headers = { "Content-Type": "application/json" }; | ||
if (isProxyEnabled() && isIP && service?.invokeMethod.header) { | ||
const [key, value] = service.invokeMethod.header.split(":"); | ||
Object.assign(headers, { [key]: value }); | ||
} | ||
return axios.post(`${service.invokeMethod.baseUrl}/v1/audio/generation`, data, { headers }); | ||
return axios.post(`${service.baseUrl}/v1/audio/generation`, data, { headers }); | ||
}; | ||
|
||
export default generateAudio; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters