GenAI.ProviderBehaviour behaviour (GenAI Core v0.1.0)

Link to this section Summary

Link to this section Callbacks

Link to this callback

chat(model, messages, tools, hyper_parameters, provider_settings)

@callback chat(
  model :: any(),
  messages :: any(),
  tools :: any(),
  hyper_parameters :: any(),
  provider_settings :: any()
) :: any()
Link to this callback

format_message(message, state)

@callback format_message(message :: any(), state :: any()) ::
  {:ok, message :: any(), state :: any()} | {:error, term()}
Link to this callback

format_tool(tool, state)

@callback format_tool(tool :: any(), state :: any()) ::
  {:ok, tool :: any(), state :: any()} | {:error, term()}
@callback run(state :: any()) ::
  {:ok, completion :: any(), state :: any()} | {:error, term()}

Link to this section Functions

Link to this function

format_message(handler, message, state)

Link to this function

format_tool(handler, tool, state)

Link to this function

run(handler, state)