featureextractors

package
v0.0.0-...-7b96089 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Reflect

func Reflect[T any](ctx context.Context, req ReflectOptions) (def T, _ chat.Message, _ error)

Types

type AgentPromptTemplate

type AgentPromptTemplate struct {
	Profile        agents.Profile
	SystemMessages []chat.Message
	Messages       []*thoughtstream.Thought
}

func (*AgentPromptTemplate) AsPrompt

func (a *AgentPromptTemplate) AsPrompt() chain.Prompt

func (*AgentPromptTemplate) Build

type Book

type Book struct {
	psi.NodeBase

	Title    string    `json:"title" jsonschema:"title=Title,description=Title of the book."`
	Author   string    `json:"author" jsonschema:"title=Author,description=Author of the book."`
	Chapters []Chapter `json:"chapters" jsonschema:"title=Chapters,description=Chapters of the book."`
}

type Chapter

type Chapter struct {
	psi.NodeBase

	Title       string `json:"title" jsonschema:"title=Title,description=Title of the chapter."`
	Description string `json:"body" jsonschema:"title=Body,description=Body of the chapter."`
	Pages       []Page `json:"pages" jsonschema:"title=Pages,description=Pages of the chapter."`
}

type CodeBocks

type CodeBocks struct {
	psi.NodeBase

	Blocks []mdutils.CodeBlock
}

func ExtractCodeBlocks

func ExtractCodeBlocks(ctx context.Context, expectedLanguage string, history ...*thoughtstream.Thought) (*CodeBocks, error)

type GoalCompletion

type GoalCompletion struct {
	psi.NodeBase

	Goal                   string `json:"goal" jsonschema:"title=Goal,description=Description of the goal."`
	Completed              bool   `json:"completed" jsonschema:"title=Completed,description=Whether the goal is completed."`
	CompletionStepsCurrent int    `json:"completionStepsCurrent" jsonschema:"title=Completion steps current,description=Number of steps completed."`
	CompletionStepsTotal   int    `json:"completionStepsTotal" jsonschema:"title=Completion steps total,description=Total number of steps."`
	Reasoning              string `json:"reasoning" jsonschema:"title=Reasoning,description=Reasoning for the completion."`
	Feedback               string `json:"feedback" jsonschema:"title=Feedback,description=Feedback for the completion."`
}

func QueryGoalCompletion

func QueryGoalCompletion(ctx context.Context, history []*thoughtstream.Thought) (GoalCompletion, error)

type Library

type Library struct {
	psi.NodeBase

	Books []Book `json:"books" jsonschema:"title=Books,description=Books in the library."`
}

func QueryLibrary

func QueryLibrary(ctx context.Context, history []*thoughtstream.Thought) (Library, error)

type Objective

type Objective struct {
	psi.NodeBase

	Name        string   `json:"Name" jsonschema:"title=Name,description=Name of the objective."`
	Description string   `json:"Description" jsonschema:"title=Description,description=Description of the objective."`
	Keywords    []string `json:"Keywords" jsonschema:"title=Keywords,description=Keywords of the objective."`

	PositivePlan     Plan `json:"PositivePlan" jsonschema:"title=Positive plan,description=Plan to achieve the objective."`
	NegativePlan     Plan `json:"NegativePlan" jsonschema:"title=Negative plan,description=Plan to avoid the objective."`
	VerificationPlan Plan `` /* 132-byte string literal not displayed */

	Status GoalCompletion `json:"Status" jsonschema:"title=Status,description=Status of the goal."`
}

func QueryObjective

func QueryObjective(ctx context.Context, history []*thoughtstream.Thought) (Objective, error)

type Page

type Page struct {
	psi.NodeBase

	Body       string              `json:"body" jsonschema:"title=Body,description=Body of the page."`
	CodeBlocks []mdutils.CodeBlock `json:"codeBlocks" jsonschema:"title=CodeBlocks,description=Code blocks of the page."`
}

