Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# For more information, see https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners

# The '*' pattern represents global owners.
* @joseharriaga @trrwilson @ShivangiReja
* @joseharriaga @christothes @ShivangiReja @jsquire
18 changes: 9 additions & 9 deletions .github/workflows/codegen-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
validate-codegen:
name: Validate Code Generation
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -29,7 +29,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '22.x'

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
Expand All @@ -41,14 +41,14 @@ jobs:
run: |
Write-Host "Running code generation validation..."
./scripts/Invoke-CodeGen.ps1 -Clean

if ($LASTEXITCODE -ne 0) {
Write-Error "Code generation failed with exit code: $LASTEXITCODE"
exit $LASTEXITCODE
}

Write-Host "Code generation completed successfully!"

- name: Check for uncommitted changes
run: |
# Check if there are any changes to tracked files after code generation
Expand All @@ -60,24 +60,24 @@ jobs:
git diff
exit 1
fi

# Also check for untracked files that might have been generated
if [ -n "$(git ls-files --others --exclude-standard)" ]; then
echo "::error::Code generation produced untracked files. Please review and commit them if they should be included."
echo "Untracked files:"
git ls-files --others --exclude-standard
exit 1
fi

echo "No uncommitted changes detected - code generation is up to date!"

- name: Run codegen visitor tests
run: dotnet test codegen/generator/test/
--configuration Release
--logger "trx;LogFilePrefix=codegen"
--results-directory ${{github.workspace}}/artifacts/test-results
${{ env.version_suffix_args}}

- name: Upload artifacts
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/live-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ jobs:
env:
version_suffix_args: ${{ format('/p:VersionSuffix="alpha.{0}"', github.run_number) }}
steps:
- name: Setup .NET
- name: Setup .NET 10
uses: actions/setup-dotnet@v3
with:
dotnet-version: '10.x'

- name: Setup .NET 9
uses: actions/setup-dotnet@v3
with:
dotnet-version: '9.x'
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ jobs:
env:
version_suffix_args: ${{ format('/p:VersionSuffix="alpha.{0}"', github.run_number) }}
steps:
- name: Setup .NET
- name: Setup .NET 10
uses: actions/setup-dotnet@v3
with:
dotnet-version: '10.x'

- name: Setup .NET 9
uses: actions/setup-dotnet@v3
with:
dotnet-version: '9.x'
Expand Down
19 changes: 12 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ jobs:
env:
version_suffix_args: ${{ github.event_name == 'schedule' && format('/p:VersionSuffix="alpha.{0}"', github.run_number) || '' }}
steps:
- name: Setup .NET
- name: Setup .NET 10
uses: actions/setup-dotnet@v3
with:
dotnet-version: '10.x'

- name: Setup .NET 9
uses: actions/setup-dotnet@v3
with:
dotnet-version: '9.x'
Expand Down Expand Up @@ -78,22 +83,22 @@ jobs:
environment: release # Needed for OIDC subject for releases triggered on release being created.
permissions:
id-token: write # Required for requesting the JWT

steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: ${{ github.workspace }}/build-artifacts

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '9.x'

- name: Install Sign CLI tool
run: dotnet tool install --tool-path . --prerelease sign

- name: 'Az CLI login'
uses: azure/login@v2
with:
Expand All @@ -113,13 +118,13 @@ jobs:
--azure-credential-type "azure-cli"
--azure-key-vault-url "https://sc-openaisdk.vault.azure.net/"
--azure-key-vault-certificate "OpenAISDKSCCert"

- name: Upload signed artifact
uses: actions/upload-artifact@v4
with:
name: build-artifacts-signed
path: ${{ github.workspace }}/build-artifacts

