brainlid / langchain

Elixir implementation of an AI focused LangChain style framework.
https://hexdocs.pm/langchain/
Other
574 stars 68 forks source link

Initial formalization of the behaviour for LLM #12

Closed RudolfMan closed 11 months ago

RudolfMan commented 12 months ago

Hi there! First of all, thank you for this initiative!

I'm working in a project where we want to experiment with various different LLMs, and, while having most of them implemented inside library would be nice, I see that the LLM implementation is actually decoupled from the "LangChain framework", if we formalized the behaviour or a protocol it would enable users of the library to more confidently attach their own LLM implementations and maybe contribute back to the library!

I tried to provide with minimal changes that keeps all of the implementation same, just moves the @spec of ChatOpenAI.call/4 into a behaviour callback.

brainlid commented 11 months ago

I'm going to wait on defining any formal interfaces until there are multiple working implementation examples.