Skip to content

Commit 68f5644

Browse files
committed
Merge branch 'main' into users/raych1/test-new-release-tag-format
2 parents 94e9d88 + 52d9133 commit 68f5644

File tree

36 files changed

+918
-111
lines changed

36 files changed

+918
-111
lines changed

eng/pipelines/patch-release.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,19 @@ extends:
2727
safeName: azuresdktemplatethree
2828
skipPublishDocMs: true
2929
ServiceDirectory: template
30+
- name: azure-sdk-template
31+
groupId: com.azure.v2
32+
safeName: azuresdktemplate
33+
skipPublishDocMs: true
34+
ServiceDirectory: template-v2
35+
- name: azure-sdk-template-two
36+
groupId: com.azure.v2
37+
safeName: azuresdktemplatetwo
38+
skipPublishDocMs: true
39+
ServiceDirectory: template-v2
40+
- name: azure-sdk-template-three
41+
groupId: com.azure.v2
42+
safeName: azuresdktemplatethree
43+
skipPublishDocMs: true
44+
ServiceDirectory: template-v2
3045

eng/pipelines/templates/jobs/ci.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,15 @@ jobs:
146146
displayName: 'Tag scheduled builds'
147147
condition: and(succeeded(), eq(variables['Build.SourceBranchName'],'main'),eq(variables['Build.Reason'],'Schedule'))
148148
149-
- template: /eng/common/pipelines/templates/steps/set-test-pipeline-version.yml
150-
parameters:
151-
PackageNames: "azure-sdk-template,azure-sdk-template-two,azure-sdk-template-three"
152-
ServiceDirectory: "template"
153-
TestPipeline: ${{ parameters.TestPipeline }}
149+
- ${{ if eq(parameters.TestPipeline, true) }}:
150+
- template: /eng/common/pipelines/templates/steps/set-test-pipeline-version.yml
151+
parameters:
152+
Artifacts:
153+
- ${{ each artifact in parameters.ReleaseArtifacts }}:
154+
- ${{ if contains(artifact.name, 'azure-sdk-template') }}:
155+
- ${{ artifact }}
156+
ServiceDirectory: ${{ parameters.ServiceDirectory }}
157+
TestPipeline: ${{ parameters.TestPipeline }}
154158

155159
# The daily dev build variable isn't used for the PullRequests pipeline but is currently used
156160
# to save off the packageInfo files for all ci pipeline. This needs to be skipped for the
@@ -349,11 +353,15 @@ jobs:
349353
CspellConfigPath: .vscode/cspell.json
350354
ContinueOnError: false
351355

352-
- template: /eng/common/pipelines/templates/steps/set-test-pipeline-version.yml
353-
parameters:
354-
PackageNames: "azure-sdk-template,azure-sdk-template-two,azure-sdk-template-three"
355-
ServiceDirectory: "template"
356-
TestPipeline: ${{ parameters.TestPipeline }}
356+
- ${{ if eq(parameters.TestPipeline, true) }}:
357+
- template: /eng/common/pipelines/templates/steps/set-test-pipeline-version.yml
358+
parameters:
359+
Artifacts:
360+
- ${{ each artifact in parameters.ReleaseArtifacts }}:
361+
- ${{ if contains(artifact.name, 'azure-sdk-template') }}:
362+
- ${{ artifact }}
363+
ServiceDirectory: ${{ parameters.ServiceDirectory }}
364+
TestPipeline: ${{ parameters.TestPipeline }}
357365

358366
- template: /eng/common/pipelines/templates/steps/verify-links.yml
359367
parameters:

eng/pipelines/templates/stages/archetype-java-release-batch.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,15 @@ stages:
125125
inputs:
126126
versionSpec: $(PythonVersion)
127127

