|
6 | 6 | from typing import Any, Dict, List, Optional
|
7 | 7 |
|
8 | 8 | from langchain.llms.base import LLM
|
9 |
| -from langchain.load.serializable import Serializable |
10 | 9 | from langchain.pydantic_v1 import BaseModel, Field, root_validator
|
11 | 10 |
|
12 | 11 | from ads.common.auth import default_signer
|
13 | 12 | from ads.config import COMPARTMENT_OCID
|
14 | 13 |
|
15 | 14 |
|
16 |
| -class BaseLLM(LLM, Serializable): |
| 15 | +class BaseLLM(LLM): |
17 | 16 | """Base OCI LLM class. Contains common attributes."""
|
18 | 17 |
|
19 | 18 | auth: dict = Field(default_factory=default_signer, exclude=True)
|
@@ -58,6 +57,14 @@ def is_lc_serializable(cls) -> bool:
|
58 | 57 | class GenerativeAiClientModel(BaseModel):
|
59 | 58 | """Base model for generative AI embedding model and LLM."""
|
60 | 59 |
|
| 60 | + # This auth is the same as the auth in BaseLLM class. |
| 61 | + # However, this is needed for the Gen AI embedding model. |
| 62 | + # Do not remove this attribute |
| 63 | + auth: dict = Field(default_factory=default_signer, exclude=True) |
| 64 | + """ADS auth dictionary for OCI authentication. |
| 65 | + This can be generated by calling `ads.common.auth.api_keys()` or `ads.common.auth.resource_principal()`. |
| 66 | + If this is not provided then the `ads.common.default_signer()` will be used.""" |
| 67 | + |
61 | 68 | client: Any #: :meta private:
|
62 | 69 | """OCI GenerativeAiClient."""
|
63 | 70 |
|
|
0 commit comments