Skip to content

Commit

Permalink
fix: Don't use System namespace for AnyOf like types.
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed Sep 10, 2024
1 parent 255949b commit e4253d6
Show file tree
Hide file tree
Showing 1,299 changed files with 4,797 additions and 4,799 deletions.
4 changes: 1 addition & 3 deletions src/libs/AutoSDK/Models/AnyOfData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ public static AnyOfData FromSchemaContext(SchemaContext context)
context.Settings.JsonSerializerType == JsonSerializerType.SystemTextJson &&
(!string.IsNullOrWhiteSpace(context.Settings.JsonSerializerContext) ||
context.Settings.GenerateJsonSerializerContextTypes),
Namespace: context.IsComponent
? context.Settings.Namespace
: "System",
Namespace: context.Settings.Namespace,
Name: context.IsComponent
? context.Id
: string.Empty,
Expand Down
6 changes: 3 additions & 3 deletions src/libs/AutoSDK/Models/TypeData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ public static string GetCSharpType(SchemaContext context, SchemaContext? additio
(_, _) when context.Schema.IsOneOf() && context.IsComponent => ($"global::{context.Settings.Namespace}.{context.Id}", true),
(_, _) when context.Schema.IsAllOf() && context.IsComponent => ($"global::{context.Settings.Namespace}.{context.Id}", true),

(_, _) when context.Schema.IsAnyOf() => ($"global::System.AnyOf<{string.Join(", ", context.Children.Where(x => x.Hint == Hint.AnyOf).Select(x => x.TypeData?.CSharpTypeWithNullabilityForValueTypes))}>", true),
(_, _) when context.Schema.IsOneOf() => ($"global::System.OneOf<{string.Join(", ", context.Children.Where(x => x.Hint == Hint.OneOf).Select(x => x.TypeData?.CSharpTypeWithNullabilityForValueTypes))}>", true),
(_, _) when context.Schema.IsAllOf() => ($"global::System.AllOf<{string.Join(", ", context.Children.Where(x => x.Hint == Hint.AllOf).Select(x => x.TypeData?.CSharpTypeWithNullabilityForValueTypes))}>", true),
(_, _) when context.Schema.IsAnyOf() => ($"global::{context.Settings.Namespace}.AnyOf<{string.Join(", ", context.Children.Where(x => x.Hint == Hint.AnyOf).Select(x => x.TypeData?.CSharpTypeWithNullabilityForValueTypes))}>", true),
(_, _) when context.Schema.IsOneOf() => ($"global::{context.Settings.Namespace}.OneOf<{string.Join(", ", context.Children.Where(x => x.Hint == Hint.OneOf).Select(x => x.TypeData?.CSharpTypeWithNullabilityForValueTypes))}>", true),
(_, _) when context.Schema.IsAllOf() => ($"global::{context.Settings.Namespace}.AllOf<{string.Join(", ", context.Children.Where(x => x.Hint == Hint.AllOf).Select(x => x.TypeData?.CSharpTypeWithNullabilityForValueTypes))}>", true),

("object", _) or (null, _) when context.Schema.Reference != null =>
($"global::{context.Settings.Namespace}.{context.Id}", true),
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static string GenerateAnyOfJsonConverter(
? $"{subType}JsonConverter{types}"
: $"{name}JsonConverter";
var typeNameWithTypes = string.IsNullOrWhiteSpace(name)
? $"global::System.{subType}{types}"
? $"global::{@namespace}.{subType}{types}"
: $"global::{@namespace}.{name}";
var allTypes = fixedTypes.IsEmpty
? Enumerable
Expand Down Expand Up @@ -156,7 +156,7 @@ public sealed class {subType}JsonConverterFactory{count} : global::System.Text.J
/// <inheritdoc />
public override bool CanConvert(global::System.Type? typeToConvert)
{{
return typeToConvert is {{ IsGenericType: true }} && typeToConvert.GetGenericTypeDefinition() == typeof(global::System.{subType}{types});
return typeToConvert is {{ IsGenericType: true }} && typeToConvert.GetGenericTypeDefinition() == typeof(global::{anyOfData.Settings.Namespace}.{subType}{types});
}}
/// <inheritdoc />
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#nullable enable

namespace System
namespace G
{
/// <summary>
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#nullable enable

namespace System
namespace G
{
/// <summary>
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ partial void ProcessV1EmbedResponseContent(
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<global::G.V1EmbedResponse> V1EmbedAsync(
global::System.Collections.Generic.IList<string> texts,
global::System.AllOf<global::G.EmbedType?>? type = default,
global::G.AllOf<global::G.EmbedType?>? type = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var request = new global::G.EmbeddingsBody
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ partial void ProcessV1J2UltraChatResponseContent(
global::System.Collections.Generic.IList<global::G.ChatMessage> messages,
string system,
string? model = "j2-ultra",
global::System.AllOf<global::G.Penalty>? frequencyPenalty = default,
global::System.AllOf<global::G.Penalty>? presencePenalty = default,
global::System.AllOf<global::G.Penalty>? countPenalty = default,
global::G.AllOf<global::G.Penalty>? frequencyPenalty = default,
global::G.AllOf<global::G.Penalty>? presencePenalty = default,
global::G.AllOf<global::G.Penalty>? countPenalty = default,
int numResults = 1,
double temperature = 0.7,
int maxTokens = 300,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ partial void ProcessV1J2GrandeCompleteResponseContent(
global::System.Collections.Generic.IList<string>? stopSequences = default,
int topKReturn = 0,
global::G.CompletionBodyLogitBias? logitBias = default,
global::System.AllOf<global::G.Penalty>? frequencyPenalty = default,
global::System.AllOf<global::G.Penalty>? presencePenalty = default,
global::System.AllOf<global::G.Penalty>? countPenalty = default,
global::G.AllOf<global::G.Penalty>? frequencyPenalty = default,
global::G.AllOf<global::G.Penalty>? presencePenalty = default,
global::G.AllOf<global::G.Penalty>? countPenalty = default,
int epoch = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ partial void ProcessV1J2GrandeCustomModelCompleteResponseContent(
global::System.Collections.Generic.IList<string>? stopSequences = default,
int topKReturn = 0,
global::G.CompletionBodyLogitBias? logitBias = default,
global::System.AllOf<global::G.Penalty>? frequencyPenalty = default,
global::System.AllOf<global::G.Penalty>? presencePenalty = default,
global::System.AllOf<global::G.Penalty>? countPenalty = default,
global::G.AllOf<global::G.Penalty>? frequencyPenalty = default,
global::G.AllOf<global::G.Penalty>? presencePenalty = default,
global::G.AllOf<global::G.Penalty>? countPenalty = default,
int epoch = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ partial void ProcessV1J2GrandeInstructCompleteResponseContent(
global::System.Collections.Generic.IList<string>? stopSequences = default,
int topKReturn = 0,
global::G.CompletionBodyLogitBias? logitBias = default,
global::System.AllOf<global::G.Penalty>? frequencyPenalty = default,
global::System.AllOf<global::G.Penalty>? presencePenalty = default,
global::System.AllOf<global::G.Penalty>? countPenalty = default,
global::G.AllOf<global::G.Penalty>? frequencyPenalty = default,
global::G.AllOf<global::G.Penalty>? presencePenalty = default,
global::G.AllOf<global::G.Penalty>? countPenalty = default,
int epoch = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ partial void ProcessV1J2JumboCompleteResponseContent(
global::System.Collections.Generic.IList<string>? stopSequences = default,
int topKReturn = 0,
global::G.CompletionBodyLogitBias? logitBias = default,
global::System.AllOf<global::G.Penalty>? frequencyPenalty = default,
global::System.AllOf<global::G.Penalty>? presencePenalty = default,
global::System.AllOf<global::G.Penalty>? countPenalty = default,
global::G.AllOf<global::G.Penalty>? frequencyPenalty = default,
global::G.AllOf<global::G.Penalty>? presencePenalty = default,
global::G.AllOf<global::G.Penalty>? countPenalty = default,
int epoch = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ partial void ProcessV1J2JumboComplete2ResponseContent(
global::System.Collections.Generic.IList<string>? stopSequences = default,
int topKReturn = 0,
global::G.CompletionBodyLogitBias? logitBias = default,
global::System.AllOf<global::G.Penalty>? frequencyPenalty = default,
global::System.AllOf<global::G.Penalty>? presencePenalty = default,
global::System.AllOf<global::G.Penalty>? countPenalty = default,
global::G.AllOf<global::G.Penalty>? frequencyPenalty = default,
global::G.AllOf<global::G.Penalty>? presencePenalty = default,
global::G.AllOf<global::G.Penalty>? countPenalty = default,
int epoch = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ partial void ProcessV1J2JumboInstructCompleteResponseContent(
global::System.Collections.Generic.IList<string>? stopSequences = default,
int topKReturn = 0,
global::G.CompletionBodyLogitBias? logitBias = default,
global::System.AllOf<global::G.Penalty>? frequencyPenalty = default,
global::System.AllOf<global::G.Penalty>? presencePenalty = default,
global::System.AllOf<global::G.Penalty>? countPenalty = default,
global::G.AllOf<global::G.Penalty>? frequencyPenalty = default,
global::G.AllOf<global::G.Penalty>? presencePenalty = default,
global::G.AllOf<global::G.Penalty>? countPenalty = default,
int epoch = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ partial void ProcessV1J2LargeCompleteResponseContent(
global::System.Collections.Generic.IList<string>? stopSequences = default,
int topKReturn = 0,
global::G.CompletionBodyLogitBias? logitBias = default,
global::System.AllOf<global::G.Penalty>? frequencyPenalty = default,
global::System.AllOf<global::G.Penalty>? presencePenalty = default,
global::System.AllOf<global::G.Penalty>? countPenalty = default,
global::G.AllOf<global::G.Penalty>? frequencyPenalty = default,
global::G.AllOf<global::G.Penalty>? presencePenalty = default,
global::G.AllOf<global::G.Penalty>? countPenalty = default,
int epoch = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ partial void ProcessV1J2LargeCustomModelCompleteResponseContent(
global::System.Collections.Generic.IList<string>? stopSequences = default,
int topKReturn = 0,
global::G.CompletionBodyLogitBias? logitBias = default,
global::System.AllOf<global::G.Penalty>? frequencyPenalty = default,
global::System.AllOf<global::G.Penalty>? presencePenalty = default,
global::System.AllOf<global::G.Penalty>? countPenalty = default,
global::G.AllOf<global::G.Penalty>? frequencyPenalty = default,
global::G.AllOf<global::G.Penalty>? presencePenalty = default,
global::G.AllOf<global::G.Penalty>? countPenalty = default,
int epoch = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ partial void ProcessV1J2LargeInstructCompleteResponseContent(
global::System.Collections.Generic.IList<string>? stopSequences = default,
int topKReturn = 0,
global::G.CompletionBodyLogitBias? logitBias = default,
global::System.AllOf<global::G.Penalty>? frequencyPenalty = default,
global::System.AllOf<global::G.Penalty>? presencePenalty = default,
global::System.AllOf<global::G.Penalty>? countPenalty = default,
global::G.AllOf<global::G.Penalty>? frequencyPenalty = default,
global::G.AllOf<global::G.Penalty>? presencePenalty = default,
global::G.AllOf<global::G.Penalty>? countPenalty = default,
int epoch = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ partial void ProcessV1J2LightCompleteResponseContent(
global::System.Collections.Generic.IList<string>? stopSequences = default,
int topKReturn = 0,
global::G.CompletionBodyLogitBias? logitBias = default,
global::System.AllOf<global::G.Penalty>? frequencyPenalty = default,
global::System.AllOf<global::G.Penalty>? presencePenalty = default,
global::System.AllOf<global::G.Penalty>? countPenalty = default,
global::G.AllOf<global::G.Penalty>? frequencyPenalty = default,
global::G.AllOf<global::G.Penalty>? presencePenalty = default,
global::G.AllOf<global::G.Penalty>? countPenalty = default,
int epoch = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ partial void ProcessV1J2LightCustomModelCompleteResponseContent(
global::System.Collections.Generic.IList<string>? stopSequences = default,
int topKReturn = 0,
global::G.CompletionBodyLogitBias? logitBias = default,
global::System.AllOf<global::G.Penalty>? frequencyPenalty = default,
global::System.AllOf<global::G.Penalty>? presencePenalty = default,
global::System.AllOf<global::G.Penalty>? countPenalty = default,
global::G.AllOf<global::G.Penalty>? frequencyPenalty = default,
global::G.AllOf<global::G.Penalty>? presencePenalty = default,
global::G.AllOf<global::G.Penalty>? countPenalty = default,
int epoch = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ partial void ProcessV1J2MidCompleteResponseContent(
global::System.Collections.Generic.IList<string>? stopSequences = default,
int topKReturn = 0,
global::G.CompletionBodyLogitBias? logitBias = default,
global::System.AllOf<global::G.Penalty>? frequencyPenalty = default,
global::System.AllOf<global::G.Penalty>? presencePenalty = default,
global::System.AllOf<global::G.Penalty>? countPenalty = default,
global::G.AllOf<global::G.Penalty>? frequencyPenalty = default,
global::G.AllOf<global::G.Penalty>? presencePenalty = default,
global::G.AllOf<global::G.Penalty>? countPenalty = default,
int epoch = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ partial void ProcessV1J2MidCustomModelCompleteResponseContent(
global::System.Collections.Generic.IList<string>? stopSequences = default,
int topKReturn = 0,
global::G.CompletionBodyLogitBias? logitBias = default,
global::System.AllOf<global::G.Penalty>? frequencyPenalty = default,
global::System.AllOf<global::G.Penalty>? presencePenalty = default,
global::System.AllOf<global::G.Penalty>? countPenalty = default,
global::G.AllOf<global::G.Penalty>? frequencyPenalty = default,
global::G.AllOf<global::G.Penalty>? presencePenalty = default,
global::G.AllOf<global::G.Penalty>? countPenalty = default,
int epoch = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ partial void ProcessV1J2UltraCompleteResponseContent(
global::System.Collections.Generic.IList<string>? stopSequences = default,
int topKReturn = 0,
global::G.CompletionBodyLogitBias? logitBias = default,
global::System.AllOf<global::G.Penalty>? frequencyPenalty = default,
global::System.AllOf<global::G.Penalty>? presencePenalty = default,
global::System.AllOf<global::G.Penalty>? countPenalty = default,
global::G.AllOf<global::G.Penalty>? frequencyPenalty = default,
global::G.AllOf<global::G.Penalty>? presencePenalty = default,
global::G.AllOf<global::G.Penalty>? countPenalty = default,
int epoch = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ partial void ProcessV1J2UltraComplete2ResponseContent(
global::System.Collections.Generic.IList<string>? stopSequences = default,
int topKReturn = 0,
global::G.CompletionBodyLogitBias? logitBias = default,
global::System.AllOf<global::G.Penalty>? frequencyPenalty = default,
global::System.AllOf<global::G.Penalty>? presencePenalty = default,
global::System.AllOf<global::G.Penalty>? countPenalty = default,
global::G.AllOf<global::G.Penalty>? frequencyPenalty = default,
global::G.AllOf<global::G.Penalty>? presencePenalty = default,
global::G.AllOf<global::G.Penalty>? countPenalty = default,
int epoch = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
Expand Down
Loading

0 comments on commit e4253d6

Please sign in to comment.