bard

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const ASK_URL = BASE_URL + "_/BardChatUi/data/assistant.lamda.BardFrontendService/StreamGenerate"
View Source
const BASE_URL = "https://" + HOST + "/"
View Source
const HOST = "bard.google.com"
View Source
const Origin_url = "https://" + HOST

Variables

This section is empty.

Functions

This section is empty.

Types

type Chatbot

type Chatbot struct {
	ReqID          int
	SNlM0e         string
	ConversationID string
	ResponseID     string
	ChoiceID       string
	Client         *http.Client
	Sessionid      string
}

func NewChatbot

func NewChatbot(sessionID string) (*Chatbot, error)

NewChatbot() function returns a chatbot client which can be used to ask questions.

func (*Chatbot) Ask

func (c *Chatbot) Ask(message string) (*Response, error)

Ask() function takes the message string and returns Bard response of type bard.Response

type Choice

type Choice struct {
	ID      string
	Content string
}

type Response

type Response struct {
	Content           string
	ConversationID    string
	ResponseID        string
	FactualityQueries []interface{}
	TextQuery         string
	Choices           []Choice
}

Jump to

Keyboard shortcuts

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