Skip to content
Open
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
8 changes: 0 additions & 8 deletions src/libs/Ollama/Generated/Ollama..JsonSerializerContext.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,12 @@ namespace Ollama
DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull,
Converters = new global::System.Type[]
{
typeof(global::Ollama.JsonConverters.ResponseFormatEnumJsonConverter),
typeof(global::Ollama.JsonConverters.ResponseFormatEnumNullableJsonConverter),
typeof(global::Ollama.JsonConverters.MessageRoleJsonConverter),
typeof(global::Ollama.JsonConverters.MessageRoleNullableJsonConverter),
typeof(global::Ollama.JsonConverters.ToolTypeJsonConverter),
typeof(global::Ollama.JsonConverters.ToolTypeNullableJsonConverter),
typeof(global::Ollama.JsonConverters.DoneReasonEnumJsonConverter),
typeof(global::Ollama.JsonConverters.DoneReasonEnumNullableJsonConverter),
typeof(global::Ollama.JsonConverters.CreateModelStatusEnumJsonConverter),
typeof(global::Ollama.JsonConverters.CreateModelStatusEnumNullableJsonConverter),
typeof(global::Ollama.JsonConverters.CapabilityJsonConverter),
typeof(global::Ollama.JsonConverters.CapabilityNullableJsonConverter),
typeof(global::Ollama.JsonConverters.PullModelStatusEnumJsonConverter),
typeof(global::Ollama.JsonConverters.PullModelStatusEnumNullableJsonConverter),
typeof(global::Ollama.JsonConverters.PushModelResponseStatusJsonConverter),
typeof(global::Ollama.JsonConverters.PushModelResponseStatusNullableJsonConverter),
typeof(global::Ollama.JsonConverters.ResponseFormatJsonConverter),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ public class CreateModelStatusJsonConverter : global::System.Text.Json.Serializa
}

readerCopy = reader;
global::Ollama.CreateModelStatusEnum? value2 = default;
string? value2 = default;
try
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ollama.CreateModelStatusEnum), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Ollama.CreateModelStatusEnum> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ollama.CreateModelStatusEnum).Name}");
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(string), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<string> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(string).Name}");
value2 = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo);
}
catch (global::System.Text.Json.JsonException)
Expand All @@ -53,8 +53,8 @@ public class CreateModelStatusJsonConverter : global::System.Text.Json.Serializa
}
else if (value2 != null)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ollama.CreateModelStatusEnum), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Ollama.CreateModelStatusEnum> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ollama.CreateModelStatusEnum).Name}");
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(string), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<string> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(string).Name}");
_ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}

Expand All @@ -78,8 +78,8 @@ public override void Write(
}
else if (value.IsValue2)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ollama.CreateModelStatusEnum), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Ollama.CreateModelStatusEnum> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ollama.CreateModelStatusEnum).Name}");
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(string), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<string?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(string).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value2, typeInfo);
}
}
Expand Down

This file was deleted.

This file was deleted.

14 changes: 7 additions & 7 deletions src/libs/Ollama/Generated/Ollama.JsonConverters.DoneReason.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ public class DoneReasonJsonConverter : global::System.Text.Json.Serialization.Js
}

readerCopy = reader;
global::Ollama.DoneReasonEnum? value2 = default;
string? value2 = default;
try
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ollama.DoneReasonEnum), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Ollama.DoneReasonEnum> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ollama.DoneReasonEnum).Name}");
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(string), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<string> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(string).Name}");
value2 = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo);
}
catch (global::System.Text.Json.JsonException)
Expand All @@ -53,8 +53,8 @@ public class DoneReasonJsonConverter : global::System.Text.Json.Serialization.Js
}
else if (value2 != null)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ollama.DoneReasonEnum), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Ollama.DoneReasonEnum> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ollama.DoneReasonEnum).Name}");
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(string), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<string> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(string).Name}");
_ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}

Expand All @@ -78,8 +78,8 @@ public override void Write(
}
else if (value.IsValue2)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ollama.DoneReasonEnum), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Ollama.DoneReasonEnum> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ollama.DoneReasonEnum).Name}");
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(string), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<string?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(string).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value2, typeInfo);
}
}
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ public class PullModelStatusJsonConverter : global::System.Text.Json.Serializati
}

readerCopy = reader;
global::Ollama.PullModelStatusEnum? value2 = default;
string? value2 = default;
try
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ollama.PullModelStatusEnum), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Ollama.PullModelStatusEnum> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ollama.PullModelStatusEnum).Name}");
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(string), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<string> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(string).Name}");
value2 = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo);
}
catch (global::System.Text.Json.JsonException)
Expand All @@ -53,8 +53,8 @@ public class PullModelStatusJsonConverter : global::System.Text.Json.Serializati
}
else if (value2 != null)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ollama.PullModelStatusEnum), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Ollama.PullModelStatusEnum> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ollama.PullModelStatusEnum).Name}");
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(string), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<string> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(string).Name}");
_ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}

Expand All @@ -78,8 +78,8 @@ public override void Write(
}
else if (value.IsValue2)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ollama.PullModelStatusEnum), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Ollama.PullModelStatusEnum> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ollama.PullModelStatusEnum).Name}");
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(string), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<string?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(string).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value2, typeInfo);
}
}
Expand Down
Loading