Commit ca93613
Enhance C# generator with richer typing and data annotations (#1067)
* Enhance C# generator with richer typing and data annotations
- integer -> long, number -> double (was double for both)
- format: date-time -> DateTimeOffset, uuid -> Guid, duration -> TimeSpan
- Add MillisecondsTimeSpanConverter for TimeSpan JSON serialization
- Emit [Range], [RegularExpression], [Url], [MinLength], [MaxLength]
- Emit [StringSyntax(Uri)], [StringSyntax(Regex)], [Base64String]
- Change all public collections from concrete to interface types
(List<T> -> IList<T>, Dictionary<K,V> -> IDictionary<K,V>)
- Lazy-initialize collection properties via field ??= pattern
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Update ListSessionsAsync return type in docs to IList
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix clone comparer preservation and byok doc example
Preserve dictionary comparer in SessionConfig/ResumeSessionConfig
Clone() by checking for Dictionary<> and passing its Comparer.
Fix byok.md to use Task.FromResult<IList<ModelInfo>>() for the
updated delegate signature.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address review: Range(Type,string,string) for long, add SDK using to Rpc
Use Range(typeof(long), ...) overload since RangeAttribute has no
long constructor. Add 'using GitHub.Copilot.SDK' to Rpc.cs header
so MillisecondsTimeSpanConverter resolves when duration fields exist.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix Go doc example: type-assert SessionEventData to AssistantMessageData
The Go SDK uses per-event-type data structs, so response.Data is a
SessionEventData interface. Access Content by type-asserting to
*copilot.AssistantMessageData.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Remove unnecessary using GitHub.Copilot.SDK from Rpc.cs generator
Rpc.cs is in namespace GitHub.Copilot.SDK.Rpc, a child of
GitHub.Copilot.SDK, so types from the parent namespace resolve
automatically without an explicit using directive.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 70b7721 commit ca93613
File tree
13 files changed
+258
-105
lines changed- docs
- auth
- setup
- dotnet
- src
- Generated
- test
- scripts/codegen
13 files changed
+258
-105
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
429 | | - | |
| 429 | + | |
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
103 | 105 | | |
104 | 106 | | |
105 | 107 | | |
| |||
115 | 117 | | |
116 | 118 | | |
117 | 119 | | |
118 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
119 | 123 | | |
120 | 124 | | |
121 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
| 134 | + | |
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
735 | 735 | | |
736 | 736 | | |
737 | 737 | | |
738 | | - | |
| 738 | + | |
739 | 739 | | |
740 | 740 | | |
741 | 741 | | |
| |||
746 | 746 | | |
747 | 747 | | |
748 | 748 | | |
749 | | - | |
| 749 | + | |
750 | 750 | | |
751 | 751 | | |
752 | 752 | | |
| |||
847 | 847 | | |
848 | 848 | | |
849 | 849 | | |
850 | | - | |
| 850 | + | |
851 | 851 | | |
852 | 852 | | |
853 | 853 | | |
| |||
1467 | 1467 | | |
1468 | 1468 | | |
1469 | 1469 | | |
1470 | | - | |
| 1470 | + | |
1471 | 1471 | | |
1472 | 1472 | | |
1473 | 1473 | | |
| |||
1621 | 1621 | | |
1622 | 1622 | | |
1623 | 1623 | | |
1624 | | - | |
| 1624 | + | |
1625 | 1625 | | |
1626 | | - | |
1627 | | - | |
| 1626 | + | |
| 1627 | + | |
1628 | 1628 | | |
1629 | 1629 | | |
1630 | 1630 | | |
1631 | 1631 | | |
1632 | 1632 | | |
1633 | 1633 | | |
1634 | | - | |
| 1634 | + | |
1635 | 1635 | | |
1636 | | - | |
| 1636 | + | |
1637 | 1637 | | |
1638 | 1638 | | |
1639 | 1639 | | |
1640 | | - | |
1641 | | - | |
| 1640 | + | |
| 1641 | + | |
1642 | 1642 | | |
1643 | | - | |
| 1643 | + | |
1644 | 1644 | | |
1645 | 1645 | | |
1646 | 1646 | | |
| |||
1673 | 1673 | | |
1674 | 1674 | | |
1675 | 1675 | | |
1676 | | - | |
| 1676 | + | |
1677 | 1677 | | |
1678 | | - | |
1679 | | - | |
| 1678 | + | |
| 1679 | + | |
1680 | 1680 | | |
1681 | 1681 | | |
1682 | 1682 | | |
| |||
1686 | 1686 | | |
1687 | 1687 | | |
1688 | 1688 | | |
1689 | | - | |
| 1689 | + | |
1690 | 1690 | | |
1691 | | - | |
| 1691 | + | |
1692 | 1692 | | |
1693 | | - | |
1694 | | - | |
| 1693 | + | |
| 1694 | + | |
1695 | 1695 | | |
1696 | | - | |
| 1696 | + | |
1697 | 1697 | | |
1698 | 1698 | | |
1699 | 1699 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments