BerriAI/litellm · error · OCIError
OCI embedText does not support token-array inputs. Convert…
Error message
OCI embedText does not support token-array inputs. Convert token lists to strings before calling embedding().
What it means
Error "OCI embedText does not support token-array inputs. Convert token lists to strings before calling embedding()." thrown in BerriAI/litellm.
Solutions
- Convert token-id lists to plain strings before calling embedding() with the OCI provider.
When it happens
Trigger: Thrown at litellm/llms/oci/embed/transformation.py:200 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/5c83682d9f4b80a8.
Report an issue: GitHub.
Appendix: source
Thrown at litellm/llms/oci/embed/transformation.py:200
creds: Final = resolve_oci_credentials(optional_params)
compartment_id: Final = creds["oci_compartment_id"]
if not compartment_id:
raise OCIError(
status_code=400,
message=(
"oci_compartment_id is required for OCI embedding requests. "
"Pass it as optional_params or set the OCI_COMPARTMENT_ID env var."
),
)
# Normalise input to a flat list of strings
if isinstance(input, str):
texts = [input]
elif isinstance(input, list):
texts = []
for item in input:
if isinstance(item, list):
raise OCIError(
status_code=400,
message=(
"OCI embedText does not support token-array inputs. "
"Convert token lists to strings before calling embedding()."
),
)
texts.append(item if isinstance(item, str) else str(item))
else:
texts = [str(input)]
if len(texts) > OCI_EMBED_BATCH_LIMIT:
raise OCIError(
status_code=400,
message=(
f"OCI embedText accepts at most {OCI_EMBED_BATCH_LIMIT} inputs per request "
f"(got {len(texts)}). Batch your requests."
),
)View on GitHub (pinned to 77b7c6c40c)