Open noozo opened 2 months ago
Hi all,
I noticed this function in completions.ex:
defp adapter(%{adapter: adapter}) when is_atom(adapter), do: adapter defp adapter(_), do: Application.get_env(:instructor, :adapter, Instructor.Adapters.OpenAI)
Looking into how the adapters use the config internally, seems like they all expect config to be a keyword list, not a map. My take is that the first clause there is wrong and makes passing in the adapter via explicit config impossible atm.
Am i wrong?
Something like this would work?
defp adapter(config), do: if(config[:adapter], do: config[:adapter], else: Application.get_env(:instructor, :adapter, Instructor.Adapters.OpenAI) )
Created PR https://github.com/thmsmlr/instructor_ex/pull/43
Hi all,
I noticed this function in completions.ex:
Looking into how the adapters use the config internally, seems like they all expect config to be a keyword list, not a map. My take is that the first clause there is wrong and makes passing in the adapter via explicit config impossible atm.
Am i wrong?