deploy:
name: Publish package
needs: sign
Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "9.0.306",
"version": "10.0.100",
"rollForward": "feature"
}
}
}
1 change: 1 addition & 0 deletions nuget.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<packageSource key="azure-sdk-dev-feed">
<package pattern="System.ClientModel" />
<package pattern="Microsoft.ClientModel.TestFramework" />
<package pattern="Azure.Sdk.Tools.*" />
</packageSource>
<packageSource key="nuget">
<package pattern="*" />
Expand Down
28 changes: 17 additions & 11 deletions src/OpenAI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<Description>
The official .NET library for the OpenAI service API.
</Description>
<AssemblyTitle>SDK Code Generation OpenAI</AssemblyTitle>
<AssemblyTitle>OpenAI client library for .NET</AssemblyTitle>
<PackageTags>OpenAI;openai-dotnet;ChatGPT;Dall-E</PackageTags>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Copyright>Copyright (c) 2024 OpenAI (https://openai.com)</Copyright>
<Copyright>Copyright (c) 2025 OpenAI (https://openai.com)</Copyright>

<VersionPrefix>2.8.0</VersionPrefix>
<VersionSuffix></VersionSuffix>

<TargetFrameworks>net8.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net10.0;net8.0;netstandard2.0</TargetFrameworks>
<LangVersion>latest</LangVersion>

<!-- Generate an XML documentation file for the project. -->
Expand Down Expand Up @@ -62,23 +62,29 @@
<InternalsVisibleTo Include="Azure.AI.OpenAI" Condition="'$(Configuration)' == 'Unsigned'" />
</ItemGroup>

<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<!-- Normalize stored file paths in symbols when in a CI build. -->
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
<ItemGroup>
<None Include="OpenAI.png" Pack="true" PackagePath="\" />
<None Include="..\CHANGELOG.md" Pack="true" PackagePath="\" />
<None Include="..\README.md" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="System.ClientModel" Version="1.8.1" />
<PackageReference Include="System.Net.ServerSentEvents" Version="9.0.9" />
<PackageReference Include="System.Net.ServerSentEvents" Version="10.0.0" />
</ItemGroup>

<ItemGroup Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="10.0.0" />
</ItemGroup>

<ItemGroup Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="8.0.1" />
<!-- Build-only dependencies -->
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
</ItemGroup>

<!-- Build and release configuration -->
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<!-- Normalize stored file paths in symbols when in a CI build. -->
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
</Project>
27 changes: 16 additions & 11 deletions tests/OpenAI.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net9.0</TargetFrameworks>
<TargetFrameworks>net10.0;net9.0;net8.0</TargetFrameworks>
<LangVersion>latest</LangVersion>

<!--Ignore XML doc comments on test types and members-->
<NoWarn>$(NoWarn);CS1591</NoWarn>

<!-- OPENAI001 - Ignore experimental warnings-->
<NoWarn>$(NoWarn);OPENAI001;SCME0001;</NoWarn>

<LangVersion>latest</LangVersion>
<!-- OPENAI001 - Ignore experimental warnings-->
<NoWarn>$(NoWarn);OPENAI001;OPENAI002;SCME0001;</NoWarn>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\src\OpenAI.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageReference Include="NUnit" Version="4.4.0" />
<PackageReference Include="NUnit3TestAdapter" Version="5.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Microsoft.ClientModel.TestFramework" Version="1.0.0-alpha.20250919.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="Moq" Version="[4.18.2]" />
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
<PackageReference Include="Microsoft.ClientModel.TestFramework" Version="1.0.0-alpha.20250919.1" />
<PackageReference Include="NUnit" Version="4.4.0" />
<PackageReference Include="NUnit3TestAdapter" Version="6.0.0" />
<PackageReference Include="System.Linq.AsyncEnumerable" Version="10.0.0" />
</ItemGroup>

<!-- Conditionally include packages built into the latest runtime -->
<ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net10.0')) == 'false'">
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="10.0.0" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\src\Utility\Telemetry\*.cs" LinkBase="Telemetry\Shared" />
<Compile Include="..\src\Utility\AppContextSwitchHelper.cs" LinkBase="Telemetry\Shared" />
Expand Down
5 changes: 4 additions & 1 deletion tests/Responses/ResponsesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,10 @@ public async Task AllInstructionMethodsWork(ResponsesTestInstructionMethod instr
}

List<ResponseItem> listedItems = [];
await client.GetResponseInputItemsAsync(new ResponseItemCollectionOptions(response.Id)).ForEachAsync(item => listedItems.Add(item));
await foreach (var item in client.GetResponseInputItemsAsync(response.Id))
{
listedItems.Add(item);
}

if (instructionMethod == ResponsesTestInstructionMethod.InstructionsProperty)
{
Expand Down
Loading