Skip to content

Commit 3a5dd96

Browse files
committed
pricesrpc: add http_request_text to GetPrice
In this commit, we add the http_request_text to the `GetPrice` RPC call. This'll contain the fully serialized HTTP request, which'll permit the back end to check things like the set of headers or request body, which may be useful in more fine grained pricing functions. One example is: when proxying requests to an LLM platform provider, the backed may want to charge more based on the length of the context/message and/or which model is being used.
1 parent e8fa845 commit 3a5dd96

File tree

3 files changed

+34
-16
lines changed

3 files changed

+34
-16
lines changed

pricesrpc/rpc.pb.go

Lines changed: 26 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pricesrpc/rpc.proto

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ option go_package = "github.com/lightninglabs/aperture/pricesrpc";
66

77
service Prices { rpc GetPrice(GetPriceRequest) returns (GetPriceResponse); }
88

9-
message GetPriceRequest { string path = 1; }
9+
message GetPriceRequest {
10+
string path = 1;
11+
12+
string http_request_text = 2;
13+
}
1014

1115
message GetPriceResponse { int64 price_sats = 1; }

pricesrpc/rpc.swagger.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@
5555
"properties": {
5656
"path": {
5757
"type": "string"
58+
},
59+
"http_request_text": {
60+
"type": "string"
5861
}
5962
}
6063
},

0 commit comments

Comments
 (0)