Skip to content

Commit ddd732a

Browse files
committed
fix: Fixed xml doc for <defaul> tag.
1 parent a3244cd commit ddd732a

File tree

456 files changed

+24462
-2773
lines changed

Some content is hidden

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

456 files changed

+24462
-2773
lines changed

src/libs/AutoSDK/Sources/Sources.Models.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public sealed partial class {modelData.ClassName}
8989
{{
9090
{modelData.Properties.Select(property => @$"
9191
{property.Summary.ToXmlDocumentationSummary(level: 8)}
92-
{property.DefaultValue?.ToXmlDocumentationDefault(level: 8)}
92+
{property.DefaultValue?.ClearForXml().ToXmlDocumentationDefault(level: 8)}
9393
{property.Example?.ToXmlDocumentationExample(level: 8)}
9494
{jsonSerializer.GeneratePropertyAttribute(property.Id, property.IsRequired)}
9595
{jsonSerializer.GenerateConverterAttribute(property.ConverterType)}

src/tests/AutoSDK.SnapshotTests/Snapshots/Together/NewtonsoftJson/_#G.Api.Authorizations.Bearer.g.verified.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ public void AuthorizeUsingBearer(
1515
{
1616
apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey));
1717

18-
_authorizations.Clear();
19-
_authorizations.Add(new global::G.EndPointAuthorization
18+
Authorizations.Clear();
19+
Authorizations.Add(new global::G.EndPointAuthorization
2020
{
2121
Type = "Http",
2222
Location = "Header",

src/tests/AutoSDK.SnapshotTests/Snapshots/Together/NewtonsoftJson/_#G.Api.Constructors.Bearer.g.verified.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,19 @@ namespace G
66
{
77
public sealed partial class Api
88
{
9-
/// <inheritdoc cref="Api(global::System.Net.Http.HttpClient?, global::System.Uri?, global::System.Collections.Generic.List{global::G.EndPointAuthorization}?)"/>
9+
/// <inheritdoc cref="Api(global::System.Net.Http.HttpClient?, global::System.Uri?, global::System.Collections.Generic.List{global::G.EndPointAuthorization}?, bool)"/>
1010
public Api(
1111
string apiKey,
1212
global::System.Net.Http.HttpClient? httpClient = null,
1313
global::System.Uri? baseUri = null,
14-
global::System.Collections.Generic.List<global::G.EndPointAuthorization>? authorizations = null) : this(httpClient, baseUri, authorizations)
14+
global::System.Collections.Generic.List<global::G.EndPointAuthorization>? authorizations = null,
15+
bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient)
1516
{
16-
Authorizing(_httpClient, ref apiKey);
17+
Authorizing(HttpClient, ref apiKey);
1718

1819
AuthorizeUsingBearer(apiKey);
1920

20-
Authorized(_httpClient);
21+
Authorized(HttpClient);
2122
}
2223

2324
partial void Authorizing(

src/tests/AutoSDK.SnapshotTests/Snapshots/Together/NewtonsoftJson/_#G.Api.g.verified.cs

Lines changed: 47 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,24 @@ public sealed partial class Api : global::G.IApi, global::System.IDisposable
1414
/// <summary>
1515
///
1616
/// </summary>
17-
public const string BaseUrl = "https://api.together.xyz/v1";
17+
public const string DefaultBaseUrl = "https://api.together.xyz/v1";
1818

19-
private readonly global::System.Net.Http.HttpClient _httpClient;
20-
private global::System.Collections.Generic.List<global::G.EndPointAuthorization> _authorizations;
19+
private bool _disposeHttpClient = true;
2120

21+
/// <inheritdoc/>
22+
public global::System.Net.Http.HttpClient HttpClient { get; }
23+
24+
/// <inheritdoc/>
25+
public System.Uri? BaseUri => HttpClient.BaseAddress;
26+
27+
/// <inheritdoc/>
28+
public global::System.Collections.Generic.List<global::G.EndPointAuthorization> Authorizations { get; }
29+
30+
/// <inheritdoc/>
31+
public bool ReadResponseAsString { get; set; }
32+
#if DEBUG
33+
= true;
34+
#endif
2235
/// <summary>
2336
///
2437
/// </summary>
@@ -28,64 +41,72 @@ public sealed partial class Api : global::G.IApi, global::System.IDisposable
2841
/// <summary>
2942
///
3043
/// </summary>
31-
public ChatClient Chat => new ChatClient(_httpClient, authorizations: _authorizations)
44+
public ChatClient Chat => new ChatClient(HttpClient, authorizations: Authorizations)
3245
{
46+
ReadResponseAsString = ReadResponseAsString,
3347
JsonSerializerOptions = JsonSerializerOptions,
3448
};
3549

3650
/// <summary>
3751
///
3852
/// </summary>
39-
public CompletionClient Completion => new CompletionClient(_httpClient, authorizations: _authorizations)
53+
public CompletionClient Completion => new CompletionClient(HttpClient, authorizations: Authorizations)
4054
{
55+
ReadResponseAsString = ReadResponseAsString,
4156
JsonSerializerOptions = JsonSerializerOptions,
4257
};
4358

4459
/// <summary>
4560
///
4661
/// </summary>
47-
public EmbeddingsClient Embeddings => new EmbeddingsClient(_httpClient, authorizations: _authorizations)
62+
public EmbeddingsClient Embeddings => new EmbeddingsClient(HttpClient, authorizations: Authorizations)
4863
{
64+
ReadResponseAsString = ReadResponseAsString,
4965
JsonSerializerOptions = JsonSerializerOptions,
5066
};
5167

5268
/// <summary>
5369
///
5470
/// </summary>
55-
public FilesClient Files => new FilesClient(_httpClient, authorizations: _authorizations)
71+
public FilesClient Files => new FilesClient(HttpClient, authorizations: Authorizations)
5672
{
73+
ReadResponseAsString = ReadResponseAsString,
5774
JsonSerializerOptions = JsonSerializerOptions,
5875
};
5976

6077
/// <summary>
6178
///
6279
/// </summary>
63-
public FineTuningClient FineTuning => new FineTuningClient(_httpClient, authorizations: _authorizations)
80+
public FineTuningClient FineTuning => new FineTuningClient(HttpClient, authorizations: Authorizations)
6481
{
82+
ReadResponseAsString = ReadResponseAsString,
6583
JsonSerializerOptions = JsonSerializerOptions,
6684
};
6785

6886
/// <summary>
6987
///
7088
/// </summary>
71-
public ImagesClient Images => new ImagesClient(_httpClient, authorizations: _authorizations)
89+
public ImagesClient Images => new ImagesClient(HttpClient, authorizations: Authorizations)
7290
{
91+
ReadResponseAsString = ReadResponseAsString,
7392
JsonSerializerOptions = JsonSerializerOptions,
7493
};
7594

7695
/// <summary>
7796
///
7897
/// </summary>
79-
public ModelsClient Models => new ModelsClient(_httpClient, authorizations: _authorizations)
98+
public ModelsClient Models => new ModelsClient(HttpClient, authorizations: Authorizations)
8099
{
100+
ReadResponseAsString = ReadResponseAsString,
81101
JsonSerializerOptions = JsonSerializerOptions,
82102
};
83103

84104
/// <summary>
85105
///
86106
/// </summary>
87-
public RerankClient Rerank => new RerankClient(_httpClient, authorizations: _authorizations)
107+
public RerankClient Rerank => new RerankClient(HttpClient, authorizations: Authorizations)
88108
{
109+
ReadResponseAsString = ReadResponseAsString,
89110
JsonSerializerOptions = JsonSerializerOptions,
90111
};
91112

@@ -94,25 +115,31 @@ public sealed partial class Api : global::G.IApi, global::System.IDisposable
94115
/// If no httpClient is provided, a new one will be created.
95116
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
96117
/// </summary>
97-
/// <param name="httpClient"></param>
98-
/// <param name="baseUri"></param>
99-
/// <param name="authorizations"></param>
118+
/// <param name="httpClient">The HttpClient instance. If not provided, a new one will be created.</param>
119+
/// <param name="baseUri">The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used.</param>
120+
/// <param name="authorizations">The authorizations to use for the requests.</param>
121+
/// <param name="disposeHttpClient">Dispose the HttpClient when the instance is disposed. True by default.</param>
100122
public Api(
101123
global::System.Net.Http.HttpClient? httpClient = null,
102124
global::System.Uri? baseUri = null,
103-
global::System.Collections.Generic.List<global::G.EndPointAuthorization>? authorizations = null)
125+
global::System.Collections.Generic.List<global::G.EndPointAuthorization>? authorizations = null,
126+
bool disposeHttpClient = true)
104127
{
105-
_httpClient = httpClient ?? new global::System.Net.Http.HttpClient();
106-
_httpClient.BaseAddress ??= baseUri ?? new global::System.Uri(BaseUrl);
107-
_authorizations = authorizations ?? new global::System.Collections.Generic.List<global::G.EndPointAuthorization>();
128+
HttpClient = httpClient ?? new global::System.Net.Http.HttpClient();
129+
HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl);
130+
Authorizations = authorizations ?? new global::System.Collections.Generic.List<global::G.EndPointAuthorization>();
131+
_disposeHttpClient = disposeHttpClient;
108132

109-
Initialized(_httpClient);
133+
Initialized(HttpClient);
110134
}
111135

112136
/// <inheritdoc/>
113137
public void Dispose()
114138
{
115-
_httpClient.Dispose();
139+
if (_disposeHttpClient)
140+
{
141+
HttpClient.Dispose();
142+
}
116143
}
117144

118145
partial void Initialized(

0 commit comments

Comments
 (0)