Skip to content

Commit 4ee9742

Browse files
author
ruiren_microsoft
committed
Merge remote-tracking branch 'origin/main' into ruiren/audio-streaming-support-sdk
# Conflicts: # .github/workflows/build-js-steps.yml # sdk/js/script/install.cjs
2 parents c6fb0d3 + d731c6d commit 4ee9742

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+4579
-484
lines changed

.github/workflows/build-js-steps.yml

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,9 @@ jobs:
9292
run: |
9393
if (Test-Path .npmrc) { Remove-Item .npmrc -Force; Write-Host "Removed .npmrc" }
9494
95-
- name: npm install (WinML)
96-
if: ${{ inputs.useWinML == true }}
95+
- name: npm install
9796
working-directory: sdk/js
98-
run: npm install --winml --nightly
99-
100-
- name: npm install (Standard)
101-
if: ${{ inputs.useWinML == false }}
102-
working-directory: sdk/js
103-
run: npm install --nightly
97+
run: npm install
10498

10599
- name: Set package version
106100
working-directory: sdk/js
@@ -114,21 +108,15 @@ jobs:
114108
working-directory: sdk/js
115109
run: npm run build
116110

117-
- name: Pack npm package
111+
- name: Pack npm package (WinML)
112+
if: ${{ inputs.useWinML == true }}
118113
working-directory: sdk/js
119-
run: npm pack
114+
run: npm run pack:winml
120115

121-
- name: Rename WinML artifact
122-
if: ${{ inputs.useWinML == true }}
123-
shell: pwsh
116+
- name: Pack npm package (Standard)
117+
if: ${{ inputs.useWinML == false }}
124118
working-directory: sdk/js
125-
run: |
126-
$tgz = Get-ChildItem *.tgz | Select-Object -First 1
127-
if ($tgz) {
128-
$newName = $tgz.Name -replace '^foundry-local-sdk-', 'foundry-local-sdk-winml-'
129-
Rename-Item -Path $tgz.FullName -NewName $newName
130-
Write-Host "Renamed $($tgz.Name) to $newName"
131-
}
119+
run: npm run pack
132120

