File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
ads/llm/langchain/plugins Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -56,10 +56,12 @@ def is_lc_serializable(cls) -> bool:
5656
5757
5858class GenerativeAiClientModel (BaseModel ):
59+ """Base model for generative AI embedding model and LLM."""
60+
5961 client : Any #: :meta private:
6062 """OCI GenerativeAiClient."""
6163
62- compartment_id : str
64+ compartment_id : str = None
6365 """Compartment ID of the caller."""
6466
6567 endpoint_kwargs : Dict [str , Any ] = {}
@@ -90,7 +92,9 @@ def validate_environment( # pylint: disable=no-self-argument
9092 client_kwargs .update (values ["client_kwargs" ])
9193 values ["client" ] = GenerativeAiClient (** auth , ** client_kwargs )
9294 # Set default compartment ID
93- if "compartment_id" not in values and COMPARTMENT_OCID :
94- values ["compartment_id" ] = COMPARTMENT_OCID
95-
95+ if not values .get ("compartment_id" ):
96+ if COMPARTMENT_OCID :
97+ values ["compartment_id" ] = COMPARTMENT_OCID
98+ else :
99+ raise ValueError ("Please specify compartment_id." )
96100 return values
You can’t perform that action at this time.
0 commit comments