77 Any ,
88 Dict ,
99 List ,
10+ Literal ,
1011 Optional ,
1112 Sequence ,
1213 Tuple ,
@@ -296,6 +297,9 @@ class EntityType(str, Enum):
296297 filename = "filename"
297298 "Names of computer files, including the extension or filepath (e.g., Taxes/2012/brad-tax-returns.pdf)"
298299
300+ gender = "gender"
301+ "Terms indicating gender identity (e.g., female, male, non-binary)"
302+
299303 gender_sexuality = "gender_sexuality"
300304 "Terms indicating gender identity or sexual orientation, including slang terms (e.g., female; bisexual; trans)"
301305
@@ -314,6 +318,27 @@ class EntityType(str, Enum):
314318 location = "location"
315319 "Any Location reference including mailing address, postal code, city, state, province, country, or coordinates (e.g., Lake Victoria, 145 Windsor St., 90210)"
316320
321+ location_address = "location_address"
322+ "Mailing address (e.g., 123 Main Street, Apartment 4B)"
323+
324+ location_address_street = "location_address_street"
325+ "Street address (e.g., 123 Main Street)"
326+
327+ location_city = "location_city"
328+ "City name (e.g., San Francisco, New York)"
329+
330+ location_coordinate = "location_coordinate"
331+ "Geographic coordinates (e.g., 37.7749° N, 122.4194° W)"
332+
333+ location_country = "location_country"
334+ "Country name (e.g., United States, Canada)"
335+
336+ location_state = "location_state"
337+ "State or province name (e.g., California, Ontario)"
338+
339+ location_zip = "location_zip"
340+ "Postal or ZIP code (e.g., 94102, M5V 3A8)"
341+
317342 marital_status = "marital_status"
318343 "Terms indicating marital status (e.g., Single, common-law, ex-wife, married)"
319344
@@ -338,6 +363,8 @@ class EntityType(str, Enum):
338363 organization = "organization"
339364 "Name of an organization (e.g., CNN, McDonalds, University of Alaska, Northwest General Hospital)"
340365
366+ organization_medical_facility = "organization_medical_facility"
367+
341368 passport_number = "passport_number"
342369 "Passport numbers, issued by any country (e.g., PA4568332; NU3C6L86S12)"
343370
@@ -362,6 +389,9 @@ class EntityType(str, Enum):
362389 religion = "religion"
363390 "Terms indicating religious affiliation (e.g., Hindu, Catholic)"
364391
392+ sexuality = "sexuality"
393+ "Terms indicating sexual orientation (e.g., heterosexual, gay, bisexual)"
394+
365395 statistics = "statistics"
366396 "Medical statistics (e.g., 18%, 18 percent)"
367397
@@ -383,6 +413,40 @@ class EntityType(str, Enum):
383413 zodiac_sign = "zodiac_sign"
384414 "Names of Zodiac signs (e.g., Aries, Taurus)"
385415
416+ # BETA - only english
417+ corporate_action = "corporate_action"
418+ "Corporate actions (e.g., merger, acquisition, IPO)"
419+
420+ day = "day"
421+ "Day reference (e.g., Monday, Friday)"
422+
423+ effect = "effect"
424+ "Effect or result (e.g., increase, decrease)"
425+
426+ financial_metric = "financial_metric"
427+ "Financial metrics (e.g., revenue, profit margin, EBITDA)"
428+
429+ medical_code = "medical_code"
430+ "Medical codes (e.g., ICD-10, CPT codes)"
431+
432+ month = "month"
433+ "Month reference (e.g., January, February)"
434+
435+ organization_id = "organization_id"
436+ "Organization identification numbers (e.g., EIN, company registration number)"
437+
438+ product = "product"
439+ "Product names (e.g., iPhone, Tesla Model 3)"
440+
441+ project = "project"
442+ "Project names (e.g., Project Apollo, Manhattan Project)"
443+
444+ trend = "trend"
445+ "Trend indicators (e.g., upward trend, downward trend)"
446+
447+ year = "year"
448+ "Year reference (e.g., 2023, 1999)"
449+
386450
387451# EntityType and PIIRedactionPolicy share the same values
388452PIIRedactionPolicy = EntityType
@@ -704,6 +768,10 @@ class SpeakerOptions(BaseModel):
704768 None ,
705769 description = "Enable or disable two-stage clustering for speaker diarization" ,
706770 )
771+ long_file_diarization_method : Optional [Literal ["standard" , "experimental" ]] = Field (
772+ None ,
773+ description = "Diarization method for long files. Options: standard (default), experimental" ,
774+ )
707775
708776 if pydantic_v2 :
709777
@@ -861,7 +929,13 @@ class RawTranscriptionConfig(BaseModel):
861929 "The list of key terms used to generate the transcript with the Slam-1 speech model. Can't be used together with `prompt`."
862930
863931 language_codes : Optional [List [Union [str , LanguageCode ]]] = None
864- "List of language codes detected in the audio file when language detection is enabled"
932+ """
933+ A list of language codes associated with the transcript.
934+
935+ When submitting a transcript request, this can be used to provide multiple language codes
936+ for multilingual/code-switching audio (equivalent to passing `language_codes` in the
937+ `/v2/transcript` API request body).
938+ """
865939
866940 language_detection_results : Optional [LanguageDetectionResults ] = None
867941 "Language detection results including code switching languages"
@@ -876,6 +950,7 @@ class TranscriptionConfig:
876950 def __init__ (
877951 self ,
878952 language_code : Optional [Union [str , LanguageCode ]] = None ,
953+ language_codes : Optional [List [Union [str , LanguageCode ]]] = None ,
879954 punctuate : Optional [bool ] = None ,
880955 format_text : Optional [bool ] = None ,
881956 dual_channel : Optional [bool ] = None ,
@@ -922,6 +997,7 @@ def __init__(
922997 """
923998 Args:
924999 language_code: The language of your audio file. Possible values are found in Supported Languages.
1000+ language_codes: A list of language codes for multilingual/code-switching audio.
9251001 punctuate: Enable Automatic Punctuation
9261002 format_text: Enable Text Formatting
9271003 dual_channel: Enable Dual Channel transcription
@@ -969,6 +1045,7 @@ def __init__(
9691045
9701046 # explicit configurations have higher priority if `raw_transcription_config` has been passed as well
9711047 self .language_code = language_code
1048+ self .language_codes = language_codes
9721049 self .punctuate = punctuate
9731050 self .format_text = format_text
9741051 self .dual_channel = dual_channel
@@ -1455,10 +1532,17 @@ def speech_threshold(self, threshold: Optional[float]) -> None:
14551532
14561533 @property
14571534 def language_codes (self ) -> Optional [List [Union [str , LanguageCode ]]]:
1458- "Returns the list of language codes detected in the audio file when language detection is enabled ."
1535+ "Returns the list of language codes associated with this transcript/config ."
14591536
14601537 return self ._raw_transcription_config .language_codes
14611538
1539+ @language_codes .setter
1540+ def language_codes (
1541+ self , language_codes : Optional [List [Union [str , LanguageCode ]]]
1542+ ) -> None :
1543+ "Sets the list of language codes for multilingual/code-switching audio."
1544+ self ._raw_transcription_config .language_codes = language_codes
1545+
14621546 @property
14631547 def language_detection_results (self ) -> Optional [LanguageDetectionResults ]:
14641548 "Returns the language detection results including code switching languages."
@@ -1878,7 +1962,7 @@ class Utterance(UtteranceWord):
18781962class Chapter (BaseModel ):
18791963 summary : str
18801964 headline : str
1881- gist : str
1965+ gist : Optional [ str ] = None
18821966 start : int
18831967 end : int
18841968
0 commit comments