bard

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BardAnswer

type BardAnswer struct {
	Content           string
	ConversationID    string
	ResponseID        string
	FactualityQueries []any
	TextQuery         string
	Choices           []Choice
	Links             []string
	Images            []any
	ProgramLang       string
	Code              string
	StatusCode        int
}

BardAnswer represents the response from the Bard AI service. It contains the generated text content, conversation ID, response ID, factuality queries, original text query, and any choices provided.

type BardClient

type BardClient struct {
	// contains filtered or unexported fields
}

func NewBardClient

func NewBardClient(token string, opts ...BardClientOption) (*BardClient, error)

func (*BardClient) Ask

func (b *BardClient) Ask(prompt, conversationID, responseID, choiceID string, reqID int) (*BardAnswer, error)

type BardClientOption

type BardClientOption func(*BardClient)

func WithCookies

func WithCookies(cookies map[string]string) BardClientOption

func WithSession

func WithSession(session *http.Client) BardClientOption

func WithTimeout

func WithTimeout(timeout time.Duration) BardClientOption

type Choice

type Choice struct {
	// ID is a unique identifier for the choice.
	ID string
	// Content is the text content of the choice.
	Content string
}

Choice represents an alternative response option provided by Bard.

Jump to

Keyboard shortcuts

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