Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ public class ComputerActionJsonConverter : global::System.Text.Json.Serializatio
throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::tryAGI.OpenAI.ScrollParam)}");
scroll = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
global::tryAGI.OpenAI.TypeParam? type = default;
global::tryAGI.OpenAI.TypeParam? typeValue = default;
if (discriminator?.Type == global::tryAGI.OpenAI.ComputerActionDiscriminatorType.Type)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::tryAGI.OpenAI.TypeParam), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::tryAGI.OpenAI.TypeParam> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::tryAGI.OpenAI.TypeParam)}");
type = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
typeValue = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
global::tryAGI.OpenAI.WaitParam? wait = default;
if (discriminator?.Type == global::tryAGI.OpenAI.ComputerActionDiscriminatorType.Wait)
Expand All @@ -101,7 +101,7 @@ public class ComputerActionJsonConverter : global::System.Text.Json.Serializatio

scroll,

type,
typeValue,

wait
);
Expand Down Expand Up @@ -160,11 +160,11 @@ public override void Write(
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::tryAGI.OpenAI.ScrollParam).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.Scroll!, typeInfo);
}
else if (value.IsType)
else if (value.IsTypeValue)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::tryAGI.OpenAI.TypeParam), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::tryAGI.OpenAI.TypeParam?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::tryAGI.OpenAI.TypeParam).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.Type!, typeInfo);
global::System.Text.Json.JsonSerializer.Serialize(writer, value.TypeValue!, typeInfo);
}
else if (value.IsWait)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,38 +277,38 @@ public bool TryPickScroll(
/// An action to type in text.
/// </summary>
#if NET6_0_OR_GREATER
public global::tryAGI.OpenAI.TypeParam? Type { get; init; }
public global::tryAGI.OpenAI.TypeParam? TypeValue { get; init; }
#else
public global::tryAGI.OpenAI.TypeParam? Type { get; }
public global::tryAGI.OpenAI.TypeParam? TypeValue { get; }
#endif

/// <summary>
///
/// </summary>
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Type))]
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(TypeValue))]
#endif
public bool IsType => Type != null;
public bool IsTypeValue => TypeValue != null;

