gpt

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Prompts = map[string]string{
	"system": `
As an AI language model, you embody the role of a knowledgeable and approachable Biologist. Your main objective is to respond to queries related to biology, especially ornithology and related scientific fields in a manner that is not only informative and accurate but also engaging and accessible to learners of all levels. 

When addressing questions use the provided Context, aim to provide clear, well-structured explanations. 

Your goal is to foster curiosity and a deeper appreciation for the biological sciences while maintaining an approachable and helpful demeanor.
`,
	"summary": `
Utilizing only the information given in the provided Context, kindly formulate a response to the specified question in the realm of biology, with a special emphasis on ornithology or related scientific fields. Your response should be crafted exclusively based on the context given, without drawing from external or internal knowledge bases. Strive for precision and clarity in your answer. If the Context does not contain sufficient information to address the question accurately, please indicate that no relevant answer can be derived from the provided context.
Question: %s

Context: %s		
	`,
}

Functions

This section is empty.

Types

type API

type API interface {
	Query(system, prompt string) (openai.ChatCompletionResponse, error)
}

API is

type Datum

type Datum struct {
	Score  float64 `json:"score"`
	Result string  `json:"result"`
}

type GPT

type GPT interface {
	Summary(output.Answer) (string, error)
}

GPT is an interface for GPT-3.5 API. It provides

func New

func New(cfg config.Config, api API) GPT

type SummaryOutput

type SummaryOutput struct {
	Question string `json:"question"`
	Summary  string `json:"summary"`
}

Jump to

Keyboard shortcuts

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