128-
- template: /eng/common/pipelines/templates/steps/set-test-pipeline-version.yml
129-
parameters:
130-
PackageNames: "azure-sdk-template,azure-sdk-template-two,azure-sdk-template-three"
131-
ServiceDirectory: "template"
132-
TestPipeline: ${{ parameters.TestPipeline }}
128+
- ${{ if eq(parameters.TestPipeline, true) }}:
129+
- template: /eng/common/pipelines/templates/steps/set-test-pipeline-version.yml
130+
parameters:
131+
Artifacts:
132+
- ${{ each artifact in parameters.Artifacts }}:
133+
- ${{ if contains(artifact.name, 'azure-sdk-template') }}:
134+
- ${{ artifact }}
135+
ServiceDirectory: ${{ parameters.ServiceDirectory }}
136+
TestPipeline: ${{ parameters.TestPipeline }}
133137

134138
# Do all the verifications for all the artifacts after the sparse-checkout
135139
- pwsh: |

eng/pipelines/templates/stages/archetype-sdk-client-patch.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,10 @@ extends:
6161

6262
- template: /eng/common/pipelines/templates/steps/set-test-pipeline-version.yml
6363
parameters:
64-
PackageNames: "azure-sdk-template,azure-sdk-template-two,azure-sdk-template-three"
65-
ServiceDirectory: "template"
64+
Artifacts:
65+
- ${{ each artifact in parameters.Artifacts }}:
66+
- ${{ if contains(artifact.name, 'azure-sdk-template') }}:
67+
- ${{ artifact }}
6668
TestPipeline: ${{parameters.TestPipeline}}
6769

6870
- task: UsePythonVersion@0
@@ -215,8 +217,10 @@ extends:
215217

216218
- template: /eng/common/pipelines/templates/steps/set-test-pipeline-version.yml
217219
parameters:
218-
PackageNames: "azure-sdk-template,azure-sdk-template-two,azure-sdk-template-three"
219-
ServiceDirectory: "template"
220+
Artifacts:
221+
- ${{ each artifact in parameters.Artifacts }}:
222+
- ${{ if contains(artifact.name, 'azure-sdk-template') }}:
223+
- ${{ artifact }}
220224
TestPipeline: ${{parameters.TestPipeline}}
221225

222226
- task: PythonScript@0

eng/scripts/Language-Settings.ps1

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,17 @@ function Get-java-GithubIoDocIndex()
484484
}
485485

