Skip to content

Commit

Permalink
Added backup cognitive service (Azure#39406)
Browse files Browse the repository at this point in the history
* Added backup cognitive service

* updated async connect request

* Fixed Lint errors.
  • Loading branch information
v-durgeshs authored Feb 18, 2025
1 parent a1d4292 commit 95ed0a7
Show file tree
Hide file tree
Showing 32 changed files with 659 additions and 237 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "python",
"TagPrefix": "python/communication/azure-communication-callautomation",
"Tag": "python/communication/azure-communication-callautomation_40e440aaba"
"Tag": "python/communication/azure-communication-callautomation_9df9dd8efa"
}
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ def connect_call(
*,
server_call_id: str,
cognitive_services_endpoint: Optional[str] = None,
backup_cognitive_services_endpoint:Optional[str] = None,
operation_context: Optional[str] = None,
media_streaming: Optional['MediaStreamingOptions'] = None,
transcription: Optional['TranscriptionOptions'] = None,
Expand All @@ -188,6 +189,9 @@ def connect_call(
:keyword cognitive_services_endpoint:
The identifier of the Cognitive Service resource assigned to this call.
:paramtype cognitive_services_endpoint: str or None
:keyword backup_cognitive_services_endpoint:
The identifier of the Backup Cognitive Service resource assigned to this call.
:paramtype backup_cognitive_services_endpoint: str or None
:keyword operation_context: Value that can be used to track the call and its associated events.
:paramtype operation_context: str or None
:keyword media_streaming: Media Streaming Options.
Expand All @@ -208,6 +212,7 @@ def connect_call(
*,
group_call_id: str,
cognitive_services_endpoint: Optional[str] = None,
backup_cognitive_services_endpoint:Optional[str] = None,
operation_context: Optional[str] = None,
media_streaming: Optional['MediaStreamingOptions'] = None,
transcription: Optional['TranscriptionOptions'] = None,
Expand All @@ -222,6 +227,9 @@ def connect_call(
:keyword cognitive_services_endpoint:
The identifier of the Cognitive Service resource assigned to this call.
:paramtype cognitive_services_endpoint: str or None
:keyword backup_cognitive_services_endpoint:
The identifier of the Backup Cognitive Service resource assigned to this call.
:paramtype backup_cognitive_services_endpoint: str or None
:keyword operation_context: Value that can be used to track the call and its associated events.
:paramtype operation_context: str or None
:keyword media_streaming: Media Streaming Options.
Expand All @@ -242,6 +250,7 @@ def connect_call(
*,
room_id: str,
cognitive_services_endpoint: Optional[str] = None,
backup_cognitive_services_endpoint:Optional[str] = None,
operation_context: Optional[str] = None,
media_streaming: Optional['MediaStreamingOptions'] = None,
transcription: Optional['TranscriptionOptions'] = None,
Expand All @@ -256,6 +265,9 @@ def connect_call(
:keyword cognitive_services_endpoint:
The identifier of the Cognitive Service resource assigned to this call.
:paramtype cognitive_services_endpoint: str or None
:keyword backup_cognitive_services_endpoint:
The identifier of the Backup Cognitive Service resource assigned to this call.
:paramtype backup_cognitive_services_endpoint: str or None
:keyword operation_context: Value that can be used to track the call and its associated events.
:paramtype operation_context: str or None
:keyword media_streaming: Media Streaming Options.
Expand All @@ -277,8 +289,10 @@ def connect_call(
) -> CallConnectionProperties:

cognitive_services_endpoint=kwargs.pop("cognitive_services_endpoint", None)
backup_cognitive_services_endpoint=kwargs.pop("backup_cognitive_services_endpoint", None)
call_intelligence_options = CallIntelligenceOptions(
cognitive_services_endpoint=cognitive_services_endpoint
cognitive_services_endpoint=cognitive_services_endpoint,
backup_cognitive_services_endpoint=backup_cognitive_services_endpoint
) if cognitive_services_endpoint else None

media_streaming_options : Optional[MediaStreamingOptions] = None
Expand Down Expand Up @@ -318,6 +332,7 @@ def create_call(
source_display_name: Optional[str] = None,
operation_context: Optional[str] = None,
cognitive_services_endpoint: Optional[str] = None,
backup_cognitive_services_endpoint:Optional[str] = None,
sip_headers: Optional[Dict[str, str]] = None,
voip_headers: Optional[Dict[str, str]] = None,
media_streaming: Optional['MediaStreamingOptions'] = None,
Expand All @@ -343,6 +358,9 @@ def create_call(
:keyword cognitive_services_endpoint:
The identifier of the Cognitive Service resource assigned to this call.
:paramtype cognitive_services_endpoint: str or None
:keyword backup_cognitive_services_endpoint:
The identifier of the Backup Cognitive Service resource assigned to this call.
:paramtype backup_cognitive_services_endpoint: str or None
:keyword sip_headers: Sip Headers for PSTN Call
:paramtype sip_headers: Dict[str, str] or None
:keyword voip_headers: Voip Headers for Voip Call
Expand Down Expand Up @@ -372,7 +390,11 @@ def create_call(
user_custom_context = CustomCallingContext(voip_headers=voip_headers, sip_headers=sip_headers)

call_intelligence_options = (
CallIntelligenceOptions(cognitive_services_endpoint=cognitive_services_endpoint)
CallIntelligenceOptions(
cognitive_services_endpoint=cognitive_services_endpoint,
backup_cognitive_services_endpoint=backup_cognitive_services_endpoint
if backup_cognitive_services_endpoint else None
)
if cognitive_services_endpoint
else None
)
Expand Down Expand Up @@ -456,6 +478,7 @@ def answer_call(
callback_url: str,
*,
cognitive_services_endpoint: Optional[str] = None,
backup_cognitive_services_endpoint:Optional[str] = None,
operation_context: Optional[str] = None,
media_streaming: Optional['MediaStreamingOptions'] = None,
transcription: Optional['TranscriptionOptions'] = None,
Expand All @@ -474,6 +497,9 @@ def answer_call(
:keyword cognitive_services_endpoint:
The endpoint url of the Azure Cognitive Services resource attached.
:paramtype cognitive_services_endpoint: str
:keyword backup_cognitive_services_endpoint:
The endpoint url of the Azure Backup Cognitive Services resource attached.
:paramtype backup_cognitive_services_endpoint: str
:keyword operation_context: The operation context.
:paramtype operation_context: str
:keyword media_streaming: Media Streaming Options.
Expand All @@ -498,7 +524,9 @@ def answer_call(
)

call_intelligence_options = CallIntelligenceOptions(
cognitive_services_endpoint=cognitive_services_endpoint
cognitive_services_endpoint=cognitive_services_endpoint,
backup_cognitive_services_endpoint=backup_cognitive_services_endpoint
if backup_cognitive_services_endpoint else None
) if cognitive_services_endpoint else None

answer_call_request = AnswerCallRequest(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,8 @@ def start_recognizing_media(
:type target_participant: ~azure.communication.callautomation.CommunicationIdentifier
:keyword initial_silence_timeout: Time to wait for first input after prompt in seconds (if any).
:paramtype initial_silence_timeout: int
:type play_prompt: ~azure.communication.callautomation.FileSource or
:keyword play_prompt: The source of the audio to be played for recognition.
:paramtype play_prompt: ~azure.communication.callautomation.FileSource or
~azure.communication.callautomation.TextSource or
~azure.communication.callautomation.SsmlSource or
list[~azure.communication.callautomation.FileSource] or
Expand Down
Loading

0 comments on commit 95ed0a7

Please sign in to comment.