allow overriding Core API URL
This commit is contained in:
@@ -436,7 +436,7 @@ const ChatPanel: FC = observer(() => {
|
||||
const chatSseController = new AbortController();
|
||||
chatSseControllers[answerId] = chatSseController;
|
||||
fetchEventSource( // https://api.openai.com/v1/chat/completions || http://127.0.0.1:${port}/v1/chat/completions
|
||||
getServerRoot(port) + '/v1/chat/completions',
|
||||
getServerRoot(port, true) + '/v1/chat/completions',
|
||||
{
|
||||
method: 'POST',
|
||||
headers: {
|
||||
|
||||
@@ -82,7 +82,7 @@ const CompletionPanel: FC = observer(() => {
|
||||
let answer = '';
|
||||
completionSseController = new AbortController();
|
||||
fetchEventSource( // https://api.openai.com/v1/completions || http://127.0.0.1:${port}/v1/completions
|
||||
getServerRoot(port) + '/v1/completions',
|
||||
getServerRoot(port, true) + '/v1/completions',
|
||||
{
|
||||
method: 'POST',
|
||||
headers: {
|
||||
|
||||
@@ -173,7 +173,7 @@ const CompositionPanel: FC = observer(() => {
|
||||
let answer = '';
|
||||
compositionSseController = new AbortController();
|
||||
fetchEventSource( // https://api.openai.com/v1/completions || http://127.0.0.1:${port}/v1/completions
|
||||
getServerRoot(port) + '/v1/completions',
|
||||
getServerRoot(port, true) + '/v1/completions',
|
||||
{
|
||||
method: 'POST',
|
||||
headers: {
|
||||
|
||||
@@ -186,6 +186,16 @@ export const AdvancedGeneralSettings: FC = observer(() => {
|
||||
</Dropdown>
|
||||
</div>
|
||||
} />
|
||||
<Labeled label={t('Core API URL')}
|
||||
desc={t('Override core API URL(/chat/completions and /completions). If you don\'t know what this is, leave it blank.')}
|
||||
content={
|
||||
<Input style={{ minWidth: 0 }} className="grow" value={commonStore.settings.coreApiUrl}
|
||||
onChange={(e, data) => {
|
||||
commonStore.setSettings({
|
||||
coreApiUrl: data.value
|
||||
});
|
||||
}} />
|
||||
} />
|
||||
</div>;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user