-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Allow setting model / language on new doc page
- Loading branch information
Showing
11 changed files
with
295 additions
and
12 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from fastapi import APIRouter | ||
from transcribee_backend.config import PublicConfig, get_public_config | ||
|
||
config_router = APIRouter() | ||
|
||
|
||
@config_router.get("/") | ||
def get_config() -> PublicConfig: | ||
return get_public_config() |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { defaultConfig } from 'swr/_internal'; | ||
import { fetcher, makeSwrHook } from '../api'; | ||
import { SWRConfiguration } from 'swr'; | ||
|
||
export const getConfig = fetcher.path('/api/v1/config/').method('get').create(); | ||
|
||
const useGetConfigWithRetry = makeSwrHook('getConfig', getConfig); | ||
|
||
export const useGetConfig = ( | ||
params: Parameters<typeof useGetConfigWithRetry>[0], | ||
options?: Partial<SWRConfiguration>, | ||
) => | ||
useGetConfigWithRetry(params, { | ||
onErrorRetry: (err, key, config, revalidate, opts) => { | ||
if (err.status === 422) return; | ||
else defaultConfig.onErrorRetry(err, key, config, revalidate, opts); | ||
}, | ||
...options, | ||
}); |
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
Oops, something went wrong.