# MarketMinds Protofiles
In this folder the protobuf files are defined to act as interface between the polyglot services.

## Marketminds AI Services (Server)
```bash
python3 -m grpc_tools.protoc -I. --python_out=../ai-services/protobuf --pyi_out=../ai-services/protobuf --grpc_python_out=../ai-services/protobuf named-entity-recognition.proto

python3 -m grpc_tools.protoc -I. --python_out=../ai-services/protobuf --pyi_out=../ai-services/protobuf --grpc_python_out=../ai-services/protobuf sentiment-analysis.proto
```

## Marketminds backend (client)

```bash
protoc --go_out=../backend/pkg/protobuf --go_opt=paths=source_relative \
    --go-grpc_out=../backend/pkg/protobuf --go-grpc_opt=paths=source_relative \
    named-entity-recognition.proto

protoc --go_out=../backend/pkg/protobuf --go_opt=paths=source_relative \
    --go-grpc_out=../backend/pkg/protobuf --go-grpc_opt=paths=source_relative \
    sentiment-analysis.proto
```

### Install required go modules
```bash
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2
```