fix: sqlite3.Row.get() compatibility in _resolve_embed_config
This commit is contained in:
@@ -2419,7 +2419,7 @@ def _resolve_embed_config(oci_config_id: str = None, genai_cfg: dict = None) ->
|
||||
"oci_config_id": oc["id"],
|
||||
"genai_region": oc["region"],
|
||||
"endpoint": f"https://inference.generativeai.{oc['region']}.oci.oraclecloud.com",
|
||||
"compartment_id": oc.get("compartment_id") or oc["tenancy_ocid"],
|
||||
"compartment_id": (dict(oc).get("compartment_id") or oc["tenancy_ocid"]),
|
||||
}
|
||||
# Last resort: any genai config
|
||||
with db() as c:
|
||||
@@ -2432,7 +2432,7 @@ def _resolve_embed_config(oci_config_id: str = None, genai_cfg: dict = None) ->
|
||||
"oci_config_id": oc["id"],
|
||||
"genai_region": oc["region"],
|
||||
"endpoint": f"https://inference.generativeai.{oc['region']}.oci.oraclecloud.com",
|
||||
"compartment_id": oc.get("compartment_id") or oc["tenancy_ocid"],
|
||||
"compartment_id": (dict(oc).get("compartment_id") or oc["tenancy_ocid"]),
|
||||
}
|
||||
raise HTTPException(400, "Nenhuma credencial OCI configurada para gerar embeddings.")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user