refac
This commit is contained in:
1 parent
95d590b360
commit
ed663f16ec
4 files changed
+22
-28
No files matched your search
@@ -44,6 +44,7 @@ from open_webui.utils.access_control import check_model_access, has_connection_a
|
||||
from open_webui.utils.anthropic import get_anthropic_models, is_anthropic_url
|
||||
from open_webui.utils.auth import get_admin_user, get_verified_user
|
||||
from open_webui.utils.headers import get_custom_headers, include_user_info_headers
|
||||
from open_webui.utils.model_ids import strip_provider_model_prefix
|
||||
from open_webui.utils.misc import (
|
||||
convert_logit_bias_input_to_json,
|
||||
stream_chunks_handler,
|
||||
@@ -328,8 +329,7 @@ async def get_anthropic_token_count_target(request: Request, form_data: dict, us
|
||||
|
||||
url, key, api_config = await get_openai_connection(model['urlIdx'])
|
||||
prefix_id = api_config.get('prefix_id')
|
||||
if prefix_id:
|
||||
payload['model'] = payload['model'].replace(f'{prefix_id}.', '')
|
||||
payload['model'] = strip_provider_model_prefix(payload['model'], prefix_id)
|
||||
|
||||
headers, cookies = await get_headers_and_cookies(request, url, key, api_config, user=user)
|
||||
return requested_model, payload, url, key, headers, cookies
|
||||
@@ -1268,8 +1268,7 @@ async def generate_chat_completion(
|
||||
url, key, api_config = await get_openai_connection(idx)
|
||||
|
||||
prefix_id = api_config.get('prefix_id', None)
|
||||
if prefix_id:
|
||||
payload['model'] = payload['model'].replace(f'{prefix_id}.', '')
|
||||
payload['model'] = strip_provider_model_prefix(payload['model'], prefix_id)
|
||||
|
||||
# Add user info to the payload if the model is a pipeline
|
||||
if 'pipeline' in model and model.get('pipeline'):
|
||||
|
||||
Reference in new issue
Block a user