https://www.boundaryml.com logo
🟡 Accessing rendered BAML prompt in TypeScript
# questions
j
What is the best way (in TS) to get access to the rendered baml prompt before sent to the LLM? Do I have to use the Modular api and intercept the requests? Thought there might be an easier way but havn't seen any.
v
read only? or so you can mutate it?
read only would be collector. but for access prior, its modular api
j
ya read only, oh I see ya collector makes sense. i'll try that, thanks!
Hey @Vaibhav (BAML 🐑) , sorry i'm still not sure. I see I can do
console.log(collector.last.rawLlmResponse)
But that gives me the raw llm response. Is there a property to access the rendered baml prompt (that gets sent to the llm)?
Don't see a property like such
v
Oh! There should be a thing that provides access to the raw http request that is fired here
the last request print(collector.last.calls[-1].http_response)
I think it also has the request
j
Thanks @Vaibhav (BAML 🐑) That worked!