This commit is contained in:
Timothy Jaeryang Baek 2024-12-11 20:40:20 -08:00
parent 866c3dff11
commit 403262d764

View File

@ -2037,8 +2037,7 @@ async def generate_chat_completions(
# Using /ollama/api/chat endpoint # Using /ollama/api/chat endpoint
form_data = convert_payload_openai_to_ollama(form_data) form_data = convert_payload_openai_to_ollama(form_data)
response = await generate_ollama_chat_completion( response = await generate_ollama_chat_completion(
request=request, request=request, form_data=form_data, user=user, bypass_filter=bypass_filter
form_data=form_data, user=user, bypass_filter=bypass_filter
) )
if form_data.stream: if form_data.stream:
response.headers["content-type"] = "text/event-stream" response.headers["content-type"] = "text/event-stream"
@ -2050,9 +2049,7 @@ async def generate_chat_completions(
return convert_response_ollama_to_openai(response) return convert_response_ollama_to_openai(response)
else: else:
return await generate_openai_chat_completion( return await generate_openai_chat_completion(
request=request, request=request, form_data=form_data, user=user, bypass_filter=bypass_filter
form_data, user=user, bypass_filter=bypass_filter
) )