3 ms·
For what LangChain does, yes, handrolled code. There won't be much of it because it doesn't actually do all that much. As for "import openai", that's actually
by int_19h 10mo ago
For what LangChain does, yes, handrolled code. There won't be much of it because it doesn't actually do all that much.
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.
- jmogly 10mo agoI’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: …