LexiEnglishBot / Lexi

MIT License
1 stars 0 forks source link

GRPC endpoint for DataAIService #89

Closed MohammadYSF closed 2 weeks ago

MohammadYSF commented 2 weeks ago

we need to expose an GRPC endpoint for DataAI service . It is one of the ways that other microservice can communicate with DataAI service .

MohammadYSF commented 2 weeks ago
syntax = "proto3";

service AiPromptService {

  rpc Ask (AiPromptRequest) returns (AiPromptResponse) {};
  rpc AskStream(AiPromptRequest) returns (stream AiPromptResponse){};
}

message AiPromptRequest {
  string prompt = 1;
  string system_message=2;
  string response_format=3;
  string model=4 ;
}

message AiPromptResponse {
  string answer = 1;
}

repsonse_format possible values : text,json model possbible values : distil-whisper-large-v3-en, gemma2-9b-it, gemma-7b-it, llama3-groq-70b-8192-tool-use-preview, llama3-groq-8b-8192-tool-use-preview, llama-3.1-70b-versatile, llama-3.1-8b-instant, llama-guard-3-8b, llama3-70b-8192, llama3-8b-8192, mixtral-8x7b-32768, whisper-large-v3

remember to change this generated file : aiPrompt_pb2_grpc.py you have to change import aiPrompt_pb2 as aiPrompt__pb2 to import app.aiPrompt_pb2 as aiPrompt__pb2(for now because of folderBandi) @MatinGhanbari