kadrian
How to let an LLM "use" a tRPC api?
Hey, so I've been wondering lately how to build a simple LLM-supported CRUD app.
With REST APIs, it's clear: I can give an LLM the entire API specs (e.g. using openAPI / swagger, etc.) and then ask it to translate the natural language user request (e.g. from a "chat") into a series of actions, using the REST endpoints. Then the LLM can write curl request code, for example, to "use" the REST api.
But from a react / typescript perspective, using tRPC is just A LOT better (no need to tell you, hehe). How would you design a system where an LLM is basically "an additional client" that uses tRPC? Would the LLM have to generate typescript code (instead of curl requests) that I'd have to run? How would the LLM know about the api spec? Any other ideas here?
4 replies