parsing nested fields when argument is a TypedStruct
I have the following typed struct:
defmodule WeightRanker do use Ash.TypedStruct typed_struct do field :dense_vector, :float, default: 1 field :splade_vector_text, :float, default: 1 field :splade_vector_title, :float, default: 1 field :splade_vector_tags, :float, default: 1 field :splade_vector_description, :float, default: 1 field :bm25_vector_text, :float, default: 1 field :bm25_vector_title, :float, default: 1 field :bm25_vector_tags, :float, default: 1 field :bm25_vector_description, :float, default: 1 end end
defmodule WeightRanker do use Ash.TypedStruct typed_struct do field :dense_vector, :float, default: 1 field :splade_vector_text, :float, default: 1 field :splade_vector_title, :float, default: 1 field :splade_vector_tags, :float, default: 1 field :splade_vector_description, :float, default: 1 field :bm25_vector_text, :float, default: 1 field :bm25_vector_title, :float, default: 1 field :bm25_vector_tags, :float, default: 1 field :bm25_vector_description, :float, default: 1 end end
I want to be able to receive it as an input on an action:
argument :weights, Milvus.WeightRanker, default: fn -> Milvus.WeightRanker.new!(%{}) end
argument :weights, Milvus.WeightRanker, default: fn -> Milvus.WeightRanker.new!(%{}) end
The Elixir backend framework for unparalleled productivity. Declarative tools that let you stop wasting time. Use with Phoenix LiveView or build APIs in minutes for your front-end of choice.