kagi

package
v0.2.18 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: MIT Imports: 21 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) Run

func (c *EnrichWebCommand) Run(
	ctx context.Context,
	parsedLayers map[string]*layers.ParsedParameterLayer,
	ps map[string]interface{},
	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 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 map[string]*layers.ParsedParameterLayer,
	ps map[string]interface{},
	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 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 map[string]*layers.ParsedParameterLayer,
	ps map[string]interface{},
	w io.Writer,
) error

Jump to

Keyboard shortcuts

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