|
1 | 1 | #!/usr/bin/env python |
2 | 2 | # -*- coding: utf-8 -*-- |
3 | 3 |
|
4 | | -# Copyright (c) 2023, 2024 Oracle and/or its affiliates. |
| 4 | +# Copyright (c) 2023, 2025 Oracle and/or its affiliates. |
5 | 5 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ |
6 | 6 |
|
7 | 7 | import json |
8 | 8 | import os |
9 | | -import tempfile |
10 | 9 | import sys |
11 | | -from typing import Any, List, Dict, Mapping, Optional |
| 10 | +import tempfile |
| 11 | +from typing import Any, Dict, List, Mapping, Optional |
12 | 12 | from unittest import TestCase |
| 13 | + |
13 | 14 | import pytest |
14 | 15 |
|
15 | 16 | if sys.version_info < (3, 9): |
16 | 17 | pytest.skip("Requires Python 3.9 or higher", allow_module_level=True) |
17 | 18 |
|
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 | + |
24 | 24 | 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 |
26 | 28 |
|
27 | 29 |
|
28 | 30 | class FakeLLM(LLM): |
|
0 commit comments