ElixirScope.AI.LLM.Client (elixir_scope v0.0.1)
Main LLM client interface for ElixirScope.
Provides a simple, unified API for code analysis, error explanation, and fix suggestions. Handles provider selection and automatic fallback from Vertex/Gemini to Mock provider on errors.
Summary
Functions
Analyzes code using the configured LLM provider.
Explains an error using the configured LLM provider.
Gets the current provider configuration.
Suggests a fix using the configured LLM provider.
Tests connectivity to the primary provider.
Functions
@spec analyze_code(String.t(), map()) :: ElixirScope.AI.LLM.Response.t()
Analyzes code using the configured LLM provider.
Examples
iex> ElixirScope.AI.LLM.Client.analyze_code("def hello, do: :world")
%ElixirScope.AI.LLM.Response{
text: "This is a simple function definition...",
success: true,
provider: :vertex
}
@spec explain_error(String.t(), map()) :: ElixirScope.AI.LLM.Response.t()
Explains an error using the configured LLM provider.
Examples
iex> ElixirScope.AI.LLM.Client.explain_error("undefined function foo/0")
%ElixirScope.AI.LLM.Response{
text: "This error occurs when...",
success: true,
provider: :vertex
}
@spec get_provider_status() :: map()
Gets the current provider configuration.
@spec suggest_fix(String.t(), map()) :: ElixirScope.AI.LLM.Response.t()
Suggests a fix using the configured LLM provider.
Examples
iex> ElixirScope.AI.LLM.Client.suggest_fix("function is too complex")
%ElixirScope.AI.LLM.Response{
text: "To reduce complexity, consider...",
success: true,
provider: :vertex
}
@spec test_connection() :: ElixirScope.AI.LLM.Response.t()
Tests connectivity to the primary provider.