View Source Indexer behaviour (fnord v0.5.5)

This behaviour wraps the AI-powered operations used by Cmd.Index to allow overrides for testing. See impl/0.

Summary

Functions

Returns the current indexer module. This can be overridden by config for unit testing. See test/test_helper.exs.

Types

completion()

@type completion() :: {:ok, String.t()}

embeddings()

@type embeddings() :: {:ok, [float()]}

error()

@type error() :: {:error, term()}

file_content()

@type file_content() :: String.t()

file_path()

@type file_path() :: String.t()

indexer()

@type indexer() :: struct()

Callbacks

get_embeddings(indexer, file_content)

@callback get_embeddings(indexer(), file_content()) :: embeddings() | error()

get_outline(indexer, file_path, file_content)

@callback get_outline(indexer(), file_path(), file_content()) :: completion() | error()

get_summary(indexer, file_path, file_content)

@callback get_summary(indexer(), file_path(), file_content()) :: completion() | error()

new()

@callback new() :: indexer()

Functions

impl()

Returns the current indexer module. This can be overridden by config for unit testing. See test/test_helper.exs.