add all requirements for implementing XAiMcpClient ...
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace xAiModels.Models
|
||||
{
|
||||
public class XAiMcpJsonRpcError
|
||||
{
|
||||
[JsonPropertyName("code")]
|
||||
public int Code { get; set; }
|
||||
|
||||
[JsonPropertyName("message")]
|
||||
public string Message { get; set; }
|
||||
|
||||
[JsonPropertyName("data")]
|
||||
public JsonElement? Data { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace xAiModels.Models
|
||||
{
|
||||
public class XAiMcpJsonRpcRequest
|
||||
{
|
||||
[JsonPropertyName("jsonrpc")]
|
||||
public string JsonRpc { get; set; } = "2.0";
|
||||
|
||||
[JsonPropertyName("id")]
|
||||
public string Id { get; set; } = Guid.NewGuid().ToString("N");
|
||||
|
||||
[JsonPropertyName("method")]
|
||||
public string Method { get; set; }
|
||||
|
||||
[JsonPropertyName("params")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public object Params { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace xAiModels.Models
|
||||
{
|
||||
public class XAiMcpJsonRpcResponse
|
||||
{
|
||||
[JsonPropertyName("jsonrpc")]
|
||||
public string JsonRpc { get; set; }
|
||||
|
||||
[JsonPropertyName("id")]
|
||||
public string Id { get; set; }
|
||||
|
||||
[JsonPropertyName("result")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public JsonElement? Result { get; set; }
|
||||
|
||||
[JsonPropertyName("error")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public XAiMcpJsonRpcError Error { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool IsSuccess => Error is null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace xAiModels.Models
|
||||
{
|
||||
public class XAiMcpToolDefinition
|
||||
{
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonPropertyName("description")]
|
||||
public string Description { get; set; }
|
||||
|
||||
[JsonPropertyName("inputSchema")]
|
||||
public JsonElement InputSchema { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user