| | | 1 | | // Copyright (c) NexusLabs. All rights reserved. |
| | | 2 | | // Licensed under the MIT License. |
| | | 3 | | |
| | | 4 | | using System.Collections.Generic; |
| | | 5 | | |
| | | 6 | | namespace NexusLabs.Needlr.AgentFramework.Generators; |
| | | 7 | | |
| | | 8 | | internal readonly struct AgentFunctionParameterInfo |
| | | 9 | | { |
| | | 10 | | public AgentFunctionParameterInfo( |
| | | 11 | | string name, string typeFullName, |
| | | 12 | | string jsonSchemaType, string? itemJsonSchemaType, |
| | | 13 | | string? itemObjectSchemaJson, |
| | | 14 | | IReadOnlyList<ObjectPropertyInfo>? itemObjectProperties, |
| | | 15 | | bool isCancellationToken, bool isNullable, bool hasDefault, string? description) |
| | | 16 | | { |
| | 34 | 17 | | Name = name; TypeFullName = typeFullName; |
| | 34 | 18 | | JsonSchemaType = jsonSchemaType; ItemJsonSchemaType = itemJsonSchemaType; |
| | 17 | 19 | | ItemObjectSchemaJson = itemObjectSchemaJson; |
| | 17 | 20 | | ItemObjectProperties = itemObjectProperties; |
| | 34 | 21 | | IsCancellationToken = isCancellationToken; IsNullable = isNullable; |
| | 34 | 22 | | HasDefault = hasDefault; Description = description; |
| | 17 | 23 | | } |
| | | 24 | | |
| | 136 | 25 | | public string Name { get; } |
| | 17 | 26 | | public string TypeFullName { get; } |
| | 72 | 27 | | public string JsonSchemaType { get; } |
| | | 28 | | /// <summary>JSON schema type for array items (e.g., "string", "integer", "object").</summary> |
| | 11 | 29 | | public string? ItemJsonSchemaType { get; } |
| | | 30 | | /// <summary>Pre-built JSON schema for complex object array items (properties, required fields).</summary> |
| | 6 | 31 | | public string? ItemObjectSchemaJson { get; } |
| | | 32 | | /// <summary>Property extraction info for AOT-safe manual deserialization of complex array items.</summary> |
| | 6 | 33 | | public IReadOnlyList<ObjectPropertyInfo>? ItemObjectProperties { get; } |
| | 67 | 34 | | public bool IsCancellationToken { get; } |
| | 16 | 35 | | public bool IsNullable { get; } |
| | 16 | 36 | | public bool HasDefault { get; } |
| | 21 | 37 | | public string? Description { get; } |
| | 16 | 38 | | public bool IsRequired => !IsCancellationToken && !IsNullable && !HasDefault; |
| | | 39 | | } |