Packages
langchain
0.1.2
0.9.2
0.9.1
0.9.0
0.8.14
0.8.13
0.8.12
0.8.11
0.8.10
0.8.9
0.8.8
0.8.7
0.8.6
0.8.5
0.8.4
0.8.3
0.8.2
0.8.1
0.8.0
0.7.0
0.6.3
0.6.2
0.6.1
0.6.0
0.5.2
0.5.1
0.5.0
0.4.1
0.4.0
0.4.0-rc.3
0.4.0-rc.2
0.4.0-rc.1
0.4.0-rc.0
0.3.3
0.3.2
0.3.1
0.3.0
0.3.0-rc.2
0.3.0-rc.1
0.3.0-rc.0
0.2.0
0.1.10
0.1.9
0.1.8
0.1.7
0.1.6
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0
Elixir implementation of a LangChain style framework that lets Elixir projects integrate with and leverage LLMs.
Current section
Files
Jump to
Current section
Files
lib/for_open_ai_api.ex
defprotocol LangChain.ForOpenAIApi do
@moduledoc """
A protocol that defines a way for converting the LangChain Elixir data structs
to an OpenAI supported data structure and format for making an API call.
"""
@doc """
Protocol callback function for converting different structs into a form that
can be passed to the OpenAI API.
"""
@spec for_api(struct()) :: nil | %{String.t() => any()}
def for_api(struct)
end
defimpl LangChain.ForOpenAIApi, for: Any do
def for_api(_struct), do: nil
end