...
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Protobuf Include="Protos\greet.proto" GrpcServices="Server" />
|
||||
<Protobuf Include="Protos\aia.proto" GrpcServices="Server" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
19
Presentation/AIAss/Protos/aia.proto
Normal file
19
Presentation/AIAss/Protos/aia.proto
Normal file
@@ -0,0 +1,19 @@
|
||||
syntax = "proto3";
|
||||
|
||||
option csharp_namespace = "AIAss.Protos";
|
||||
|
||||
package aia;
|
||||
|
||||
|
||||
service aiAssistance {
|
||||
rpc SendQuestion (aiaRequest) returns (aiaReply);
|
||||
}
|
||||
|
||||
message aiaRequest {
|
||||
string question = 1;
|
||||
string prompts = 2;
|
||||
}
|
||||
|
||||
message aiaReply {
|
||||
string message = 1;
|
||||
}
|
@@ -1,21 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
option csharp_namespace = "AIAss";
|
||||
|
||||
package greet;
|
||||
|
||||
// The greeting service definition.
|
||||
service Greeter {
|
||||
// Sends a greeting
|
||||
rpc SayHello (HelloRequest) returns (HelloReply);
|
||||
}
|
||||
|
||||
// The request message containing the user's name.
|
||||
message HelloRequest {
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
// The response message containing the greetings.
|
||||
message HelloReply {
|
||||
string message = 1;
|
||||
}
|
@@ -1,21 +0,0 @@
|
||||
using Grpc.Core;
|
||||
using AIAss;
|
||||
|
||||
namespace AIAss.Services;
|
||||
|
||||
public class GreeterService : Greeter.GreeterBase
|
||||
{
|
||||
private readonly ILogger<GreeterService> _logger;
|
||||
public GreeterService(ILogger<GreeterService> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public override Task<HelloReply> SayHello(HelloRequest request, ServerCallContext context)
|
||||
{
|
||||
return Task.FromResult(new HelloReply
|
||||
{
|
||||
Message = "Hello " + request.Name
|
||||
});
|
||||
}
|
||||
}
|
19
Presentation/AIAss/Services/aiAssistanceService.cs
Normal file
19
Presentation/AIAss/Services/aiAssistanceService.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using Grpc.Core;
|
||||
using AIAss;
|
||||
using AIAss.Protos;
|
||||
|
||||
namespace AIAss.Services;
|
||||
|
||||
public class aiAssistanceService: aiAssistance.aiAssistanceBase
|
||||
{
|
||||
public override Task<aiaReply> SendQuestion(aiaRequest request, ServerCallContext context)
|
||||
{
|
||||
var reply = new aiaReply
|
||||
{
|
||||
Message = $" {request.Question}"
|
||||
};
|
||||
|
||||
return Task.FromResult(reply);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user