/// <summary>
///
/// </summary>
public bool TryPickType(
public bool TryPickTypeValue(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out global::tryAGI.OpenAI.TypeParam? value)
{
value = Type;
return IsType;
value = TypeValue;
return IsTypeValue;
}

/// <summary>
///
/// </summary>
public global::tryAGI.OpenAI.TypeParam PickType() => IsType
? Type!
: throw new global::System.InvalidOperationException($"Expected union variant 'Type' but the value was {ToString()}.");
public global::tryAGI.OpenAI.TypeParam PickTypeValue() => IsTypeValue
? TypeValue!
: throw new global::System.InvalidOperationException($"Expected union variant 'TypeValue' but the value was {ToString()}.");

/// <summary>
/// A wait action.
Expand Down Expand Up @@ -515,20 +515,20 @@ public ComputerAction(global::tryAGI.OpenAI.ScrollParam? value)
/// <summary>
///
/// </summary>
public static implicit operator global::tryAGI.OpenAI.TypeParam?(ComputerAction @this) => @this.Type;
public static implicit operator global::tryAGI.OpenAI.TypeParam?(ComputerAction @this) => @this.TypeValue;

/// <summary>
///
/// </summary>
public ComputerAction(global::tryAGI.OpenAI.TypeParam? value)
{
Type = value;
TypeValue = value;
}

/// <summary>
///
/// </summary>
public static ComputerAction FromType(global::tryAGI.OpenAI.TypeParam? value) => new ComputerAction(value);
public static ComputerAction FromTypeValue(global::tryAGI.OpenAI.TypeParam? value) => new ComputerAction(value);

/// <summary>
///
Expand Down Expand Up @@ -565,7 +565,7 @@ public ComputerAction(
global::tryAGI.OpenAI.MoveParam? move,
global::tryAGI.OpenAI.ScreenshotParam? screenshot,
global::tryAGI.OpenAI.ScrollParam? scroll,
global::tryAGI.OpenAI.TypeParam? type,
global::tryAGI.OpenAI.TypeParam? typeValue,
global::tryAGI.OpenAI.WaitParam? wait
)
{
Expand All @@ -578,7 +578,7 @@ public ComputerAction(
Move = move;
Screenshot = screenshot;
Scroll = scroll;
Type = type;
TypeValue = typeValue;
Wait = wait;
}

Expand All @@ -587,7 +587,7 @@ public ComputerAction(
/// </summary>
public object? Object =>
Wait as object ??
Type as object ??
TypeValue as object ??
Scroll as object ??
Screenshot as object ??
Move as object ??
Expand All @@ -608,7 +608,7 @@ Click as object
Move?.ToString() ??
Screenshot?.ToString() ??
Scroll?.ToString() ??
Type?.ToString() ??
TypeValue?.ToString() ??
Wait?.ToString()
;

Expand All @@ -617,7 +617,7 @@ Click as object
/// </summary>
public bool Validate()
{
return IsClick && !IsDoubleClick && !IsDrag && !IsKeypress && !IsMove && !IsScreenshot && !IsScroll && !IsType && !IsWait || !IsClick && IsDoubleClick && !IsDrag && !IsKeypress && !IsMove && !IsScreenshot && !IsScroll && !IsType && !IsWait || !IsClick && !IsDoubleClick && IsDrag && !IsKeypress && !IsMove && !IsScreenshot && !IsScroll && !IsType && !IsWait || !IsClick && !IsDoubleClick && !IsDrag && IsKeypress && !IsMove && !IsScreenshot && !IsScroll && !IsType && !IsWait || !IsClick && !IsDoubleClick && !IsDrag && !IsKeypress && IsMove && !IsScreenshot && !IsScroll && !IsType && !IsWait || !IsClick && !IsDoubleClick && !IsDrag && !IsKeypress && !IsMove && IsScreenshot && !IsScroll && !IsType && !IsWait || !IsClick && !IsDoubleClick && !IsDrag && !IsKeypress && !IsMove && !IsScreenshot && IsScroll && !IsType && !IsWait || !IsClick && !IsDoubleClick && !IsDrag && !IsKeypress && !IsMove && !IsScreenshot && !IsScroll && IsType && !IsWait || !IsClick && !IsDoubleClick && !IsDrag && !IsKeypress && !IsMove && !IsScreenshot && !IsScroll && !IsType && IsWait;
return IsClick && !IsDoubleClick && !IsDrag && !IsKeypress && !IsMove && !IsScreenshot && !IsScroll && !IsTypeValue && !IsWait || !IsClick && IsDoubleClick && !IsDrag && !IsKeypress && !IsMove && !IsScreenshot && !IsScroll && !IsTypeValue && !IsWait || !IsClick && !IsDoubleClick && IsDrag && !IsKeypress && !IsMove && !IsScreenshot && !IsScroll && !IsTypeValue && !IsWait || !IsClick && !IsDoubleClick && !IsDrag && IsKeypress && !IsMove && !IsScreenshot && !IsScroll && !IsTypeValue && !IsWait || !IsClick && !IsDoubleClick && !IsDrag && !IsKeypress && IsMove && !IsScreenshot && !IsScroll && !IsTypeValue && !IsWait || !IsClick && !IsDoubleClick && !IsDrag && !IsKeypress && !IsMove && IsScreenshot && !IsScroll && !IsTypeValue && !IsWait || !IsClick && !IsDoubleClick && !IsDrag && !IsKeypress && !IsMove && !IsScreenshot && IsScroll && !IsTypeValue && !IsWait || !IsClick && !IsDoubleClick && !IsDrag && !IsKeypress && !IsMove && !IsScreenshot && !IsScroll && IsTypeValue && !IsWait || !IsClick && !IsDoubleClick && !IsDrag && !IsKeypress && !IsMove && !IsScreenshot && !IsScroll && !IsTypeValue && IsWait;
}

/// <summary>
Expand All @@ -631,7 +631,7 @@ public bool Validate()
global::System.Func<global::tryAGI.OpenAI.MoveParam, TResult>? move = null,
global::System.Func<global::tryAGI.OpenAI.ScreenshotParam, TResult>? screenshot = null,
global::System.Func<global::tryAGI.OpenAI.ScrollParam, TResult>? scroll = null,
global::System.Func<global::tryAGI.OpenAI.TypeParam, TResult>? type = null,
global::System.Func<global::tryAGI.OpenAI.TypeParam, TResult>? typeValue = null,
global::System.Func<global::tryAGI.OpenAI.WaitParam, TResult>? wait = null,
bool validate = true)
{
Expand Down Expand Up @@ -668,9 +668,9 @@ public bool Validate()
{
return scroll(Scroll!);
}
else if (IsType && type != null)
else if (IsTypeValue && typeValue != null)
{
return type(Type!);
return typeValue(TypeValue!);
}
else if (IsWait && wait != null)
{
Expand Down Expand Up @@ -698,7 +698,7 @@ public void Match(

global::System.Action<global::tryAGI.OpenAI.ScrollParam>? scroll = null,

global::System.Action<global::tryAGI.OpenAI.TypeParam>? type = null,
global::System.Action<global::tryAGI.OpenAI.TypeParam>? typeValue = null,

global::System.Action<global::tryAGI.OpenAI.WaitParam>? wait = null,
bool validate = true)
Expand Down Expand Up @@ -736,9 +736,9 @@ public void Match(
{
scroll?.Invoke(Scroll!);
}
else if (IsType)
else if (IsTypeValue)
{
type?.Invoke(Type!);
typeValue?.Invoke(TypeValue!);
}
else if (IsWait)
{
Expand All @@ -757,7 +757,7 @@ public void Switch(
global::System.Action<global::tryAGI.OpenAI.MoveParam>? move = null,
global::System.Action<global::tryAGI.OpenAI.ScreenshotParam>? screenshot = null,
global::System.Action<global::tryAGI.OpenAI.ScrollParam>? scroll = null,
global::System.Action<global::tryAGI.OpenAI.TypeParam>? type = null,
global::System.Action<global::tryAGI.OpenAI.TypeParam>? typeValue = null,
global::System.Action<global::tryAGI.OpenAI.WaitParam>? wait = null,
bool validate = true)
{
Expand Down Expand Up @@ -794,9 +794,9 @@ public void Switch(
{
scroll?.Invoke(Scroll!);
}
else if (IsType)
else if (IsTypeValue)
{
type?.Invoke(Type!);
typeValue?.Invoke(TypeValue!);
}
else if (IsWait)
{
Expand Down Expand Up @@ -825,7 +825,7 @@ public override int GetHashCode()
typeof(global::tryAGI.OpenAI.ScreenshotParam),
Scroll,
typeof(global::tryAGI.OpenAI.ScrollParam),
Type,
TypeValue,
typeof(global::tryAGI.OpenAI.TypeParam),
Wait,
typeof(global::tryAGI.OpenAI.WaitParam),
Expand All @@ -852,7 +852,7 @@ public bool Equals(ComputerAction other)
global::System.Collections.Generic.EqualityComparer<global::tryAGI.OpenAI.MoveParam?>.Default.Equals(Move, other.Move) &&
global::System.Collections.Generic.EqualityComparer<global::tryAGI.OpenAI.ScreenshotParam?>.Default.Equals(Screenshot, other.Screenshot) &&
global::System.Collections.Generic.EqualityComparer<global::tryAGI.OpenAI.ScrollParam?>.Default.Equals(Scroll, other.Scroll) &&
global::System.Collections.Generic.EqualityComparer<global::tryAGI.OpenAI.TypeParam?>.Default.Equals(Type, other.Type) &&
global::System.Collections.Generic.EqualityComparer<global::tryAGI.OpenAI.TypeParam?>.Default.Equals(TypeValue, other.TypeValue) &&
global::System.Collections.Generic.EqualityComparer<global::tryAGI.OpenAI.WaitParam?>.Default.Equals(Wait, other.Wait)
;
}
Expand Down
Loading