fix rerank mode is none

This commit is contained in:
jyong
2024-08-22 15:33:43 +08:00
parent 067b956b2c
commit cb70e12827
9 changed files with 366 additions and 25 deletions

View File

@ -43,12 +43,10 @@ class OAuthDataSource(Resource):
if not internal_secret:
return {'error': 'Internal secret is not set'},
oauth_provider.save_internal_access_token(internal_secret)
return { 'data': '' }
return {'data': ''}
else:
auth_url = oauth_provider.get_authorization_url()
return { 'data': auth_url }, 200
return {'data': auth_url}, 200
class OAuthDataSourceCallback(Resource):
@ -68,7 +66,7 @@ class OAuthDataSourceCallback(Resource):
return redirect(f'{dify_config.CONSOLE_WEB_URL}?type=notion&error={error}')
else:
return redirect(f'{dify_config.CONSOLE_WEB_URL}?type=notion&error=Access denied')
class OAuthDataSourceBinding(Resource):
def get(self, provider: str):