133121
- name: Upload npm packages
134122
uses: actions/upload-artifact@v4
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: Build Python SDK
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
version:
7+
required: true
8+
type: string
9+
useWinML:
10+
required: false
11+
type: boolean
12+
default: false
13+
platform:
14+
required: false
15+
type: string
16+
default: 'windows'
17+
18+
permissions:
19+
contents: read
20+
21+
jobs:
22+
build:
23+
runs-on: ${{ inputs.platform }}-latest
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
with:
29+
clean: true
30+
31+
- name: Setup Python
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: '3.12'
35+
36+
# Clone test-data-shared from Azure DevOps (models for integration tests)
37+
- name: Checkout test-data-shared from Azure DevOps
38+
shell: pwsh
39+
working-directory: ${{ github.workspace }}/..
40+
run: |
41+
$pat = "${{ secrets.AZURE_DEVOPS_PAT }}"
42+
$encodedPat = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(":$pat"))
43+
44+
git config --global http.https://dev.azure.com.extraheader "AUTHORIZATION: Basic $encodedPat"
45+
46+
git lfs install
47+
git clone --depth 1 https://dev.azure.com/microsoft/windows.ai.toolkit/_git/test-data-shared test-data-shared
48+
49+
Write-Host "Clone completed successfully to ${{ github.workspace }}/../test-data-shared"
50+
51+
- name: Checkout specific commit in test-data-shared
52+
shell: pwsh
53+
working-directory: ${{ github.workspace }}/../test-data-shared
54+
run: |
55+
git checkout 231f820fe285145b7ea4a449b112c1228ce66a41
56+
if ($LASTEXITCODE -ne 0) {
57+
Write-Error "Git checkout failed."
58+
exit 1
59+
}
60+
61+
- name: Install build tool
62+
run: |
63+
python -m pip install build
64+
65+
- name: Configure pip for Azure Artifacts
66+
run: |
67+
pip config set global.index-url https://pkgs.dev.azure.com/aiinfra/PublicPackages/_packaging/ORT-Nightly/pypi/simple/
68+
pip config set global.extra-index-url https://pypi.org/simple/
69+
pip config set global.pre true
70+
71+
- name: Set package version
72+
working-directory: sdk/python
73+
run: echo '__version__ = "${{ inputs.version }}"' > src/version.py
74+
75+
- name: Build wheel (Cross-Platform)
76+
if: ${{ inputs.useWinML == false }}
77+
working-directory: sdk/python
78+
run: python -m build --wheel --outdir dist/
79+
80+
- name: Build wheel (WinML)
81+
if: ${{ inputs.useWinML == true }}
82+
working-directory: sdk/python
83+
run: python -m build --wheel -C winml=true --outdir dist/
84+
85+
- name: Install built wheel
86+
working-directory: sdk/python
87+
shell: pwsh
88+
run: |
89+
$wheel = (Get-ChildItem dist/*.whl | Select-Object -First 1).FullName
90+
pip install $wheel
91+
92+
- name: Install test dependencies
93+
run: pip install coverage pytest>=7.0.0 pytest-timeout>=2.1.0
94+
95+
- name: Run tests
96+
working-directory: sdk/python
97+
run: python -m pytest test/ -v
98+
99+
- name: Upload Python packages
100+
uses: actions/upload-artifact@v4
101+
with:
102+
name: python-sdk-${{ inputs.platform }}${{ inputs.useWinML == true && '-winml' || '' }}
103+
path: sdk/python/dist/*
104+
105+
- name: Upload flcore logs
106+
uses: actions/upload-artifact@v4
107+
if: always()
108+
with:
109+
name: python-sdk-${{ inputs.platform }}${{ inputs.useWinML == true && '-winml' || '' }}-logs
110+
path: sdk/python/logs/**

.github/workflows/foundry-local-sdk-build.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ jobs:
2929
version: '0.9.0.${{ github.run_number }}'
3030
platform: 'windows'
3131
secrets: inherit
32+
build-python-windows:
33+
uses: ./.github/workflows/build-python-steps.yml
34+
with:
35+
version: '0.9.0.${{ github.run_number }}'
36+
platform: 'windows'
37+
secrets: inherit
3238
build-rust-windows:
3339
uses: ./.github/workflows/build-rust-steps.yml
3440
with:
@@ -50,6 +56,13 @@ jobs:
5056
platform: 'windows'
5157
useWinML: true
5258
secrets: inherit
59+
build-python-windows-WinML:
60+
uses: ./.github/workflows/build-python-steps.yml
61+
with:
62+
version: '0.9.0.${{ github.run_number }}'
63+
platform: 'windows'
64+
useWinML: true
65+
secrets: inherit
5366
build-rust-windows-WinML:
5467
uses: ./.github/workflows/build-rust-steps.yml
5568
with:
@@ -70,6 +83,12 @@ jobs:
7083
version: '0.9.0.${{ github.run_number }}'
7184
platform: 'macos'
7285
secrets: inherit
86+
build-python-macos:
87+
uses: ./.github/workflows/build-python-steps.yml
88+
with:
89+
version: '0.9.0.${{ github.run_number }}'
90+
platform: 'macos'
91+
secrets: inherit
7392
build-rust-macos:
7493
uses: ./.github/workflows/build-rust-steps.yml
7594
with:

samples/cs/GettingStarted/Directory.Packages.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<OnnxRuntimeVersion>1.23.2</OnnxRuntimeVersion>
66
</PropertyGroup>
77
<ItemGroup>
8-
<PackageVersion Include="Microsoft.AI.Foundry.Local" Version="0.9.0" />
9-
<PackageVersion Include="Microsoft.AI.Foundry.Local.WinML" Version="0.9.0" />
8+
<PackageVersion Include="Microsoft.AI.Foundry.Local" Version="0.9.0-dev" />
9+
<PackageVersion Include="Microsoft.AI.Foundry.Local.WinML" Version="0.9.0-dev-20260324" />
1010
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.10" />
1111
<PackageVersion Include="OpenAI" Version="2.5.0" />
1212
</ItemGroup>

sdk/cs/src/FoundryModelInfo.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,16 @@ public record ModelInfo
119119

120120
[JsonPropertyName("createdAt")]
121121
public long CreatedAtUnix { get; init; }
122+
123+
[JsonPropertyName("contextLength")]
124+
public long? ContextLength { get; init; }
125+
126+
[JsonPropertyName("inputModalities")]
127+
public string? InputModalities { get; init; }
128+
129+
[JsonPropertyName("outputModalities")]
130+
public string? OutputModalities { get; init; }
131+
132+
[JsonPropertyName("capabilities")]
133+
public string? Capabilities { get; init; }
122134
}

sdk/js/docs/README.md

Lines changed: 85 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# @prathikrao/foundry-local-sdk
1+
# foundry-local-sdk
22

33
## Enumerations
44

@@ -462,6 +462,30 @@ get alias(): string;
462462

463463
`string`
464464

465+
##### capabilities
466+
467+
###### Get Signature
468+
469+
```ts
470+
get capabilities(): string | null;
471+
```
472+
473+
###### Returns
474+
475+
`string` \| `null`
476+
477+
##### contextLength
478+
479+
###### Get Signature
480+
481+
```ts
482+
get contextLength(): number | null;
483+
```
484+
485+
###### Returns
486+
487+
`number` \| `null`
488+
465489
##### id
466490

467491
###### Get Signature
@@ -474,6 +498,18 @@ get id(): string;
474498

475499
`string`
476500

501+
##### inputModalities
502+
503+
###### Get Signature
504+
505+
```ts
506+
get inputModalities(): string | null;
507+
```
508+
509+
###### Returns
510+
511+
`string` \| `null`
512+
477513
##### isCached
478514

479515
###### Get Signature
@@ -486,6 +522,18 @@ get isCached(): boolean;
486522

487523
`boolean`
488524

525+
##### outputModalities
526+
527+
###### Get Signature
528+
529+
```ts
530+
get outputModalities(): string | null;
531+
```
532+
533+
###### Returns
534+
535+
`string` \| `null`
536+
489537
##### path
490538

491539
###### Get Signature
@@ -498,6 +546,18 @@ get path(): string;
498546

499547
`string`
500548

549+
##### supportsToolCalling
550+
551+
###### Get Signature
552+
553+
```ts
554+
get supportsToolCalling(): boolean | null;
555+
```
556+
557+
###### Returns
558+
559+
`boolean` \| `null`
560+
501561
#### Methods
502562

503563
##### createAudioClient()
@@ -740,6 +800,18 @@ alias: string;
740800
cached: boolean;
741801
```
742802
803+
##### capabilities?
804+
805+
```ts
806+
optional capabilities?: string | null;
807+
```
808+
809+
##### contextLength?
810+
811+
```ts
812+
optional contextLength?: number | null;
813+
```
814+
743815
##### createdAtUnix
744816
745817
```ts
@@ -764,6 +836,12 @@ optional fileSizeMb?: number | null;
764836
id: string;
765837
```
766838
839+
##### inputModalities?
840+
841+
```ts
842+
optional inputModalities?: string | null;
843+
```
844+
767845
##### license?
768846
769847
```ts
@@ -806,6 +884,12 @@ modelType: string;
806884
name: string;
807885
```
808886
887+
##### outputModalities?
888+
889+
```ts
890+
optional outputModalities?: string | null;
891+
```
892+
809893
##### promptTemplate?
810894
811895
```ts

sdk/js/docs/classes/AudioClient.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[@prathikrao/foundry-local-sdk](../README.md) / AudioClient
1+
[foundry-local-sdk](../README.md) / AudioClient
22

33
# Class: AudioClient
44

sdk/js/docs/classes/AudioClientSettings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[@prathikrao/foundry-local-sdk](../README.md) / AudioClientSettings
1+
[foundry-local-sdk](../README.md) / AudioClientSettings
22

33
# Class: AudioClientSettings
44

sdk/js/docs/classes/Catalog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[@prathikrao/foundry-local-sdk](../README.md) / Catalog
1+
[foundry-local-sdk](../README.md) / Catalog
22

33
# Class: Catalog
44

sdk/js/docs/classes/ChatClient.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[@prathikrao/foundry-local-sdk](../README.md) / ChatClient
1+
[foundry-local-sdk](../README.md) / ChatClient
22

33
# Class: ChatClient
44

0 commit comments

Comments
 (0)