Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
GHC.Plugin.OllamaHoles
Description
The Ollama plugin for GHC
Synopsis
- promptTemplate :: Text
- getBackend :: Flags -> Backend
- plugin :: Plugin
- parseInContext :: Text -> TcM (Either String (LHsExpr GhcPs))
- verifyHoleFit :: Bool -> TypedHole -> Text -> TcM Bool
- seekGuidance :: [HoleFitCandidate] -> TcM String
- preProcess :: [Text] -> [Text]
- data Flags = Flags {
- model_name :: Text
- backend_name :: Text
- num_expr :: Int
- debug :: Bool
- include_docs :: Bool
- openai_base_url :: Text
- openai_key_name :: Text
- defaultFlags :: Flags
- getDocs :: [HoleFitCandidate] -> TcM String
- fullyQualified :: HoleFitCandidate -> Maybe RdrName
- parseFlags :: [CommandLineOption] -> Flags
- replacePlaceholders :: Text -> [(Text, String)] -> Text
Documentation
promptTemplate :: Text Source #
Prompt used to prompt the LLM
getBackend :: Flags -> Backend Source #
Determine which backend to use
parseInContext :: Text -> TcM (Either String (LHsExpr GhcPs)) Source #
Parse an expression in the current context
verifyHoleFit :: Bool -> TypedHole -> Text -> TcM Bool Source #
Check that the hole fit matches the type of the hole
seekGuidance :: [HoleFitCandidate] -> TcM String Source #
Try to find the guide provided by the user
preProcess :: [Text] -> [Text] Source #
Preprocess the response to remove empty lines, lines with only spaces, and code blocks
Command line options for the plugin
Constructors
Flags | |
Fields
|
defaultFlags :: Flags Source #
Default flags for the plugin
getDocs :: [HoleFitCandidate] -> TcM String Source #
Produce the documentation of all the HolefitCandidates.
fullyQualified :: HoleFitCandidate -> Maybe RdrName Source #
Produce a fully qualified name, e.g. L.sort if Data.List is imported as L
parseFlags :: [CommandLineOption] -> Flags Source #
Parse command line options