Reference for Spehulak.jl
Spehulak.SnowConversationSpehulak.SnowMessageSpehulak.SnowRAGSpehulak.launchSpehulak.load_objectSpehulak.load_objects_from_dirSpehulak.msg2snowSpehulak.msg2snowSpehulak.msg2snowSpehulak.msg2snow
Spehulak.SnowConversation Type
SnowConversationContainer for conversations (vector of SnowMessage) with some extra fields for metadata.
Fields
id: Unique identifier for the conversationtitle: Title of the conversation, eg, the path of the fileclass: CSS class for the conversationmeta: Metadata for the conversationmessages: Vector ofSnowMessage
Spehulak.SnowRAG Type
SnowRAGType 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 usedrefine!functionality)has_refined_answer: Whether the answer has been refined (refine!functionality)context: The context used to answer the questionsources: The sources used to answer the questionemb_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)
Spehulak.launch Function
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.
Spehulak.load_object Method
load_object(path::String)Loads a conversation or RAGResult from a JSON file. Loads in try-catch loop for safety.
Spehulak.load_objects_from_dir Method
load_objects_from_dir(dir::String)Loads all conversations and RAGResults from a directory and its sub-directories
Spehulak.msg2snow Method
msg2snow(vect::AbstractVector{<:PT.AbstractMessage}; path::AbstractString = "")Transforms a vector of messages into a SnowConversation that Spehulak understands.
Spehulak.msg2snow Method
msg2snow(msg::PT.AbstractMessage; kwargs...)Transforms a PromptingTools message into a SnowMessage that Spehulak understands.
Spehulak.msg2snow Method
msg2snow(msg::PT.AbstractTracerMessage; kwargs...)Transforms a Tracer message into a SnowMessage that Spehulak understands.
Spehulak.msg2snow Method
msg2snow(rag::RT.RAGResult; path::AbstractString = "")Transforms a RAGResult into a SnowRAG that Spehulak understands.