PhoenixKit.Modules.AI.Web.EndpointForm (phoenix_kit v1.7.62)

Copy Markdown View Source

LiveView for creating and editing AI endpoints.

An endpoint combines provider credentials, model selection, and generation parameters into a single configuration.

Summary

Functions

Formats a number with thousands separators.

Returns parameters supported by the model, filtered to ones we have UI for. Groups them by :basic and :advanced.

Gets the max tokens limit for the selected model.

Parameter definitions with type, constraints, and UI metadata. Only parameters we support in the UI are defined here.

Callback implementation for Phoenix.LiveView.render/1.

Functions

format_number(num)

Formats a number with thousands separators.

get_supported_params(model)

Returns parameters supported by the model, filtered to ones we have UI for. Groups them by :basic and :advanced.

model_max_tokens(model)

Gets the max tokens limit for the selected model.

param_input(assigns)

Attributes

  • key (:string) (required)
  • definition (:map) (required)
  • form (:map) (required)
  • endpoint (:any) - Defaults to nil.
  • selected_model (:map) - Defaults to nil.
  • size (:string) - Defaults to "md".

parameter_definitions()

Parameter definitions with type, constraints, and UI metadata. Only parameters we support in the UI are defined here.

render(assigns)

Callback implementation for Phoenix.LiveView.render/1.