How to log raw calls to LLM? #74
-
|
First of all, amazing library! Our app has been working with SK, but due to how slow things are moving, we are looking for a substitute. So far, LlmTornado has been fantastic. A question: is there a way to log raw calls to an LLM - we want to see exactly what has been sent and received? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
|
Hi, there sure is. Which APIs are you using? We have two layers for logging. |
Beta Was this translation helpful? Give feedback.
-
|
Also, for the sake of completeness - the other way to log outbound data is constructing your own TornadoApi api = new TornadoApi(new AnthropicEndpointProvider // or GoogleEndpointProvider for Gemini
{
Auth = new ProviderAuthentication("YOUR_API_KEY"),
RequestResolver = (request, data, streaming) =>
{
// log here, "request" has the payload serialized, "data" references the underlying object
},
RequestSerializer = (data, ctx) =>
{
// can be used to transform outbound requests if needed
}
}); |
Beta Was this translation helpful? Give feedback.
Also, for the sake of completeness - the other way to log outbound data is constructing your own
EndpointProvider, which is really simple: