Documentation
¶
Index ¶
- Constants
- Variables
- func NewClient(ctx context.Context, p *props.Props) (chat.ChatClient, error)
- func NewClientFor(ctx context.Context, p *props.Props, provider, model string) (chat.ChatClient, error)
- func NewCmdAsk(props *props.Props) *setup.Command
- func Question(args []string) string
- func Render(w io.Writer, r answer.Response)
- func RenderRetrieval(w io.Writer, results []index.Result)
- func RunAsk(ctx context.Context, p *props.Props, opts *AskOptions, args []string) error
- type AskOptions
Constants ¶
View Source
const ( // DefaultDBPath is where the index lives when configuration says nothing. DefaultDBPath = "phpbotscout.db" // DefaultProvider keeps development off metered APIs. claude-local drives a // local Claude Code instance against an existing subscription, which for the // volume a benchmark run makes is the difference between free and not. DefaultProvider = chat.ProviderClaudeLocal )
Defaults for asking from the terminal.
Variables ¶
View Source
var ErrNoQuestion = errors.NewSentinel("ask.no_question", "ask: a question is required")
ErrNoQuestion is returned when the command is run with nothing to ask.
Functions ¶
func NewClient ¶ added in v0.5.0
NewClient builds the chat client from configuration. Exported so serve builds the same client ask does, rather than a second one that drifts.
func NewClientFor ¶ added in v0.11.0
func NewClientFor(ctx context.Context, p *props.Props, provider, model string) (chat.ChatClient, error)
NewClientFor is NewClient with a server's own provider and model, each falling back to ai.* when empty (spec 0029 D7).
func Question ¶
Question joins the arguments into one question, so an unquoted question at the shell asks what was typed rather than only its first word.
func RenderRetrieval ¶
RenderRetrieval prints the ranked passages without composing.
Types ¶
type AskOptions ¶
Click to show internal directories.
Click to hide internal directories.