context

package
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentContext

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

AgentContext represents the context for an agent

func FromContext

func FromContext(ctx context.Context) *AgentContext

FromContext creates a new agent context from a standard context

func New

func New() *AgentContext

New creates a new agent context

func (*AgentContext) Context

func (c *AgentContext) Context() context.Context

Context returns the underlying context.Context

func (*AgentContext) ConversationID

func (c *AgentContext) ConversationID() (string, bool)

ConversationID returns the conversation ID from the context

func (*AgentContext) DataStore

func (c *AgentContext) DataStore() (interfaces.DataStore, bool)

DataStore returns the data store from the context

func (*AgentContext) Deadline

func (c *AgentContext) Deadline() (time.Time, bool)

Deadline returns the deadline from the context

func (*AgentContext) Done

func (c *AgentContext) Done() <-chan struct{}

Done returns the done channel from the context

func (*AgentContext) Environment

func (c *AgentContext) Environment(key string) (interface{}, bool)

Environment returns an environment variable from the context

func (*AgentContext) Err

func (c *AgentContext) Err() error

Err returns the error from the context

func (*AgentContext) LLM

func (c *AgentContext) LLM() (interfaces.LLM, bool)

LLM returns the LLM from the context

func (*AgentContext) Memory

func (c *AgentContext) Memory() (interfaces.Memory, bool)

Memory returns the memory from the context

func (*AgentContext) OrganizationID

func (c *AgentContext) OrganizationID() (string, bool)

OrganizationID returns the organization ID from the context

func (*AgentContext) RequestID

func (c *AgentContext) RequestID() (string, bool)

RequestID returns the request ID from the context

func (*AgentContext) Tools

func (c *AgentContext) Tools() (interfaces.ToolRegistry, bool)

Tools returns the tools from the context

func (*AgentContext) UserID

func (c *AgentContext) UserID() (string, bool)

UserID returns the user ID from the context

func (*AgentContext) Value

func (c *AgentContext) Value(key interface{}) interface{}

Value returns a value from the context

func (*AgentContext) VectorStore

func (c *AgentContext) VectorStore() (interfaces.VectorStore, bool)

VectorStore returns the vector store from the context

func (*AgentContext) WithCancel

func (c *AgentContext) WithCancel() (*AgentContext, context.CancelFunc)

WithCancel returns a new context that can be canceled

func (*AgentContext) WithConversationID

func (c *AgentContext) WithConversationID(conversationID string) *AgentContext

WithConversationID sets the conversation ID in the context

func (*AgentContext) WithDataStore

func (c *AgentContext) WithDataStore(dataStore interfaces.DataStore) *AgentContext

WithDataStore sets the data store in the context

func (*AgentContext) WithDeadline

func (c *AgentContext) WithDeadline(deadline time.Time) (*AgentContext, context.CancelFunc)

WithDeadline sets a deadline for the context

func (*AgentContext) WithEnvironment

func (c *AgentContext) WithEnvironment(key string, value interface{}) *AgentContext

WithEnvironment sets an environment variable in the context

func (*AgentContext) WithLLM

func (c *AgentContext) WithLLM(llm interfaces.LLM) *AgentContext

WithLLM sets the LLM in the context

func (*AgentContext) WithMemory

func (c *AgentContext) WithMemory(memory interfaces.Memory) *AgentContext

WithMemory sets the memory in the context

func (*AgentContext) WithOrganizationID

func (c *AgentContext) WithOrganizationID(orgID string) *AgentContext

WithOrganizationID sets the organization ID in the context

func (*AgentContext) WithRequestID

func (c *AgentContext) WithRequestID(requestID string) *AgentContext

WithRequestID sets the request ID in the context

func (*AgentContext) WithTimeout

func (c *AgentContext) WithTimeout(timeout time.Duration) (*AgentContext, context.CancelFunc)

WithTimeout sets a timeout for the context

func (*AgentContext) WithTools

func (c *AgentContext) WithTools(tools interfaces.ToolRegistry) *AgentContext

WithTools sets the tools in the context

func (*AgentContext) WithUserID

func (c *AgentContext) WithUserID(userID string) *AgentContext

WithUserID sets the user ID in the context

func (*AgentContext) WithVectorStore

func (c *AgentContext) WithVectorStore(vectorStore interfaces.VectorStore) *AgentContext

WithVectorStore sets the vector store in the context

type Key

type Key string

Key represents a key for context values

const (
	// OrganizationIDKey is the key for the organization ID
	OrganizationIDKey Key = "organization_id"

	// ConversationIDKey is the key for the conversation ID
	ConversationIDKey Key = "conversation_id"

	// UserIDKey is the key for the user ID
	UserIDKey Key = "user_id"

	// RequestIDKey is the key for the request ID
	RequestIDKey Key = "request_id"

	// MemoryKey is the key for the memory
	MemoryKey Key = "memory"

	// ToolsKey is the key for the tools
	ToolsKey Key = "tools"

	// DataStoreKey is the key for the data store
	DataStoreKey Key = "data_store"

	// VectorStoreKey is the key for the vector store
	VectorStoreKey Key = "vector_store"

	// LLMKey is the key for the LLM
	LLMKey Key = "llm"

	// EnvironmentKey is the key for environment variables
	EnvironmentKey Key = "environment"
)

Jump to

Keyboard shortcuts

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