Noizu.Weaviate.Api.Classification (Noizu Weaviate v0.1.1)

Functions for classification operations in Weaviate.

Summary

Types

Link to this type

classification_options()

@type classification_options() ::
  %{optional(:stream) => Noizu.Weaviate.stream_option()} | Keyword.t()
Link to this type

classification_response()

@type classification_response() :: map()
Link to this type

classification_start_options()

@type classification_start_options() ::
  %{optional(:stream) => Noizu.Weaviate.stream_option()} | Keyword.t()
Link to this type

classification_start_response()

@type classification_start_response() :: map()

Functions

Link to this function

get_classification_status(classification_id, options \\ nil)

@spec get_classification_status(String.t(), options :: any()) ::
  {:ok, classification_response()} | {:error, any()}

Get the status, results, and metadata of a classification in Weaviate.

## Parameters

  • classification_id (required) - The ID of the classification.
  • options (optional) - Additional options for the API call.

Returns

A tuple {:ok, response} on successful API call, where response is the API response. Returns {:error, term} on failure, where term contains error details.

Examples

classification_id = "123456789"

{:ok, response} = Noizu.Weaviate.Api.Classification.get_classification_status(classification_id)
Link to this function

start_classification(class_name, classify_properties, based_on_properties, classification_type, options \\ nil)

@spec start_classification(
  String.t(),
  [String.t()],
  [String.t()],
  String.t(),
  options :: any()
) ::
  {:ok, classification_start_response()} | {:error, any()}

Start a classification in Weaviate.

Parameters

  • class_name (required) - The name of the class of the data objects to be classified.
  • classify_properties (required) - List of properties to classify.
  • based_on_properties (required) - List of properties the classification is based on.
  • classification_type (required) - The type of classification to perform, either "knn" or "zeroshot".
  • options (optional) - Additional options for the API call.

Returns

A tuple {:ok, response} on successful API call, where response is the API response. Returns {:error, term} on failure, where term contains error details.

Examples

{:ok, response} = Noizu.Weaviate.Api.Classification.start_classification("Product", ["name"], ["description"], "knn")