Adding Requirements for AiMcpServer Definition and Usage ...
This commit is contained in:
@@ -0,0 +1,28 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace xAiModels.Attributes
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Decorate and Describe Specified MCP Tool to LLM ...
|
||||||
|
/// </summary>
|
||||||
|
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
|
||||||
|
public class XAiMcpToolAttribute : Attribute
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Tools Unique Name (Default: Method Name) ...
|
||||||
|
/// </summary>
|
||||||
|
/// <value></value>
|
||||||
|
public string Name { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Tools Description for LLM ...
|
||||||
|
/// </summary>
|
||||||
|
/// <value></value>
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
public XAiMcpToolAttribute(string name = null)
|
||||||
|
{
|
||||||
|
Name = name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace xAiModels.Attributes
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Describe Specific Tools Parameter Metadata ...
|
||||||
|
/// </summary>
|
||||||
|
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
|
||||||
|
public sealed class XAiMcpToolParamAttribute : Attribute
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Parameter Name in JSON (Default Parameter Name) ...
|
||||||
|
/// </summary>
|
||||||
|
/// <value></value>
|
||||||
|
public string Name { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Describe Parameter to LLM ...
|
||||||
|
/// </summary>
|
||||||
|
/// <value></value>
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Specified this Parameter is Required or not (Default is true) ...
|
||||||
|
/// </summary>
|
||||||
|
/// <value></value>
|
||||||
|
public bool Required { get; set; } = true;
|
||||||
|
|
||||||
|
public XAiMcpToolParamAttribute(string name = null)
|
||||||
|
{
|
||||||
|
Name = name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace xAiModels.Attributes
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Decorate Tools Classes ...
|
||||||
|
/// </summary>
|
||||||
|
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
|
||||||
|
public class XAiMcpToolTypeAttribute : Attribute { }
|
||||||
|
}
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Linq;
|
|
||||||
using xCommons.Providers;
|
|
||||||
using xAiModels.Models.Dtos;
|
|
||||||
using xDataService.Interfaces;
|
|
||||||
using xCommons.Configurations;
|
|
||||||
using xDataService.Controllers;
|
|
||||||
using xAiModels.Models.Entities;
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using Microsoft.EntityFrameworkCore.Query;
|
|
||||||
|
|
||||||
namespace xAiModels.Controllers
|
|
||||||
{
|
|
||||||
public abstract class XAiMcpServerControllerBase : XBaseServiceController<XAiMcpServer, XAiMcpServerDto, Guid>
|
|
||||||
{
|
|
||||||
protected XAiMcpServerControllerBase(
|
|
||||||
ILogger<XAiMcpServerControllerBase> logger,
|
|
||||||
XAppConfiguration appConfiguration,
|
|
||||||
XValidationProvider validationProvider,
|
|
||||||
IXBaseRepositoryService<XAiMcpServer, XAiMcpServerDto, Guid> repositoryService,
|
|
||||||
Func<IQueryable<XAiMcpServer>, IOrderedQueryable<XAiMcpServer>> defaultOrderBuilder = null,
|
|
||||||
Func<IQueryable<XAiMcpServer>, IIncludableQueryable<XAiMcpServer, object>> defaultIncludeBuilder = null
|
|
||||||
) : base(
|
|
||||||
logger,
|
|
||||||
appConfiguration,
|
|
||||||
validationProvider,
|
|
||||||
repositoryService,
|
|
||||||
defaultOrderBuilder,
|
|
||||||
defaultIncludeBuilder
|
|
||||||
)
|
|
||||||
{ }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user