type Plan

type Plan struct {
	psi.NodeBase

	Name  string     `json:"name" jsonschema:"title=Name,description=Name of the plan."`
	Steps []PlanStep `json:"steps" jsonschema:"title=Steps,description=List of steps in the plan."`
}

func QueryPlan

func QueryPlan(ctx context.Context, history []*thoughtstream.Thought) (Plan, error)

type PlanStatus

type PlanStatus struct {
	psi.NodeBase

	Plan       *Plan             `json:"Plan" jsonschema:"title=Plan,description=Plan that was completed."`
	StepStatus []*PlanStepStatus `json:"StepStatus" jsonschema:"title=StepStatus,description=Status of each step in the plan."`
	Status     *GoalCompletion   `json:"Status" jsonschema:"title=Status,description=Status of the plan."`
}

type PlanStep

type PlanStep struct {
	psi.NodeBase

	Name        string `json:"name" jsonschema:"title=Name,description=Name of the step."`
	Description string `json:"description" jsonschema:"title=Description,description=Description of the step."`
}

type PlanStepStatus

type PlanStepStatus struct {
	psi.NodeBase

	Step   *PlanStep       `json:"Step" jsonschema:"title=Step,description=Step that was completed."`
	Status *GoalCompletion `json:"Status" jsonschema:"title=Status,description=Status of the step."`
}

type ReflectOptions

type ReflectOptions struct {
	History []*thoughtstream.Thought
	Query   string

	ExampleInput  any
	ExampleOutput any
}

type Routing

type Routing struct {
	Recipients map[string][]string `` /* 169-byte string literal not displayed */
}

func QueryMessageRouting

func QueryMessageRouting(ctx context.Context, history []*thoughtstream.Thought) (Routing, error)

type SentimentScore

type SentimentScore struct {
	Anger     float64 `json:"anger"`
	Fear      float64 `json:"fear"`
	Joy       float64 `json:"joy"`
	Sadness   float64 `json:"sadness"`
	Analytic  float64 `json:"analytic"`
	Confident float64 `json:"confident"`
	Tentative float64 `json:"tentative"`
}

func QuerySentimentScore

func QuerySentimentScore(ctx context.Context, history []*thoughtstream.Thought) (SentimentScore, error)

type SimplePromptTemplate

type SimplePromptTemplate struct {
	Messages []*thoughtstream.Thought
}

func (*SimplePromptTemplate) AsPrompt

func (a *SimplePromptTemplate) AsPrompt() chain.Prompt

func (*SimplePromptTemplate) Build

type SpeakerPrediction

type SpeakerPrediction struct {
	NextSpeaker string `json:"NextSpeaker" jsonschema:"description=The next speaker"`
}

func PredictNextSpeaker

func PredictNextSpeaker(ctx context.Context, plan Plan, history ...*thoughtstream.Thought) (SpeakerPrediction, error)

type Summary

type Summary struct {
	Title   string `json:"title" jsonschema:"title=Title,description=Title of the message."`
	Summary string `json:"summary" jsonschema:"title=Summary,description=Summary of the message."`
}

func QuerySummary

func QuerySummary(ctx context.Context, history []*thoughtstream.Thought) (Summary, error)

type Timeline

type Timeline struct {
	psi.NodeBase

	Title string         `json:"title" jsonschema:"title=Title,description=Title of the timeline."`
	Steps []TimelineStep `json:"steps" jsonschema:"title=Steps,description=Steps of the timeline."`
}

func QueryTimeline

func QueryTimeline(ctx context.Context, history ...*thoughtstream.Thought) (Timeline, error)

type TimelineStep

type TimelineStep struct {
	psi.NodeBase

	Title string `json:"title" jsonschema:"title=Title,description=Title of the timeline step."`
	Body  string `json:"body" jsonschema:"title=Body,description=Body of the timeline step."`
}

Jump to

Keyboard shortcuts

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