-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add gRPC API and shell command #93
Conversation
How would you feel about renaming |
👍 very much like the direction this is going. I've got a good amount of experience with GRPC services in Go, Python, TS/JS. Curious to try out Buf to simply some of the Grpc/Protobuf integration woes. Filed this PR with the example I ran locally: #94 |
@sourishkrout it's ready for testing. I tried to document how to do it in the PR description but if something is unclear let me know. It's still very early, especially if one has a rich multiline prompt, then detecting it might not work. For that issue, I consider another approach which is setting prompt ahead of time. |
Played through the examples. Works well. I did see it continuously streaming when I ran |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Read over the code and this looks like a good baseline to me 👍.
This change adds a new command
server
which starts a gRPC server with two services:Install buf and grpcurl first. Both can be found in brew.
The first allows creating kernels - long running processes which you can interact with using the service.
The second allows to serialize and deserialize Markdown content.
Run
Remember to rebuild
runme
usingmake
and then execute:Deserialize
It should result in:
Kernel
First, a session needs to be created:
The output will contain a session ID:
Next, you can execute commands in that session:
And you should see a stream of outputs (they are base64-encoded so you need to use something like
echo -n $data | base64 -D
):The last message is identified by presence of
exitCode
.Protobuf files and code generation
This change contains generated code for Protobuf files in Go and TypeScript. For TypeScript, check out Protobuf-ES which is used to generate TS code. However, please wait for confirmation how to consume proto files and generated stubs as we will likely try to use Buf Schema Registry.