langchain

package
v0.0.0-...-8699900 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	provider.Completer
}

func New

func New(url string, options ...Option) (*Client, error)

type Completer

type Completer struct {
	*Config
}

func NewCompleter

func NewCompleter(url string, options ...Option) (*Completer, error)

func (*Completer) Complete

func (c *Completer) Complete(ctx context.Context, messages []provider.Message, options *provider.CompleteOptions) (*provider.Completion, error)

type Config

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

type Input

type Input struct {
	Input   string    `json:"input"`
	History []Message `json:"chat_history"`
}

type Message

type Message struct {
	Type    MessageType `json:"type"`
	Content string      `json:"content"`
}

type MessageType

type MessageType string
var (
	MessageTypeSystem MessageType = "system"
	MessageTypeHuman  MessageType = "human"
	MessageTypeAI     MessageType = "ai"
)

type Option

type Option func(*Config)

func WithClient

func WithClient(client *http.Client) Option

type RunData

type RunData struct {
	Output  string `json:"output"`
	Content string `json:"content"`

	Messages []Message `json:"messages"`
}

type RunInput

type RunInput struct {
	Input Input `json:"input"`
}

Jump to

Keyboard shortcuts

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