google

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const API_KEY string = "1703d54836a59537c8256940b15809260dce88ad"

Variables

This section is empty.

Functions

func GoogleSearchAndImages added in v0.0.4

func GoogleSearchAndImages(query string, toolsMeta map[string]interface{}) (string, []interface{}, error)

Types

type GoogleSerperAPIWrapper

type GoogleSerperAPIWrapper struct {
	K                int    `json:"k"`
	Gl               string `json:"gl"`
	Hl               string `json:"hl"`
	Type             string `json:"type"`
	ResultKeyForType map[string]string
	Tbs              string `json:"tbs"`
	SerperAPIKey     string `json:"serper_api_key"`
	AioSession       *http.Client
	// contains filtered or unexported fields
}

func NewGoogleSerperAPIWrapper

func NewGoogleSerperAPIWrapper() *GoogleSerperAPIWrapper

func (*GoogleSerperAPIWrapper) Results

func (w *GoogleSerperAPIWrapper) Results(query string, kwargs map[string]interface{}) map[string]interface{}

func (*GoogleSerperAPIWrapper) Run

func (w *GoogleSerperAPIWrapper) Run(query string, kwargs map[string]interface{}) (*string, any)

type Image

type Image struct {
	Title           string `json:"title"`
	ImageUrl        string `json:"imageUrl"`
	ImageWidth      int    `json:"imageWidth"`
	ImageHeight     int    `json:"imageHeight"`
	ThumbnailUrl    string `json:"thumbnailUrl"`
	ThumbnailWidth  int    `json:"thumbnailWidth"`
	ThumbnailHeight int    `json:"thumbnailHeight"`
	Source          string `json:"source"`
	Domain          string `json:"domain"`
	Link            string `json:"link"`
	GoogleUrl       string `json:"googleUrl"`
	Position        int    `json:"position"`
}

type ImageSearchResult

type ImageSearchResult struct {
	SearchParameters SearchParameters `json:"searchParameters"`
	Images           []Image          `json:"images"`
}

type SearchParameters

type SearchParameters struct {
	Q      string `json:"q"`
	Type   string `json:"type"`
	Engine string `json:"engine"`
	Num    int    `json:"num"`
}

type SearchResult

type SearchResult struct {
	Link    string
	Snippet string
	Fact    string
}

Jump to

Keyboard shortcuts

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