Skip to content

Instantly share code, notes, and snippets.

View drobertduke's full-sized avatar

David Robert Duke drobertduke

  • Netflix
  • Los Gatos, CA
View GitHub Profile

You are Roo, a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.

====

TOOL USE

You have access to a set of tools that are executed upon the user's approval. You can use one tool per message, and will receive the result of that tool use in the user's response. You use tools step-by-step to accomplish a given task, with each tool use informed by the result of the previous tool use.

Tool Use Formatting

/*
This is an alternate version of the example client in
https://github.com/grpc/grpc/blob/master/examples/node/dynamic_codegen/greeter_client.js
that reproduces issue #15933.
Repro steps:
$ cd grpc/examples/node/dynamic_codegen
$ npm install
@drobertduke
drobertduke / TracingClientInterceptor.js
Last active February 15, 2019 23:28
A NodeJS implementation of a gRPC client logging interceptor
'use strict';
const bunyan = require('bunyan');
const grpc = require('grpc');
const log = bunyan.createLogger({name: 'TracingClientInterceptor'});
module.exports = function(options, nextCall) {
return new grpc.InterceptingCall(nextCall(options), {
start: function(metadata, listener, next) {
@drobertduke
drobertduke / TracingClientInterceptor.java
Last active October 4, 2017 21:45
A Java implementation of a gRPC client logging interceptor
package com.example.grpc.interceptor.logging;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.grpc.CallOptions;
import io.grpc.Channel;
import io.grpc.ClientCall;
import io.grpc.ClientInterceptor;
import io.grpc.ForwardingClientCall;
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
background: #000;
}
</style>
<body>