486486
# function is used to filter packages to submit to API view tool
487-
function Find-java-Artifacts-For-Apireview($artifactDir, $pkgName)
487+
# Function pointer name: FindArtifactForApiReviewFn
488+
function Find-java-Artifacts-For-Apireview($artifactDir, $packageInfo)
488489
{
490+
# Check if packageInfo is null first
491+
if (!$packageInfo) {
492+
Write-Host "Package info is null, skipping API review artifact search"
493+
return $null
494+
}
495+
496+
$pkgName = $packageInfo.ArtifactName ?? $packageInfo.Name
497+
489498
# skip spark packages
490499
if ($pkgName.Contains("-spark")) {
491500
return $null
@@ -495,15 +504,9 @@ function Find-java-Artifacts-For-Apireview($artifactDir, $pkgName)
495504
return $null
496505
}
497506

498-
# Find all source jar files in given artifact directory
499-
# Filter for package in "com.azure*" groupId.
500-
$artifactPath = Join-Path $artifactDir "com.azure*" $pkgName
501-
Write-Host "Checking for source jar in artifact path $($artifactPath)"
502-
$files = @(Get-ChildItem -Recurse "${artifactPath}" | Where-Object -FilterScript {$_.Name.EndsWith("sources.jar")})
503-
# And filter for packages in "io.clientcore*" groupId.
504-
# (Is there a way to pass more information here to know the explicit groupId?)
505-
$artifactPath = Join-Path $artifactDir "io.clientcore*" $pkgName
506-
$files += @(Get-ChildItem -Recurse "${artifactPath}" | Where-Object -FilterScript {$_.Name.EndsWith("sources.jar")})
507+
$artifactPath = Join-Path $artifactDir $packageInfo.Group $pkgName
508+
$files = @(Get-ChildItem "${artifactPath}" | Where-Object -FilterScript {$_.Name.EndsWith("sources.jar")})
509+
507510
if (!$files)
508511
{
509512
Write-Host "$($artifactPath) does not have any package"
@@ -643,6 +646,7 @@ function Update-java-GeneratedSdks([string]$PackageDirectoriesFile) {
643646
}
644647
}
645648

649+
# Function pointer: IsApiviewStatusCheckRequiredFn
646650
function Get-java-ApiviewStatusCheckRequirement($packageInfo) {
647651
if ($packageInfo.IsNewSdk -and ($packageInfo.SdkType -eq "client" -or $packageInfo.SdkType -eq "spring")) {
648652
return $true

eng/versioning/version_client.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,20 +104,20 @@ com.azure:azure-core-test;1.27.0-beta.13;1.27.0-beta.14
104104
com.azure:azure-core-tracing-opentelemetry;1.0.0-beta.61;1.0.0-beta.62
105105
com.azure:azure-core-tracing-opentelemetry-samples;1.0.0-beta.1;1.0.0-beta.1
106106
com.azure:azure-core-version-tests;1.0.0-beta.1;1.0.0-beta.1
107-
com.azure:azure-cosmos;4.75.0;4.76.0-beta.1
107+
com.azure:azure-cosmos;4.75.0;4.76.0
108108
com.azure:azure-cosmos-benchmark;4.0.1-beta.1;4.0.1-beta.1
109109
com.azure.cosmos.spark:azure-cosmos-spark_3;0.0.1-beta.1;0.0.1-beta.1
110110
com.azure.cosmos.spark:azure-cosmos-spark_3-5;0.0.1-beta.1;0.0.1-beta.1
111-
com.azure:azure-cosmos-encryption;2.24.0;2.25.0-beta.1
111+
com.azure:azure-cosmos-encryption;2.24.0;2.25.0
112112
com.azure.cosmos.spark:azure-cosmos-spark-account-data-resolver-sample;1.0.0-beta.1;1.0.0-beta.1
113113
com.azure:azure-cosmos-test;1.0.0-beta.15;1.0.0-beta.16
114-
com.azure.cosmos.spark:azure-cosmos-spark_3-3_2-12;4.41.0;4.42.0-beta.1
115-
com.azure.cosmos.spark:azure-cosmos-spark_3-4_2-12;4.41.0;4.42.0-beta.1
116-
com.azure.cosmos.spark:azure-cosmos-spark_3-5_2-12;4.41.0;4.42.0-beta.1
114+
com.azure.cosmos.spark:azure-cosmos-spark_3-3_2-12;4.41.0;4.42.0
115+
com.azure.cosmos.spark:azure-cosmos-spark_3-4_2-12;4.41.0;4.42.0
116+
com.azure.cosmos.spark:azure-cosmos-spark_3-5_2-12;4.41.0;4.42.0
117117
com.azure.cosmos.spark:fabric-cosmos-spark-auth_3;1.1.0;1.2.0-beta.1
118118
com.azure:azure-cosmos-tests;1.0.0-beta.1;1.0.0-beta.1
119119
com.azure:azure-data-appconfiguration;1.8.5;1.9.0-beta.1
120-
com.azure.cosmos.kafka:azure-cosmos-kafka-connect;2.6.1;2.7.0-beta.1
120+
com.azure.cosmos.kafka:azure-cosmos-kafka-connect;2.6.1;2.7.0
121121
com.azure:azure-data-appconfiguration-perf;1.0.0-beta.1;1.0.0-beta.1
122122
com.azure:azure-data-schemaregistry;1.5.9;1.6.0-beta.1
123123
com.azure:azure-data-schemaregistry-apacheavro;1.1.30;1.2.0-beta.3

sdk/ai/azure-ai-voicelive/README.md

Lines changed: 71 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ The following sections provide code snippets for common scenarios:
125125
* [Send audio input](#send-audio-input)
126126
* [Handle event types](#handle-event-types)
127127
* [Voice configuration](#voice-configuration)
128+
* [Function calling](#function-calling)
128129
* [Complete voice assistant with microphone](#complete-voice-assistant-with-microphone)
129130

130131
### Focused Sample Files
@@ -158,9 +159,16 @@ For easier learning, explore these focused samples in order:
158159
- Noise reduction and echo cancellation
159160
- Multi-threaded audio processing
160161

161-
> **Note:** To run audio samples (AudioPlaybackSample, MicrophoneInputSample, VoiceAssistantSample):
162+
6. **FunctionCallingSample.java** - Voice assistant with custom function tools
163+
- Define function tools with parameters
164+
- Register functions with the VoiceLive session
165+
- Handle function call requests from the AI model
166+
- Execute functions locally and return results
167+
- Continue conversation with function results
168+
169+
> **Note:** To run audio samples (AudioPlaybackSample, MicrophoneInputSample, VoiceAssistantSample, FunctionCallingSample):
162170
> ```bash
163-
> mvn exec:java -Dexec.mainClass=com.azure.ai.voicelive.AudioPlaybackSample -Dexec.classpathScope=test
171+
> mvn exec:java -Dexec.mainClass=com.azure.ai.voicelive.FunctionCallingSample -Dexec.classpathScope=test
164172
> ```
165173
> These samples use `javax.sound.sampled` for audio I/O.
166174
@@ -328,6 +336,67 @@ VoiceLiveSessionOptions options3 = new VoiceLiveSessionOptions()
328336
new AzurePersonalVoice("speakerProfileId", PersonalVoiceModels.PHOENIX_LATEST_NEURAL)));
329337
```
330338
339+
### Function calling
340+
341+
Enable your voice assistant to call custom functions during conversations. This allows the AI to request information or perform actions by executing your code:
342+
343+
```java com.azure.ai.voicelive.functioncalling
344+
// 1. Define function tool with parameters
345+
VoiceLiveFunctionDefinition getWeatherFunction = new VoiceLiveFunctionDefinition("get_current_weather")
346+
.setDescription("Get the current weather in a given location")
347+
.setParameters(BinaryData.fromObject(parametersSchema)); // JSON schema
348+
349+
// 2. Configure session with tools
350+
VoiceLiveSessionOptions options = new VoiceLiveSessionOptions()
351+
.setTools(Arrays.asList(getWeatherFunction))
352+
.setInstructions("You have access to weather information. Use get_current_weather when asked about weather.");
353+
354+
// 3. Handle function call events
355+
client.startSession("gpt-4o-realtime-preview")
356+
.flatMap(session -> {
357+
session.receiveEvents()
358+
.subscribe(event -> {
359+
if (event instanceof SessionUpdateConversationItemCreated) {
360+
SessionUpdateConversationItemCreated itemCreated = (SessionUpdateConversationItemCreated) event;
361+
if (itemCreated.getItem().getType() == ItemType.FUNCTION_CALL) {
362+
ResponseFunctionCallItem functionCall = (ResponseFunctionCallItem) itemCreated.getItem();
363+
364+
// Wait for arguments
365+
String callId = functionCall.getCallId();
366+
String arguments = waitForArguments(session, callId); // Helper method
367+
368+
// Execute function
369+
try {
370+
Map<String, Object> result = getCurrentWeather(arguments);
371+
String resultJson = new ObjectMapper().writeValueAsString(result);
372+
373+
// Return result
374+
FunctionCallOutputItem output = new FunctionCallOutputItem(callId, resultJson);
375+
ClientEventConversationItemCreate createItem = new ClientEventConversationItemCreate()
376+
.setItem(output)
377+
.setPreviousItemId(functionCall.getId());
378+
379+
session.sendEvent(createItem).subscribe();
380+
session.sendEvent(new ClientEventResponseCreate()).subscribe();
381+
} catch (Exception e) {
382+
System.err.println("Error executing function: " + e.getMessage());
383+
}
384+
}
385+
}
386+
});
387+
388+
return Mono.just(session);
389+
})
390+
.block();
391+
```
392+
393+
**Key points:**
394+
* Define function tools with JSON schemas describing parameters
395+
* The AI decides when to call functions based on conversation context
396+
* Your code executes the function and returns results
397+
* Results are sent back to continue the conversation
398+
* See `FunctionCallingSample.java` for a complete working example
399+
331400
### Complete voice assistant with microphone
332401
333402
A full example demonstrating real-time microphone input and audio playback:

0 commit comments

Comments
 (0)