How to set style guidelines

View as Markdown

style_guidelines lets you steer tone, terminology, and formatting for the whole job in free text. language_specific_guidelines layers per-language overrides on top of it.

ParameterTypeNotes
style_guidelinesstringUp to ~4000 characters. Applies to every target language in the job.
language_specific_guidelinesobjectKeys must match entries in target_language_codes. Overrides style_guidelines for that language only.

Use style_guidelines for instructions that should hold across every language, for example “keep product names untranslated.” Use language_specific_guidelines only when one language needs different handling, such as a regional terminology preference.

Example

from sarvamai import SarvamAI
client = SarvamAI(api_subscription_key="YOUR_SARVAM_API_KEY")
job = client.document_translation.create(
job_name="employee-handbook-hi-ta",
source_language_code="en-IN",
target_language_codes=["hi-IN", "ta-IN"],
original_filename="employee-handbook.docx",
style_guidelines=(
"Keep all product names and legal entity names untranslated. "
"Use formal register throughout."
),
language_specific_guidelines={
"ta-IN": "Prefer commonly used loanwords over invented Tamil equivalents for technical terms.",
},
)

Request body equivalent:

{
"job_name": "employee-handbook-hi-ta",
"source_language_code": "en-IN",
"target_language_codes": ["hi-IN", "ta-IN"],
"original_filename": "employee-handbook.docx",
"style_guidelines": "Keep all product names and legal entity names untranslated. Use formal register throughout.",
"language_specific_guidelines": {
"ta-IN": "Prefer commonly used loanwords over invented Tamil equivalents for technical terms."
}
}