ElixirScope.AI.LLM.Response (elixir_scope v0.0.1)
Standardized response format for LLM providers.
This module defines a common response structure that all providers (Gemini, Mock, future providers) must return, ensuring consistent handling throughout ElixirScope.
Summary
Functions
Creates an error response.
Gets the error message, returning nil for successful responses.
Gets the response text, returning empty string for errors.
Creates a successful response.
Checks if the response is successful.
Types
Functions
Creates an error response.
Examples
iex> ElixirScope.AI.LLM.Response.error("API timeout", :gemini)
%ElixirScope.AI.LLM.Response{
text: "",
confidence: 0.0,
provider: :gemini,
success: false,
error: "API timeout"
}
Gets the error message, returning nil for successful responses.
Gets the response text, returning empty string for errors.
Creates a successful response.
Examples
iex> ElixirScope.AI.LLM.Response.success("Analysis complete", 0.95, :gemini)
%ElixirScope.AI.LLM.Response{
text: "Analysis complete",
confidence: 0.95,
provider: :gemini,
success: true,
error: nil
}
Checks if the response is successful.