Skip to content

Reference for Spehulak.jl ​

Spehulak.SnowConversation Type
julia
SnowConversation

Container for conversations (vector of SnowMessage) with some extra fields for metadata.

Fields

  • id: Unique identifier for the conversation

  • title: Title of the conversation, eg, the path of the file

  • class: CSS class for the conversation

  • meta: Metadata for the conversation

  • messages: Vector of SnowMessage

source

Spehulak.SnowMessage Type
julia
SnowMessage

Type designed for displaying the conversation in Stipple.

source

Spehulak.SnowRAG Type
julia
SnowRAG

Type designed for displaying the RAG conversation in Spehulak.

Fields

  • conv_main: The main conversation (what user sees)

  • conv_answer: The answer conversation (default LLM chain)

  • conv_final_answer: The final answer conversation (if we used refine! functionality)

  • has_refined_answer: Whether the answer has been refined (refine! functionality)

  • context: The context used to answer the question

  • sources: The sources used to answer the question

  • emb_stats: The embedding candidates statistics (to understand retrieval performance)

  • rerank_stats: The reranking candidates statistics (to understand reranking performance)

  • meta: The metadata from the first message (if it's a tracer message)

source

Spehulak.launch Function
julia
launch(
    port::Int = 9001, host::String = "127.0.0.1";
    async::Bool = true)

Launches Spehulak in the browser.

Defaults to: http://127.0.0.1:9001. This is a convenience wrapper around Genie.up, to customize the server configuration use Genie.up() and Genie.config.

Arguments

  • port::Int = 9001: The port to launch the server on.

  • host::String = "127.0.0.1": The host to launch the server on.

  • async::Bool = true: Whether to launch the server asynchronously, ie, in the background.

source

Spehulak.load_object Method
julia
load_object(path::String)

Loads a conversation or RAGResult from a JSON file. Loads in try-catch loop for safety.

source

Spehulak.load_objects_from_dir Method
julia
load_objects_from_dir(dir::String)

Loads all conversations and RAGResults from a directory and its sub-directories

source

Spehulak.msg2snow Method
julia
msg2snow(vect::AbstractVector{<:PT.AbstractMessage}; path::AbstractString = "")

Transforms a vector of messages into a SnowConversation that Spehulak understands.

source

Spehulak.msg2snow Method
julia
msg2snow(msg::PT.AbstractMessage; kwargs...)

Transforms a PromptingTools message into a SnowMessage that Spehulak understands.

source

Spehulak.msg2snow Method
julia
msg2snow(msg::PT.AbstractTracerMessage; kwargs...)

Transforms a Tracer message into a SnowMessage that Spehulak understands.

source

Spehulak.msg2snow Method
julia
msg2snow(rag::RT.RAGResult; path::AbstractString = "")

Transforms a RAGResult into a SnowRAG that Spehulak understands.

source