Commit 0579d42
fixes netstandard2.0 bug in embeddings request response types (#675)
```
E:\_work\1\s\sdk\cs\src\OpenAI\EmbeddingRequestResponseTypes.cs(60,16): error CS8604:
Possible null reference argument for parameter 'responseData' in 'EmbeddingCreateResponse EmbeddingRequestResponseExtensions.ToEmbeddingResponse(string responseData, ILogger logger)'.
[E:\_work\1\s\sdk\cs\src\Microsoft.AI.Foundry.Local.csproj::TargetFramework=netstandard2.0]
```
The null check string.IsNullOrWhiteSpace doesn't narrow the nullable
type under netstandard2.0's annotations. Needs to be response.Data! to
avoid error but we know it's not null or whitespace due to the check
above.
Co-authored-by: Prathik Rao <prathikrao@microsoft.com>1 parent 857aa22 commit 0579d42
2 files changed
Lines changed: 2 additions & 1 deletion
File tree
- sdk/cs
- src/OpenAI
- test/FoundryLocal.Tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
0 commit comments