prompt

package
v0.0.0-...-131b1cd Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ClassifierInfo = node.Info{
	Name:        "classifier",
	Description: "used to classify the intent of the user.",
}

ClassifierInfo is the node.Info for the Classifier.

View Source
var CoderInfo = node.Info{
	Name:        "coder",
	Description: "use to write some code, in various programming language",
	Parameters:  "The detailed summary of the code to write",
}

CoderInfo is the node.Info for the Coder.

View Source
var ConversationInfo = node.Info{
	Name:        "conversation",
	Description: "used to have a general conversation with the user",
	Parameters:  "the user INPUT, as is. You must not modify or summarize it",
}

ConversationInfo is the node.Info for Conversation.

View Source
var StoryTellerInfo = node.Info{
	Name:        "storyteller",
	Description: "use to invent a story, tell a tale or a lie.",
	Parameters:  "The subject of the story to write",
}

StoryTellerInfo is the node.Info for the StoryTeller.

View Source
var SummarizerInfo = node.Info{
	Name:        "summarizer",
	Description: "use to summarize (resume, brief, shorten) some text, URL or document.",
	Parameters:  "either the full texAt to summarize or a valid URL. if the url schema is missing, assume https://",
}

SummarizerInfo is the node.Info for the Summarizer.

Functions

This section is empty.

Types

type Classifier

type Classifier struct {
	*node.Prompt
	// contains filtered or unexported fields
}

A Classifier is a prompt that will try to classify an input into using one of of the tools it knows. The tools are different node.Node that are identified by their node.Info.

func NewClassifier

func NewClassifier(tools ...node.Info) *Classifier

NewClassifier returns a new *Classifier.

func (*Classifier) Execute

func (n *Classifier) Execute(ctx context.Context, in node.Input) (output string, err error)

Execute implements the Node interface.

type Coder

type Coder struct {
	*node.Prompt
}

A Coder is a prompt asking the LLM to perform various coding operations.

func NewCoder

func NewCoder() *Coder

NewCoder returns a new *Coder.

type Conversation

type Conversation struct {
	*node.Prompt
}

A Conversation is a prompt that can be used to have a generic conversation with the LLM.

func NewConversation

func NewConversation() *Conversation

NewConversation returns a new *Conversation.

func (*Conversation) Execute

func (n *Conversation) Execute(ctx context.Context, in node.Input) (string, error)

Execute implements the node.Node interface. It will inject into the input the llm.OptionStop needed.

type StoryTeller

type StoryTeller struct {
	*node.Prompt
}

A StoryTeller teller is a prompt tailored to invent stories.

func NewStoryTeller

func NewStoryTeller() *StoryTeller

NewStoryTeller returns a new *StroyTeller.

type Summarizer

type Summarizer struct {
	*node.Prompt
}

A Summarizer is a prompt that will try to summuarize the given input. If the input is a valid URL, the content of that URL will first be retrieved using readability, then will be summarized.

func NewSummarizer

func NewSummarizer() *Summarizer

NewSummarizer returns a new *Summarizer.

func (*Summarizer) Execute

func (s *Summarizer) Execute(ctx context.Context, in node.Input) (string, error)

Execute implements the node.Node interface.

Jump to

Keyboard shortcuts

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