...
This commit is contained in:
@@ -14,8 +14,6 @@ message aiaRequest {
|
|||||||
string question = 1;
|
string question = 1;
|
||||||
string prompts = 2;
|
string prompts = 2;
|
||||||
string model = 3;
|
string model = 3;
|
||||||
string apitoken = 4;
|
|
||||||
string url = 5;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message aiaReply {
|
message aiaReply {
|
||||||
|
@@ -39,7 +39,7 @@ namespace Hushian.Infrastructure.Ai_Ass
|
|||||||
(new aiaRequest()
|
(new aiaRequest()
|
||||||
{ Prompts = Request.ToString(),
|
{ Prompts = Request.ToString(),
|
||||||
Question = Request.question,
|
Question = Request.question,
|
||||||
Model=model,Apitoken=_aiSettings.apitoken,Url=_aiSettings.url });
|
Model=model});
|
||||||
|
|
||||||
if (response!=null)
|
if (response!=null)
|
||||||
{
|
{
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Protobuf Include="..\..\Common\Protos\aia.proto" OutputDir="%(RelativePath)models/" />
|
<Protobuf Include="E:\_hushian\Common\Protos\aia.proto" OutputDir="%(RelativePath)models/" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\Hushian.Application\Hushian.Application.csproj" />
|
<ProjectReference Include="..\..\Hushian.Application\Hushian.Application.csproj" />
|
||||||
|
@@ -24,17 +24,16 @@ namespace AIAss.Protos {
|
|||||||
static AiaReflection() {
|
static AiaReflection() {
|
||||||
byte[] descriptorData = global::System.Convert.FromBase64String(
|
byte[] descriptorData = global::System.Convert.FromBase64String(
|
||||||
string.Concat(
|
string.Concat(
|
||||||
"CglhaWEucHJvdG8SA2FpYSJdCgphaWFSZXF1ZXN0EhAKCHF1ZXN0aW9uGAEg",
|
"CglhaWEucHJvdG8SA2FpYSI+CgphaWFSZXF1ZXN0EhAKCHF1ZXN0aW9uGAEg",
|
||||||
"ASgJEg8KB3Byb21wdHMYAiABKAkSDQoFbW9kZWwYAyABKAkSEAoIYXBpdG9r",
|
"ASgJEg8KB3Byb21wdHMYAiABKAkSDQoFbW9kZWwYAyABKAkiGwoIYWlhUmVw",
|
||||||
"ZW4YBCABKAkSCwoDdXJsGAUgASgJIhsKCGFpYVJlcGx5Eg8KB21lc3NhZ2UY",
|
"bHkSDwoHbWVzc2FnZRgBIAEoCTJuCgxhaUFzc2lzdGFuY2USLgoMU2VuZFF1",
|
||||||
"ASABKAkybgoMYWlBc3Npc3RhbmNlEi4KDFNlbmRRdWVzdGlvbhIPLmFpYS5h",
|
"ZXN0aW9uEg8uYWlhLmFpYVJlcXVlc3QaDS5haWEuYWlhUmVwbHkSLgoMaW1h",
|
||||||
"aWFSZXF1ZXN0Gg0uYWlhLmFpYVJlcGx5Ei4KDGltYWdlQW5hbGl6ZRIPLmFp",
|
"Z2VBbmFsaXplEg8uYWlhLmFpYVJlcXVlc3QaDS5haWEuYWlhUmVwbHlCD6oC",
|
||||||
"YS5haWFSZXF1ZXN0Gg0uYWlhLmFpYVJlcGx5Qg+qAgxBSUFzcy5Qcm90b3Ni",
|
"DEFJQXNzLlByb3Rvc2IGcHJvdG8z"));
|
||||||
"BnByb3RvMw=="));
|
|
||||||
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
|
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
|
||||||
new pbr::FileDescriptor[] { },
|
new pbr::FileDescriptor[] { },
|
||||||
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
|
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
|
||||||
new pbr::GeneratedClrTypeInfo(typeof(global::AIAss.Protos.aiaRequest), global::AIAss.Protos.aiaRequest.Parser, new[]{ "Question", "Prompts", "Model", "Apitoken", "Url" }, null, null, null, null),
|
new pbr::GeneratedClrTypeInfo(typeof(global::AIAss.Protos.aiaRequest), global::AIAss.Protos.aiaRequest.Parser, new[]{ "Question", "Prompts", "Model" }, null, null, null, null),
|
||||||
new pbr::GeneratedClrTypeInfo(typeof(global::AIAss.Protos.aiaReply), global::AIAss.Protos.aiaReply.Parser, new[]{ "Message" }, null, null, null, null)
|
new pbr::GeneratedClrTypeInfo(typeof(global::AIAss.Protos.aiaReply), global::AIAss.Protos.aiaReply.Parser, new[]{ "Message" }, null, null, null, null)
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
@@ -80,8 +79,6 @@ namespace AIAss.Protos {
|
|||||||
question_ = other.question_;
|
question_ = other.question_;
|
||||||
prompts_ = other.prompts_;
|
prompts_ = other.prompts_;
|
||||||
model_ = other.model_;
|
model_ = other.model_;
|
||||||
apitoken_ = other.apitoken_;
|
|
||||||
url_ = other.url_;
|
|
||||||
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
|
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -127,30 +124,6 @@ namespace AIAss.Protos {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Field number for the "apitoken" field.</summary>
|
|
||||||
public const int ApitokenFieldNumber = 4;
|
|
||||||
private string apitoken_ = "";
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
|
||||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
|
||||||
public string Apitoken {
|
|
||||||
get { return apitoken_; }
|
|
||||||
set {
|
|
||||||
apitoken_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Field number for the "url" field.</summary>
|
|
||||||
public const int UrlFieldNumber = 5;
|
|
||||||
private string url_ = "";
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
|
||||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
|
||||||
public string Url {
|
|
||||||
get { return url_; }
|
|
||||||
set {
|
|
||||||
url_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||||
public override bool Equals(object other) {
|
public override bool Equals(object other) {
|
||||||
@@ -169,8 +142,6 @@ namespace AIAss.Protos {
|
|||||||
if (Question != other.Question) return false;
|
if (Question != other.Question) return false;
|
||||||
if (Prompts != other.Prompts) return false;
|
if (Prompts != other.Prompts) return false;
|
||||||
if (Model != other.Model) return false;
|
if (Model != other.Model) return false;
|
||||||
if (Apitoken != other.Apitoken) return false;
|
|
||||||
if (Url != other.Url) return false;
|
|
||||||
return Equals(_unknownFields, other._unknownFields);
|
return Equals(_unknownFields, other._unknownFields);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,8 +152,6 @@ namespace AIAss.Protos {
|
|||||||
if (Question.Length != 0) hash ^= Question.GetHashCode();
|
if (Question.Length != 0) hash ^= Question.GetHashCode();
|
||||||
if (Prompts.Length != 0) hash ^= Prompts.GetHashCode();
|
if (Prompts.Length != 0) hash ^= Prompts.GetHashCode();
|
||||||
if (Model.Length != 0) hash ^= Model.GetHashCode();
|
if (Model.Length != 0) hash ^= Model.GetHashCode();
|
||||||
if (Apitoken.Length != 0) hash ^= Apitoken.GetHashCode();
|
|
||||||
if (Url.Length != 0) hash ^= Url.GetHashCode();
|
|
||||||
if (_unknownFields != null) {
|
if (_unknownFields != null) {
|
||||||
hash ^= _unknownFields.GetHashCode();
|
hash ^= _unknownFields.GetHashCode();
|
||||||
}
|
}
|
||||||
@@ -213,14 +182,6 @@ namespace AIAss.Protos {
|
|||||||
output.WriteRawTag(26);
|
output.WriteRawTag(26);
|
||||||
output.WriteString(Model);
|
output.WriteString(Model);
|
||||||
}
|
}
|
||||||
if (Apitoken.Length != 0) {
|
|
||||||
output.WriteRawTag(34);
|
|
||||||
output.WriteString(Apitoken);
|
|
||||||
}
|
|
||||||
if (Url.Length != 0) {
|
|
||||||
output.WriteRawTag(42);
|
|
||||||
output.WriteString(Url);
|
|
||||||
}
|
|
||||||
if (_unknownFields != null) {
|
if (_unknownFields != null) {
|
||||||
_unknownFields.WriteTo(output);
|
_unknownFields.WriteTo(output);
|
||||||
}
|
}
|
||||||
@@ -243,14 +204,6 @@ namespace AIAss.Protos {
|
|||||||
output.WriteRawTag(26);
|
output.WriteRawTag(26);
|
||||||
output.WriteString(Model);
|
output.WriteString(Model);
|
||||||
}
|
}
|
||||||
if (Apitoken.Length != 0) {
|
|
||||||
output.WriteRawTag(34);
|
|
||||||
output.WriteString(Apitoken);
|
|
||||||
}
|
|
||||||
if (Url.Length != 0) {
|
|
||||||
output.WriteRawTag(42);
|
|
||||||
output.WriteString(Url);
|
|
||||||
}
|
|
||||||
if (_unknownFields != null) {
|
if (_unknownFields != null) {
|
||||||
_unknownFields.WriteTo(ref output);
|
_unknownFields.WriteTo(ref output);
|
||||||
}
|
}
|
||||||
@@ -270,12 +223,6 @@ namespace AIAss.Protos {
|
|||||||
if (Model.Length != 0) {
|
if (Model.Length != 0) {
|
||||||
size += 1 + pb::CodedOutputStream.ComputeStringSize(Model);
|
size += 1 + pb::CodedOutputStream.ComputeStringSize(Model);
|
||||||
}
|
}
|
||||||
if (Apitoken.Length != 0) {
|
|
||||||
size += 1 + pb::CodedOutputStream.ComputeStringSize(Apitoken);
|
|
||||||
}
|
|
||||||
if (Url.Length != 0) {
|
|
||||||
size += 1 + pb::CodedOutputStream.ComputeStringSize(Url);
|
|
||||||
}
|
|
||||||
if (_unknownFields != null) {
|
if (_unknownFields != null) {
|
||||||
size += _unknownFields.CalculateSize();
|
size += _unknownFields.CalculateSize();
|
||||||
}
|
}
|
||||||
@@ -297,12 +244,6 @@ namespace AIAss.Protos {
|
|||||||
if (other.Model.Length != 0) {
|
if (other.Model.Length != 0) {
|
||||||
Model = other.Model;
|
Model = other.Model;
|
||||||
}
|
}
|
||||||
if (other.Apitoken.Length != 0) {
|
|
||||||
Apitoken = other.Apitoken;
|
|
||||||
}
|
|
||||||
if (other.Url.Length != 0) {
|
|
||||||
Url = other.Url;
|
|
||||||
}
|
|
||||||
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
|
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -330,14 +271,6 @@ namespace AIAss.Protos {
|
|||||||
Model = input.ReadString();
|
Model = input.ReadString();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 34: {
|
|
||||||
Apitoken = input.ReadString();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 42: {
|
|
||||||
Url = input.ReadString();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -365,14 +298,6 @@ namespace AIAss.Protos {
|
|||||||
Model = input.ReadString();
|
Model = input.ReadString();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 34: {
|
|
||||||
Apitoken = input.ReadString();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 42: {
|
|
||||||
Url = input.ReadString();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -371,3 +371,4 @@ Dockerfile
|
|||||||
*.suo
|
*.suo
|
||||||
*.userosscache
|
*.userosscache
|
||||||
*.sln.docstates
|
*.sln.docstates
|
||||||
|
|
||||||
|
3
Presentation/AIAss/Docker Command.txt
Normal file
3
Presentation/AIAss/Docker Command.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
docker build -t ai_assistance:v1 .
|
||||||
|
|
||||||
|
docker run --name openai_assistance -d -p 5042:5010 [IMAGEID]
|
@@ -37,3 +37,4 @@ USER appuser
|
|||||||
|
|
||||||
# Set the entry point
|
# Set the entry point
|
||||||
ENTRYPOINT ["dotnet", "AIAss.dll"]
|
ENTRYPOINT ["dotnet", "AIAss.dll"]
|
||||||
|
|
||||||
|
@@ -107,3 +107,4 @@ docker system prune -a
|
|||||||
- The container runs as a non-root user (`appuser`)
|
- The container runs as a non-root user (`appuser`)
|
||||||
- Only necessary ports are exposed
|
- Only necessary ports are exposed
|
||||||
- Environment variables can be overridden for different deployment scenarios
|
- Environment variables can be overridden for different deployment scenarios
|
||||||
|
|
||||||
|
@@ -4,19 +4,29 @@ using AIAss.Protos;
|
|||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
|
|
||||||
namespace AIAss.Services;
|
namespace AIAss.Services;
|
||||||
|
|
||||||
public class aiAssistanceService: aiAssistance.aiAssistanceBase
|
public class aiAssistanceService : aiAssistance.aiAssistanceBase
|
||||||
{
|
{
|
||||||
|
private readonly string Apitoken;
|
||||||
|
private readonly string url;
|
||||||
|
public aiAssistanceService(IConfiguration configuration)
|
||||||
|
{
|
||||||
|
url = configuration["aiSettings:url"];
|
||||||
|
Apitoken = configuration["aiSettings:apitoken"];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public async override Task<aiaReply> SendQuestion(aiaRequest request, ServerCallContext context)
|
public async override Task<aiaReply> SendQuestion(aiaRequest request, ServerCallContext context)
|
||||||
{
|
{
|
||||||
using var client = new HttpClient();
|
using var client = new HttpClient();
|
||||||
client.DefaultRequestHeaders.Authorization =
|
client.DefaultRequestHeaders.Authorization =
|
||||||
new AuthenticationHeaderValue("Bearer", request.Apitoken);
|
new AuthenticationHeaderValue("Bearer", Apitoken);
|
||||||
var content = new
|
var content = new
|
||||||
{
|
{
|
||||||
model= request.Model,
|
model = request.Model,
|
||||||
messages = new[]
|
messages = new[]
|
||||||
{
|
{
|
||||||
new { role = "system", content = "شما یک دستیار پاسخگو به سوالات هستید." },
|
new { role = "system", content = "شما یک دستیار پاسخگو به سوالات هستید." },
|
||||||
@@ -24,51 +34,7 @@ namespace AIAss.Services;
|
|||||||
new { role = "system", content = "به سوالات غیره متن بالا پاسخ نده و بگو در این زمینه اطلاعی ندارم" }
|
new { role = "system", content = "به سوالات غیره متن بالا پاسخ نده و بگو در این زمینه اطلاعی ندارم" }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var response = await client.PostAsync(request.Url,
|
var response = await client.PostAsync(url,
|
||||||
new StringContent(JsonSerializer.Serialize(content), Encoding.UTF8, "application/json"));
|
|
||||||
string reponse = "";
|
|
||||||
if (response.IsSuccessStatusCode)
|
|
||||||
{
|
|
||||||
var json = await response.Content.ReadAsStringAsync();
|
|
||||||
using var doc = JsonDocument.Parse(json);
|
|
||||||
reponse = doc.RootElement.GetProperty("choices")[0].GetProperty("message").GetProperty("content").GetString();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
reponse="خطا در ارتباط سرور ai";
|
|
||||||
}
|
|
||||||
|
|
||||||
return new aiaReply
|
|
||||||
{
|
|
||||||
Message = $" {reponse}"
|
|
||||||
};
|
|
||||||
}
|
|
||||||
public async override Task<aiaReply> imageAnalize(aiaRequest request, ServerCallContext context)
|
|
||||||
{
|
|
||||||
using var client = new HttpClient();
|
|
||||||
client.DefaultRequestHeaders.Authorization =
|
|
||||||
new AuthenticationHeaderValue("Bearer", request.Apitoken);
|
|
||||||
var content = new
|
|
||||||
{
|
|
||||||
model = request.Model,
|
|
||||||
messages = new object[]
|
|
||||||
{
|
|
||||||
new {
|
|
||||||
role = "user",
|
|
||||||
content = new object[]
|
|
||||||
{
|
|
||||||
new { type = "text", text =request.Prompts},
|
|
||||||
new {
|
|
||||||
type = "image_url",
|
|
||||||
image_url = new {
|
|
||||||
url = $"data:image/jpeg;base64,{request.Question}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
var response = await client.PostAsync(request.Url,
|
|
||||||
new StringContent(JsonSerializer.Serialize(content), Encoding.UTF8, "application/json"));
|
new StringContent(JsonSerializer.Serialize(content), Encoding.UTF8, "application/json"));
|
||||||
string reponse = "";
|
string reponse = "";
|
||||||
if (response.IsSuccessStatusCode)
|
if (response.IsSuccessStatusCode)
|
||||||
@@ -82,6 +48,65 @@ namespace AIAss.Services;
|
|||||||
reponse = "خطا در ارتباط سرور ai";
|
reponse = "خطا در ارتباط سرور ai";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return new aiaReply
|
||||||
|
{
|
||||||
|
Message = $" {reponse}"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
public async override Task<aiaReply> imageAnalize(aiaRequest request, ServerCallContext context)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
using var client = new HttpClient();
|
||||||
|
client.DefaultRequestHeaders.Authorization =
|
||||||
|
new AuthenticationHeaderValue("Bearer", Apitoken);
|
||||||
|
var content = new
|
||||||
|
{
|
||||||
|
model = request.Model,
|
||||||
|
messages = new object[]
|
||||||
|
{
|
||||||
|
new {
|
||||||
|
role = "system",
|
||||||
|
content = "شما دستیار برای توصیف آزمایشات هستید."
|
||||||
|
},
|
||||||
|
new {
|
||||||
|
role = "user",
|
||||||
|
content = new object[]
|
||||||
|
{
|
||||||
|
new { type = "text", text = "این تصویر اگر آزمایش انسان است توصیف کن در غیر اینصورت پاسخ نده" },
|
||||||
|
new {
|
||||||
|
type = "image_url",
|
||||||
|
image_url = new {
|
||||||
|
url = $"data:image/jpeg;base64,{request.Question}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var response = await client.PostAsync(url,
|
||||||
|
new StringContent(JsonSerializer.Serialize(content), Encoding.UTF8, "application/json"));
|
||||||
|
string reponse = "";
|
||||||
|
if (response.IsSuccessStatusCode)
|
||||||
|
{
|
||||||
|
var json = await response.Content.ReadAsStringAsync();
|
||||||
|
using var doc = JsonDocument.Parse(json);
|
||||||
|
reponse = doc.RootElement.GetProperty("choices")[0].GetProperty("message").GetProperty("content").GetString();
|
||||||
|
context.Status = new Status(StatusCode.OK,"is Success");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reponse = "خطا در ارتباط سرور ai";
|
||||||
|
if (response.StatusCode==System.Net.HttpStatusCode.TooManyRequests)
|
||||||
|
{
|
||||||
|
throw new RpcException(new Status(StatusCode.Cancelled, "ترافیک بالای شبکه در زمان دیگری تلاش کنید"));
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
throw new RpcException(new Status(StatusCode.Cancelled, "خطا در ارتباط سرور"));
|
||||||
|
}
|
||||||
|
|
||||||
return new aiaReply
|
return new aiaReply
|
||||||
{
|
{
|
||||||
Message = $" {reponse}"
|
Message = $" {reponse}"
|
||||||
|
@@ -10,5 +10,11 @@
|
|||||||
"EndpointDefaults": {
|
"EndpointDefaults": {
|
||||||
"Protocols": "Http2"
|
"Protocols": "Http2"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"aiSettings": {
|
||||||
|
"url": "https://api.openai.com/v1/chat/completions",
|
||||||
|
"apitokenold": "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",
|
||||||
|
"apitoken": "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"
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -24,17 +24,16 @@ namespace AIAss.Protos {
|
|||||||
static AiaReflection() {
|
static AiaReflection() {
|
||||||
byte[] descriptorData = global::System.Convert.FromBase64String(
|
byte[] descriptorData = global::System.Convert.FromBase64String(
|
||||||
string.Concat(
|
string.Concat(
|
||||||
"CglhaWEucHJvdG8SA2FpYSJdCgphaWFSZXF1ZXN0EhAKCHF1ZXN0aW9uGAEg",
|
"CglhaWEucHJvdG8SA2FpYSI+CgphaWFSZXF1ZXN0EhAKCHF1ZXN0aW9uGAEg",
|
||||||
"ASgJEg8KB3Byb21wdHMYAiABKAkSDQoFbW9kZWwYAyABKAkSEAoIYXBpdG9r",
|
"ASgJEg8KB3Byb21wdHMYAiABKAkSDQoFbW9kZWwYAyABKAkiGwoIYWlhUmVw",
|
||||||
"ZW4YBCABKAkSCwoDdXJsGAUgASgJIhsKCGFpYVJlcGx5Eg8KB21lc3NhZ2UY",
|
"bHkSDwoHbWVzc2FnZRgBIAEoCTJuCgxhaUFzc2lzdGFuY2USLgoMU2VuZFF1",
|
||||||
"ASABKAkybgoMYWlBc3Npc3RhbmNlEi4KDFNlbmRRdWVzdGlvbhIPLmFpYS5h",
|
"ZXN0aW9uEg8uYWlhLmFpYVJlcXVlc3QaDS5haWEuYWlhUmVwbHkSLgoMaW1h",
|
||||||
"aWFSZXF1ZXN0Gg0uYWlhLmFpYVJlcGx5Ei4KDGltYWdlQW5hbGl6ZRIPLmFp",
|
"Z2VBbmFsaXplEg8uYWlhLmFpYVJlcXVlc3QaDS5haWEuYWlhUmVwbHlCD6oC",
|
||||||
"YS5haWFSZXF1ZXN0Gg0uYWlhLmFpYVJlcGx5Qg+qAgxBSUFzcy5Qcm90b3Ni",
|
"DEFJQXNzLlByb3Rvc2IGcHJvdG8z"));
|
||||||
"BnByb3RvMw=="));
|
|
||||||
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
|
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
|
||||||
new pbr::FileDescriptor[] { },
|
new pbr::FileDescriptor[] { },
|
||||||
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
|
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
|
||||||
new pbr::GeneratedClrTypeInfo(typeof(global::AIAss.Protos.aiaRequest), global::AIAss.Protos.aiaRequest.Parser, new[]{ "Question", "Prompts", "Model", "Apitoken", "Url" }, null, null, null, null),
|
new pbr::GeneratedClrTypeInfo(typeof(global::AIAss.Protos.aiaRequest), global::AIAss.Protos.aiaRequest.Parser, new[]{ "Question", "Prompts", "Model" }, null, null, null, null),
|
||||||
new pbr::GeneratedClrTypeInfo(typeof(global::AIAss.Protos.aiaReply), global::AIAss.Protos.aiaReply.Parser, new[]{ "Message" }, null, null, null, null)
|
new pbr::GeneratedClrTypeInfo(typeof(global::AIAss.Protos.aiaReply), global::AIAss.Protos.aiaReply.Parser, new[]{ "Message" }, null, null, null, null)
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
@@ -80,8 +79,6 @@ namespace AIAss.Protos {
|
|||||||
question_ = other.question_;
|
question_ = other.question_;
|
||||||
prompts_ = other.prompts_;
|
prompts_ = other.prompts_;
|
||||||
model_ = other.model_;
|
model_ = other.model_;
|
||||||
apitoken_ = other.apitoken_;
|
|
||||||
url_ = other.url_;
|
|
||||||
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
|
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -127,30 +124,6 @@ namespace AIAss.Protos {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Field number for the "apitoken" field.</summary>
|
|
||||||
public const int ApitokenFieldNumber = 4;
|
|
||||||
private string apitoken_ = "";
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
|
||||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
|
||||||
public string Apitoken {
|
|
||||||
get { return apitoken_; }
|
|
||||||
set {
|
|
||||||
apitoken_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Field number for the "url" field.</summary>
|
|
||||||
public const int UrlFieldNumber = 5;
|
|
||||||
private string url_ = "";
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
|
||||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
|
||||||
public string Url {
|
|
||||||
get { return url_; }
|
|
||||||
set {
|
|
||||||
url_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||||
public override bool Equals(object other) {
|
public override bool Equals(object other) {
|
||||||
@@ -169,8 +142,6 @@ namespace AIAss.Protos {
|
|||||||
if (Question != other.Question) return false;
|
if (Question != other.Question) return false;
|
||||||
if (Prompts != other.Prompts) return false;
|
if (Prompts != other.Prompts) return false;
|
||||||
if (Model != other.Model) return false;
|
if (Model != other.Model) return false;
|
||||||
if (Apitoken != other.Apitoken) return false;
|
|
||||||
if (Url != other.Url) return false;
|
|
||||||
return Equals(_unknownFields, other._unknownFields);
|
return Equals(_unknownFields, other._unknownFields);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,8 +152,6 @@ namespace AIAss.Protos {
|
|||||||
if (Question.Length != 0) hash ^= Question.GetHashCode();
|
if (Question.Length != 0) hash ^= Question.GetHashCode();
|
||||||
if (Prompts.Length != 0) hash ^= Prompts.GetHashCode();
|
if (Prompts.Length != 0) hash ^= Prompts.GetHashCode();
|
||||||
if (Model.Length != 0) hash ^= Model.GetHashCode();
|
if (Model.Length != 0) hash ^= Model.GetHashCode();
|
||||||
if (Apitoken.Length != 0) hash ^= Apitoken.GetHashCode();
|
|
||||||
if (Url.Length != 0) hash ^= Url.GetHashCode();
|
|
||||||
if (_unknownFields != null) {
|
if (_unknownFields != null) {
|
||||||
hash ^= _unknownFields.GetHashCode();
|
hash ^= _unknownFields.GetHashCode();
|
||||||
}
|
}
|
||||||
@@ -213,14 +182,6 @@ namespace AIAss.Protos {
|
|||||||
output.WriteRawTag(26);
|
output.WriteRawTag(26);
|
||||||
output.WriteString(Model);
|
output.WriteString(Model);
|
||||||
}
|
}
|
||||||
if (Apitoken.Length != 0) {
|
|
||||||
output.WriteRawTag(34);
|
|
||||||
output.WriteString(Apitoken);
|
|
||||||
}
|
|
||||||
if (Url.Length != 0) {
|
|
||||||
output.WriteRawTag(42);
|
|
||||||
output.WriteString(Url);
|
|
||||||
}
|
|
||||||
if (_unknownFields != null) {
|
if (_unknownFields != null) {
|
||||||
_unknownFields.WriteTo(output);
|
_unknownFields.WriteTo(output);
|
||||||
}
|
}
|
||||||
@@ -243,14 +204,6 @@ namespace AIAss.Protos {
|
|||||||
output.WriteRawTag(26);
|
output.WriteRawTag(26);
|
||||||
output.WriteString(Model);
|
output.WriteString(Model);
|
||||||
}
|
}
|
||||||
if (Apitoken.Length != 0) {
|
|
||||||
output.WriteRawTag(34);
|
|
||||||
output.WriteString(Apitoken);
|
|
||||||
}
|
|
||||||
if (Url.Length != 0) {
|
|
||||||
output.WriteRawTag(42);
|
|
||||||
output.WriteString(Url);
|
|
||||||
}
|
|
||||||
if (_unknownFields != null) {
|
if (_unknownFields != null) {
|
||||||
_unknownFields.WriteTo(ref output);
|
_unknownFields.WriteTo(ref output);
|
||||||
}
|
}
|
||||||
@@ -270,12 +223,6 @@ namespace AIAss.Protos {
|
|||||||
if (Model.Length != 0) {
|
if (Model.Length != 0) {
|
||||||
size += 1 + pb::CodedOutputStream.ComputeStringSize(Model);
|
size += 1 + pb::CodedOutputStream.ComputeStringSize(Model);
|
||||||
}
|
}
|
||||||
if (Apitoken.Length != 0) {
|
|
||||||
size += 1 + pb::CodedOutputStream.ComputeStringSize(Apitoken);
|
|
||||||
}
|
|
||||||
if (Url.Length != 0) {
|
|
||||||
size += 1 + pb::CodedOutputStream.ComputeStringSize(Url);
|
|
||||||
}
|
|
||||||
if (_unknownFields != null) {
|
if (_unknownFields != null) {
|
||||||
size += _unknownFields.CalculateSize();
|
size += _unknownFields.CalculateSize();
|
||||||
}
|
}
|
||||||
@@ -297,12 +244,6 @@ namespace AIAss.Protos {
|
|||||||
if (other.Model.Length != 0) {
|
if (other.Model.Length != 0) {
|
||||||
Model = other.Model;
|
Model = other.Model;
|
||||||
}
|
}
|
||||||
if (other.Apitoken.Length != 0) {
|
|
||||||
Apitoken = other.Apitoken;
|
|
||||||
}
|
|
||||||
if (other.Url.Length != 0) {
|
|
||||||
Url = other.Url;
|
|
||||||
}
|
|
||||||
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
|
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -330,14 +271,6 @@ namespace AIAss.Protos {
|
|||||||
Model = input.ReadString();
|
Model = input.ReadString();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 34: {
|
|
||||||
Apitoken = input.ReadString();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 42: {
|
|
||||||
Url = input.ReadString();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -365,14 +298,6 @@ namespace AIAss.Protos {
|
|||||||
Model = input.ReadString();
|
Model = input.ReadString();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 34: {
|
|
||||||
Apitoken = input.ReadString();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 42: {
|
|
||||||
Url = input.ReadString();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user