This commit is contained in:
cotran 2024-10-31 14:49:03 -07:00
parent b15736a7fd
commit cd22c71690
3 changed files with 53 additions and 43 deletions

View file

@ -1,5 +1,6 @@
import pytest
from unittest.mock import AsyncMock, MagicMock, patch
import app.commons.constants as const
from fastapi import Response
from app.function_calling.model_utils import (
process_messages,
@ -86,4 +87,4 @@ async def test_chat_completion(mock_hanlder, mock_client):
second_call_args = mock_client.chat.completions.create.call_args_list[1][1]
assert second_call_args["stream"] == False
assert "model" in second_call_args
assert second_call_args["messages"][-1]["content"] == "Sure!"
assert second_call_args["messages"][-1]["content"] in const.prefill_list