Skip to content

About

grpc-assistant is a demo code to explore how to handle grpc requests, and forward it to OpenAI API

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

grpc-assistant

grpc-assistant is a demo code to explore how to handle grpc requests, and forward it to OpenAI API

Running

export OPENAI_API_KEY="sk-00000"
export OPENAI_MODEL_NAME="gpt-3.5-turbo"
go run main.go

How to make questions

Install grpcurl

❯ grpcurl -d '{"request": "Who has more Football World Cups?"}' -plaintext -proto assistant.proto 0.0.0.0:8080 Assistant.Handle
{
  "result": "The country with the most Football World Cups is Brazil, with a total of 5 championships (1958, 1962, 1970, 1994, and 2002)."
}

Updating proto files

protoc \
--go_out=pkg/assistant \
--go_opt=paths=source_relative \
--go-grpc_out=pkg/assistant \
--go-grpc_opt=paths=source_relative \
assistant.proto

About

grpc-assistant is a demo code to explore how to handle grpc requests, and forward it to OpenAI API

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Used by

Contributors

Languages