Represents the final result of a completed Deep Research request.
This schema captures the research findings, citations, usage statistics, and other metadata from a successful research operation.
Sources are stored as LangChain.Message.Citation structs, providing a
unified citation representation shared across all providers.
Summary
Functions
Creates a changeset for research result.
Formats the result for display, including the main text and source summary.
Creates a ResearchResult from an OpenAI API response.
Gets the total number of sources cited in the research.
Extracts just the URLs from the sources for easy reference.
Gets the total number of tool calls made during research.
Types
Functions
@spec changeset(t(), map()) :: Ecto.Changeset.t()
Creates a changeset for research result.
Formats the result for display, including the main text and source summary.
@spec from_api_response(map()) :: {:ok, t()} | {:error, Ecto.Changeset.t()}
Creates a ResearchResult from an OpenAI API response.
Gets the total number of sources cited in the research.
Extracts just the URLs from the sources for easy reference.
Gets the total number of tool calls made during research.