openai: audio modality, remove sockets from unit tests (#27436)

This commit is contained in:
Erick Friis
2024-10-18 08:02:09 -07:00
committed by GitHub
parent 97dc578d47
commit 7d65a32ee0
10 changed files with 417 additions and 279 deletions

View File

@@ -162,7 +162,12 @@ def test__convert_dict_to_message_tool_call() -> None:
name="GenerateUsername",
args="oops",
id="call_wm0JY6CdwOMZ4eTxHWUThDNz",
error="Function GenerateUsername arguments:\n\noops\n\nare not valid JSON. Received JSONDecodeError Expecting value: line 1 column 1 (char 0)", # noqa: E501
error=(
"Function GenerateUsername arguments:\n\noops\n\nare not "
"valid JSON. Received JSONDecodeError Expecting value: line 1 "
"column 1 (char 0)\nFor troubleshooting, visit: https://python"
".langchain.com/docs/troubleshooting/errors/OUTPUT_PARSING_FAILURE"
),
type="invalid_tool_call",
)
],

View File

@@ -58,7 +58,7 @@ def mock_completion() -> dict:
}
@pytest.mark.parametrize("model", ["gpt-3.5-turbo-instruct", "text-davinci-003"])
@pytest.mark.parametrize("model", ["gpt-3.5-turbo-instruct"])
def test_get_token_ids(model: str) -> None:
OpenAI(model=model).get_token_ids("foo")
return

View File

@@ -16,6 +16,7 @@ _MODELS = models = ["ada", "babbage", "curie", "davinci"]
_CHAT_MODELS = ["gpt-4", "gpt-4-32k", "gpt-3.5-turbo"]
@pytest.mark.xfail(reason="Old models require different tiktoken cached file")
@pytest.mark.parametrize("model", _MODELS)
def test_openai_get_num_tokens(model: str) -> None:
"""Test get_tokens."""