Re:All I Want for Xmas Is Your Secrets: LangGrinch Hits Lang...
by jmogly on Sunday December 28, 2025 @04:49AM
(#46409829)
I’ve been using the following pattern since gpt3, the only other thing I have changed was added another parameter for schema for structured output. People really love to overcomplicate things.
class AI(Protocol):
def call_llm(prompt: str) -> str: …
As for "import openai", that's actually somewhat orthogonal, but if what you want is a common API for different providers then there are many options around that do just that. But then again at that point you probably also want something like OpenRouter, which has its own generic API.