Skip to content

Commit c7ec0df

Browse files
committed
Fixes unit tests
1 parent 1d59fab commit c7ec0df

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

tests/unitary/with_extras/langchain/test_guardrails.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*--
33

4-
# Copyright (c) 2023, 2024 Oracle and/or its affiliates.
4+
# Copyright (c) 2023, 2025 Oracle and/or its affiliates.
55
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
66

77
import json
88
import os
9-
import tempfile
109
import sys
11-
from typing import Any, List, Dict, Mapping, Optional
10+
import tempfile
11+
from typing import Any, Dict, List, Mapping, Optional
1212
from unittest import TestCase
13+
1314
import pytest
1415

1516
if sys.version_info < (3, 9):
1617
pytest.skip("Requires Python 3.9 or higher", allow_module_level=True)
1718

18-
from langchain.callbacks.manager import CallbackManagerForLLMRun
19-
from langchain.llms.base import LLM
20-
from langchain.prompts import PromptTemplate
21-
from langchain.schema.runnable import RunnableMap, RunnablePassthrough
22-
from ads.llm.guardrails.huggingface import HuggingFaceEvaluation
23-
from ads.llm.guardrails.base import BlockedByGuardrail, GuardrailIO
19+
from langchain_core.callbacks import CallbackManagerForLLMRun
20+
from langchain_core.language_models.llms import LLM
21+
from langchain_core.prompts.prompt import PromptTemplate
22+
from langchain_core.runnables import RunnableMap, RunnablePassthrough
23+
2424
from ads.llm.chain import GuardrailSequence
25-
from ads.llm.serialize import load, dump
25+
from ads.llm.guardrails.base import BlockedByGuardrail, GuardrailIO
26+
from ads.llm.guardrails.huggingface import HuggingFaceEvaluation
27+
from ads.llm.serialize import dump, load
2628

2729

2830
class FakeLLM(LLM):

0 commit comments

Comments
 (0)