aperture icon indicating copy to clipboard operation
aperture copied to clipboard

pricesrpc: add additional request context to GetPriceRequest

Open Roasbeef opened this issue 2 years ago • 1 comments

Right now we only pass along the path of the request to the backend: https://github.com/lightninglabs/aperture/blob/master/pricesrpc/rpc.proto#L12

This is useful or pricing distinct calls to diff paths, but isn't as useful for more advanced use cases. One example is proxying access to an LLM, but scaling the pricing per query, based on things like the chosen model, the context size, etc, etc. All information that will be sent along with the rest as JSON encoded body params.

We should pass along all/some of the other request level context: https://pkg.go.dev/net/http#Request

Roasbeef avatar May 31 '23 23:05 Roasbeef

Relevant context: https://github.com/lightninglabs/aperture/blob/9b85f8bbc629c17bb9c4a8f00db33dcadf68e147/proxy/proxy.go#L158-L161

Roasbeef avatar May 31 '23 23:05 Roasbeef