kagi

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterKagiCommands

func RegisterKagiCommands() *cobra.Command

func RenderFastGPTAnswers

func RenderFastGPTAnswers(answer FastGPTAnswer, query string) (string, error)

func RenderMarkdown

func RenderMarkdown(searchObjects []SearchObject) (string, error)

Types

type EnrichWebCommand

type EnrichWebCommand struct {
	*cmds.CommandDescription
}

func NewEnrichWebCommand

func NewEnrichWebCommand() (*EnrichWebCommand, error)

func (*EnrichWebCommand) RunIntoGlazeProcessor added in v0.3.0

func (c *EnrichWebCommand) RunIntoGlazeProcessor(
	ctx context.Context,
	parsedLayers *layers.ParsedLayers,
	gp middlewares.Processor,
) error

type EnrichWebResponse

type EnrichWebResponse struct {
	Meta struct {
		ID   string `json:"id"`
		Node string `json:"node"`
		MS   int    `json:"ms"`
	} `json:"meta"`
	Data []SearchObject `json:"data"`
}

type EnrichWebSettings added in v0.3.0

type EnrichWebSettings struct {
	Query    string `glazed.parameter:"query"`
	Token    string `glazed.parameter:"token"`
	Markdown bool   `glazed.parameter:"markdown"`
	Limit    int    `glazed.parameter:"limit"`
	News     bool   `glazed.parameter:"news"`
}

type FastGPTAnswer

type FastGPTAnswer struct {
	Output     string      `json:"output"`
	Tokens     int         `json:"tokens"`
	References []Reference `json:"references"`
}

type FastGPTCommand

type FastGPTCommand struct {
	*cmds.CommandDescription
}

func NewFastGPTCommand

func NewFastGPTCommand() (*FastGPTCommand, error)

func (*FastGPTCommand) RunIntoWriter

func (c *FastGPTCommand) RunIntoWriter(
	ctx context.Context,
	parsedLayers *layers.ParsedLayers,
	w io.Writer,
) error

type FastGPTRequest

type FastGPTRequest struct {
	Query     string `json:"query"`
	Cache     bool   `json:"cache"`
	WebSearch bool   `json:"web_search"`
}

type FastGPTResponse

type FastGPTResponse struct {
	Meta struct {
		ID   string `json:"id"`
		Node string `json:"node"`
		MS   int    `json:"ms"`
	} `json:"meta"`
	Data FastGPTAnswer `json:"data"`
}

type FastGPTSettings added in v0.3.0

type FastGPTSettings struct {
	Query     string `glazed.parameter:"query"`
	Cache     bool   `glazed.parameter:"cache"`
	WebSearch bool   `glazed.parameter:"web_search"`
}

type Reference

type Reference struct {
	Title   string `json:"title"`
	Snippet string `json:"snippet"`
	URL     string `json:"url"`
}

type SearchObject

type SearchObject struct {
	T         int    `json:"t"`
	Rank      int    `json:"rank"`
	URL       string `json:"url"`
	Title     string `json:"title"`
	Snippet   string `json:"snippet"`
	Published string `json:"published"`
}

type SummarizationRequest

type SummarizationRequest struct {
	URL            string `json:"url,omitempty"`
	Text           string `json:"text,omitempty"`
	Engine         string `json:"engine,omitempty"`
	SummaryType    string `json:"summary_type,omitempty"`
	TargetLanguage string `json:"target_language,omitempty"`
	Cache          bool   `json:"cache"`
}

type SummarizationResponse

type SummarizationResponse struct {
	Meta struct {
		ID   string `json:"id"`
		Node string `json:"node"`
		MS   int    `json:"ms"`
	} `json:"meta"`
	Data struct {
		Output string `json:"output"`
		Tokens int    `json:"tokens"`
	} `json:"data"`
}

type SummarizeCommand

type SummarizeCommand struct {
	*cmds.CommandDescription
}

func NewSummarizeCommand

func NewSummarizeCommand() (*SummarizeCommand, error)

func (*SummarizeCommand) RunIntoWriter

func (c *SummarizeCommand) RunIntoWriter(
	ctx context.Context,
	parsedLayers *layers.ParsedLayers,
	w io.Writer,
) error

type SummarizeSettings added in v0.3.0

type SummarizeSettings struct {
	URL            string `glazed.parameter:"url"`
	Text           string `glazed.parameter:"text"`
	Engine         string `glazed.parameter:"engine"`
	SummaryType    string `glazed.parameter:"summary_type"`
	TargetLanguage string `glazed.parameter:"target_language"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL