Skip to content

Commit 6405e09

Browse files
committed
Update tests
1 parent e80debf commit 6405e09

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/test_actions_llm_utils.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
import pytest
1716
from typing import cast
17+
from unittest.mock import AsyncMock
18+
19+
import pytest
1820
from langchain_core.language_models import BaseLanguageModel
1921
from langchain_core.messages import AIMessage
20-
from unittest.mock import AsyncMock
2122

2223
from nemoguardrails.actions.llm.utils import (
2324
_extract_reasoning_from_additional_kwargs,
@@ -27,6 +28,7 @@
2728
_infer_provider_from_module,
2829
_store_reasoning_traces,
2930
_store_tool_calls,
31+
llm_call,
3032
)
3133
from nemoguardrails.context import reasoning_trace_var, tool_calls_var
3234
from nemoguardrails.exceptions import LLMCallException
@@ -581,6 +583,7 @@ def test_store_tool_calls_with_real_aimessage_multiple_tool_calls():
581583
assert tool_calls[0]["name"] == "foo"
582584
assert tool_calls[1]["name"] == "bar"
583585

586+
584587
@pytest.mark.asyncio
585588
async def test_llm_call_exception_enrichment_with_model_and_endpoint():
586589
"""Test that LLM invocation errors include model and endpoint context."""
@@ -663,4 +666,4 @@ async def test_llm_call_exception_extracts_nested_client_base_url():
663666
exc_str = str(exc_info.value)
664667
assert "https://custom.endpoint.com/v1" in exc_str
665668
assert "gpt-4-turbo" in exc_str
666-
assert "Client error" in exc_str
669+
assert "Client error" in exc_str

0 commit comments

Comments
 (0)