Documentation ¶
Overview ¶
Package schema implements a shared core set of data types for use in langchaingo.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentAction ¶
type AgentAction struct { Tool string ToolInput string Log string ToolID string ToolInputOriginalArguments string }
AgentAction is the agent's action to take.
type AgentFinish ¶
AgentFinish is the agent's return value.
type AgentStep ¶
type AgentStep struct { Action AgentAction Observation string }
AgentStep is a step of the agent.
type AgentStepWithError ¶
AgentStepWithError combines AgentStep with Error for concurrent execution.
type ChatMessageHistory ¶
type ChatMessageHistory interface { // AddMessage adds a message to the store. AddMessage(ctx context.Context, message llms.ChatMessage) error // AddUserMessage is a convenience method for adding a human message string // to the store. AddUserMessage(ctx context.Context, message string) error // AddAIMessage is a convenience method for adding an AI message string to // the store. AddAIMessage(ctx context.Context, message string) error // Clear removes all messages from the store. Clear(ctx context.Context) error // Messages retrieves all messages from the store Messages(ctx context.Context) ([]llms.ChatMessage, error) // SetMessages replaces existing messages in the store SetMessages(ctx context.Context, messages []llms.ChatMessage) error }
ChatMessageHistory is the interface for chat history in memory/store.
type Memory ¶
type Memory interface { // GetMemoryKey getter for memory key. GetMemoryKey(ctx context.Context) string // MemoryVariables Input keys this memory class will load dynamically. MemoryVariables(ctx context.Context) []string // LoadMemoryVariables Return key-value pairs given the text input to the chain. // If None, return all memories LoadMemoryVariables(ctx context.Context, inputs map[string]any) (map[string]any, error) // SaveContext Save the context of this model run to memory. SaveContext(ctx context.Context, inputs map[string]any, outputs map[string]any) error // Clear memory contents. Clear(ctx context.Context) error }
Memory is the interface for memory in chains.
type OutputParser ¶
type OutputParser[T any] interface { // Parse parses the output of an LLM call. Parse(text string) (T, error) // ParseWithPrompt parses the output of an LLM call with the prompt used. ParseWithPrompt(text string, prompt llms.PromptValue) (T, error) // GetFormatInstructions returns a string describing the format of the output. GetFormatInstructions() string // Type returns the string type key uniquely identifying this class of parser Type() string }
OutputParser is an interface for parsing the output of an LLM call.
Click to show internal directories.
Click to hide internal directories.