Skip to content

Commit

Permalink
Updating download script to target specific versions. (#12)
Browse files Browse the repository at this point in the history
Adding request_id propert to RTClient (python)
  • Loading branch information
glecaros authored Oct 2, 2024
1 parent c77d130 commit 657c107
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 52 deletions.
27 changes: 0 additions & 27 deletions dotnet/samples/download-nupkg.ps1

This file was deleted.

19 changes: 0 additions & 19 deletions dotnet/samples/download-nupkg.sh

This file was deleted.

3 changes: 2 additions & 1 deletion javascript/samples/download-pkg.ps1
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
$Owner = "Azure-Samples"
$Repo = "aoai-realtime-audio-sdk"
$Filter = "tgz"
$Release = "v0.1.0-beta.1"
$OutputDir = "."

$apiUrl = "https://api.github.com/repos/$Owner/$Repo/releases/latest"
$apiUrl = "https://api.github.com/repos/$Owner/$Repo/releases/tags/$Release"

$release = Invoke-RestMethod -Uri $apiUrl -Headers @{"Accept"="application/vnd.github.v3+json"}

Expand Down
3 changes: 2 additions & 1 deletion javascript/samples/download-pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
OWNER="Azure-Samples"
REPO="aoai-realtime-audio-sdk"
FILTER="tgz"
RELEASE="v0.1.0-beta.1"
OUTPUT_DIR="."

API_URL="https://api.github.com/repos/$OWNER/$REPO/releases/latest"
API_URL="https://api.github.com/repos/$OWNER/$REPO/releases/tags/$RELEASE"
RELEASE_INFO=$(curl -s -H "Accept: application/vnd.github.v3+json" "$API_URL")

ASSETS=$(echo "$RELEASE_INFO" | jq -r '.assets[] | select(.name | contains("'"$FILTER"'")) | "\(.name) \(.browser_download_url)"')
Expand Down
5 changes: 5 additions & 0 deletions python/rtclient/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ def __init__(
self._session = ClientSession(base_url=self._url)
self._model = model
self._azure_deployment = azure_deployment
self.request_id: Optional[uuid.UUID] = None

def _get_auth(self):
if self._token_credential:
Expand Down Expand Up @@ -385,6 +386,10 @@ def __init__(
self._response_map: dict[str, str] = {}
self._transcription_enabled = False

@property
def request_id(self) -> uuid.UUID | None:
return self._client.request_id

async def _receive_message(self):
async for message in self._client:
return message
Expand Down
3 changes: 1 addition & 2 deletions python/rtclient/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,10 @@ class SessionUpdateMessage(ClientMessageBase):
def _azure_compatibility(self):
if not self._is_azure:
if self.session.turn_detection and self.session.turn_detection.type != "server_vad":
self.session.turn_detection = None
self.session.turn_detection = None
return self



class InputAudioBufferAppendMessage(ClientMessageBase):
"""
Append audio data to the user audio buffer, this should be in the format specified by
Expand Down
3 changes: 2 additions & 1 deletion python/samples/download-wheel.ps1
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
$Owner = "Azure-Samples"
$Repo = "aoai-realtime-audio-sdk"
$Filter = "-py3-none-any.whl"
$Release = "py/v0.4.1"
$OutputDir = "."

$apiUrl = "https://api.github.com/repos/$Owner/$Repo/releases/latest"
$apiUrl = "https://api.github.com/repos/$Owner/$Repo/releases/tags/$Release"

$release = Invoke-RestMethod -Uri $apiUrl -Headers @{"Accept"="application/vnd.github.v3+json"}

Expand Down
3 changes: 2 additions & 1 deletion python/samples/download-wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
OWNER="Azure-Samples"
REPO="aoai-realtime-audio-sdk"
FILTER="-py3-none-any.whl"
RELEASE="py/v0.4.1"
OUTPUT_DIR="."

API_URL="https://api.github.com/repos/$OWNER/$REPO/releases/latest"
API_URL="https://api.github.com/repos/$OWNER/$REPO/releases/tags/$RELEASE"
RELEASE_INFO=$(curl -s -H "Accept: application/vnd.github.v3+json" "$API_URL")

ASSETS=$(echo "$RELEASE_INFO" | jq -r '.assets[] | select(.name | contains("'"$FILTER"'")) | "\(.name) \(.browser_download_url)"')
Expand Down

0 comments on commit 657c107

Please sign in to comment.