Documentation ¶
Overview ¶
Package callback provides utilities for implementing callbacks.
Index ¶
- func NewManager(inheritableCallbacks, localCallbacks []schema.Callback, verbose bool, ...) schema.CallbackManager
- func NewManagerForChainRun(runID string, inheritableCallbacks, localCallbacks []schema.Callback, ...) schema.CallbackManagerForChainRun
- func NewManagerForModelRun(runID string, inheritableCallbacks, localCallbacks []schema.Callback, ...) schema.CallbackManagerForModelRun
- func NewManagerForRetrieverRun(runID string, inheritableCallbacks, localCallbacks []schema.Callback, ...) schema.CallbackManagerForRetrieverRun
- func NewManagerForToolRun(runID string, inheritableCallbacks, localCallbacks []schema.Callback, ...) schema.CallbackManagerForToolRun
- type ManagerOptions
- type NoopHandler
- func (h *NoopHandler) AlwaysVerbose() bool
- func (h *NoopHandler) OnAgentAction(ctx context.Context, input *schema.AgentActionInput) error
- func (h *NoopHandler) OnAgentFinish(ctx context.Context, input *schema.AgentFinishInput) error
- func (h *NoopHandler) OnChainEnd(ctx context.Context, input *schema.ChainEndInput) error
- func (h *NoopHandler) OnChainError(ctx context.Context, input *schema.ChainErrorInput) error
- func (h *NoopHandler) OnChainStart(ctx context.Context, input *schema.ChainStartInput) error
- func (h *NoopHandler) OnChatModelStart(ctx context.Context, input *schema.ChatModelStartInput) error
- func (h *NoopHandler) OnLLMStart(ctx context.Context, input *schema.LLMStartInput) error
- func (h *NoopHandler) OnModelEnd(ctx context.Context, input *schema.ModelEndInput) error
- func (h *NoopHandler) OnModelError(ctx context.Context, input *schema.ModelErrorInput) error
- func (h *NoopHandler) OnModelNewToken(ctx context.Context, input *schema.ModelNewTokenInput) error
- func (h *NoopHandler) OnRetrieverEnd(ctx context.Context, input *schema.RetrieverEndInput) error
- func (h *NoopHandler) OnRetrieverError(ctx context.Context, input *schema.RetrieverErrorInput) error
- func (h *NoopHandler) OnRetrieverStart(ctx context.Context, input *schema.RetrieverStartInput) error
- func (h *NoopHandler) OnText(ctx context.Context, input *schema.TextInput) error
- func (h *NoopHandler) OnToolEnd(ctx context.Context, input *schema.ToolEndInput) error
- func (h *NoopHandler) OnToolError(ctx context.Context, input *schema.ToolErrorInput) error
- func (h *NoopHandler) OnToolStart(ctx context.Context, input *schema.ToolStartInput) error
- func (h *NoopHandler) RaiseError() bool
- type NoopManager
- func (m *NoopManager) GetInheritableCallbacks() []schema.Callback
- func (m *NoopManager) OnAgentAction(ctx context.Context, input *schema.AgentActionManagerInput) error
- func (m *NoopManager) OnAgentFinish(ctx context.Context, input *schema.AgentFinishManagerInput) error
- func (m *NoopManager) OnChainEnd(ctx context.Context, input *schema.ChainEndManagerInput) error
- func (m *NoopManager) OnChainError(ctx context.Context, input *schema.ChainErrorManagerInput) error
- func (m *NoopManager) OnModelEnd(ctx context.Context, input *schema.ModelEndManagerInput) error
- func (m *NoopManager) OnModelError(ctx context.Context, input *schema.ModelErrorManagerInput) error
- func (m *NoopManager) OnModelNewToken(ctx context.Context, input *schema.ModelNewTokenManagerInput) error
- func (m *NoopManager) OnText(ctx context.Context, input *schema.TextManagerInput) error
- func (m *NoopManager) OnToolEnd(ctx context.Context, input *schema.ToolEndManagerInput) error
- func (m *NoopManager) OnToolError(ctx context.Context, input *schema.ToolErrorManagerInput) error
- func (m *NoopManager) RunID() string
- type OnPromptLayerOutputFunc
- type OpenAIHandler
- type PromptLayerHandler
- func (cb PromptLayerHandler) AlwaysVerbose() bool
- func (cb PromptLayerHandler) OnChatModelStart(ctx context.Context, input *schema.ChatModelStartInput) error
- func (cb PromptLayerHandler) OnLLMStart(ctx context.Context, input *schema.LLMStartInput) error
- func (cb PromptLayerHandler) OnModelEnd(ctx context.Context, input *schema.ModelEndInput) error
- type PromptLayerHandlerOptions
- type StreamWriterHandler
- type StreamWriterHandlerOptions
- type WriterHandler
- func (cb *WriterHandler) OnAgentAction(ctx context.Context, input *schema.AgentActionInput) error
- func (cb *WriterHandler) OnAgentFinish(ctx context.Context, input *schema.AgentFinishInput) error
- func (cb *WriterHandler) OnChainEnd(ctx context.Context, input *schema.ChainEndInput) error
- func (cb *WriterHandler) OnChainStart(ctx context.Context, input *schema.ChainStartInput) error
- func (cb *WriterHandler) OnText(ctx context.Context, input *schema.TextInput) error
- func (cb *WriterHandler) OnToolEnd(ctx context.Context, input *schema.ToolEndInput) error
- type WriterHandlerOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewManager ¶
func NewManager(inheritableCallbacks, localCallbacks []schema.Callback, verbose bool, optFns ...func(*ManagerOptions)) schema.CallbackManager
func NewManagerForChainRun ¶ added in v0.0.22
func NewManagerForChainRun(runID string, inheritableCallbacks, localCallbacks []schema.Callback, verbose bool, optFns ...func(*ManagerOptions)) schema.CallbackManagerForChainRun
func NewManagerForModelRun ¶ added in v0.0.26
func NewManagerForModelRun(runID string, inheritableCallbacks, localCallbacks []schema.Callback, verbose bool, optFns ...func(*ManagerOptions)) schema.CallbackManagerForModelRun
func NewManagerForRetrieverRun ¶ added in v0.0.52
func NewManagerForRetrieverRun(runID string, inheritableCallbacks, localCallbacks []schema.Callback, verbose bool, optFns ...func(*ManagerOptions)) schema.CallbackManagerForRetrieverRun
func NewManagerForToolRun ¶ added in v0.0.23
func NewManagerForToolRun(runID string, inheritableCallbacks, localCallbacks []schema.Callback, verbose bool, optFns ...func(*ManagerOptions)) schema.CallbackManagerForToolRun
Types ¶
type ManagerOptions ¶ added in v0.0.22
type ManagerOptions struct {
ParentRunID string
}
type NoopHandler ¶ added in v0.0.52
type NoopHandler struct{}
func (*NoopHandler) AlwaysVerbose ¶ added in v0.0.52
func (h *NoopHandler) AlwaysVerbose() bool
func (*NoopHandler) OnAgentAction ¶ added in v0.0.52
func (h *NoopHandler) OnAgentAction(ctx context.Context, input *schema.AgentActionInput) error
func (*NoopHandler) OnAgentFinish ¶ added in v0.0.52
func (h *NoopHandler) OnAgentFinish(ctx context.Context, input *schema.AgentFinishInput) error
func (*NoopHandler) OnChainEnd ¶ added in v0.0.52
func (h *NoopHandler) OnChainEnd(ctx context.Context, input *schema.ChainEndInput) error
func (*NoopHandler) OnChainError ¶ added in v0.0.52
func (h *NoopHandler) OnChainError(ctx context.Context, input *schema.ChainErrorInput) error
func (*NoopHandler) OnChainStart ¶ added in v0.0.52
func (h *NoopHandler) OnChainStart(ctx context.Context, input *schema.ChainStartInput) error
func (*NoopHandler) OnChatModelStart ¶ added in v0.0.52
func (h *NoopHandler) OnChatModelStart(ctx context.Context, input *schema.ChatModelStartInput) error
func (*NoopHandler) OnLLMStart ¶ added in v0.0.52
func (h *NoopHandler) OnLLMStart(ctx context.Context, input *schema.LLMStartInput) error
func (*NoopHandler) OnModelEnd ¶ added in v0.0.52
func (h *NoopHandler) OnModelEnd(ctx context.Context, input *schema.ModelEndInput) error
func (*NoopHandler) OnModelError ¶ added in v0.0.52
func (h *NoopHandler) OnModelError(ctx context.Context, input *schema.ModelErrorInput) error
func (*NoopHandler) OnModelNewToken ¶ added in v0.0.52
func (h *NoopHandler) OnModelNewToken(ctx context.Context, input *schema.ModelNewTokenInput) error
func (*NoopHandler) OnRetrieverEnd ¶ added in v0.0.52
func (h *NoopHandler) OnRetrieverEnd(ctx context.Context, input *schema.RetrieverEndInput) error
func (*NoopHandler) OnRetrieverError ¶ added in v0.0.52
func (h *NoopHandler) OnRetrieverError(ctx context.Context, input *schema.RetrieverErrorInput) error
func (*NoopHandler) OnRetrieverStart ¶ added in v0.0.52
func (h *NoopHandler) OnRetrieverStart(ctx context.Context, input *schema.RetrieverStartInput) error
func (*NoopHandler) OnToolEnd ¶ added in v0.0.52
func (h *NoopHandler) OnToolEnd(ctx context.Context, input *schema.ToolEndInput) error
func (*NoopHandler) OnToolError ¶ added in v0.0.52
func (h *NoopHandler) OnToolError(ctx context.Context, input *schema.ToolErrorInput) error
func (*NoopHandler) OnToolStart ¶ added in v0.0.52
func (h *NoopHandler) OnToolStart(ctx context.Context, input *schema.ToolStartInput) error
func (*NoopHandler) RaiseError ¶ added in v0.0.52
func (h *NoopHandler) RaiseError() bool
type NoopManager ¶ added in v0.0.28
type NoopManager struct{}
func (*NoopManager) GetInheritableCallbacks ¶ added in v0.0.28
func (m *NoopManager) GetInheritableCallbacks() []schema.Callback
func (*NoopManager) OnAgentAction ¶ added in v0.0.28
func (m *NoopManager) OnAgentAction(ctx context.Context, input *schema.AgentActionManagerInput) error
func (*NoopManager) OnAgentFinish ¶ added in v0.0.28
func (m *NoopManager) OnAgentFinish(ctx context.Context, input *schema.AgentFinishManagerInput) error
func (*NoopManager) OnChainEnd ¶ added in v0.0.28
func (m *NoopManager) OnChainEnd(ctx context.Context, input *schema.ChainEndManagerInput) error
func (*NoopManager) OnChainError ¶ added in v0.0.28
func (m *NoopManager) OnChainError(ctx context.Context, input *schema.ChainErrorManagerInput) error
func (*NoopManager) OnModelEnd ¶ added in v0.0.28
func (m *NoopManager) OnModelEnd(ctx context.Context, input *schema.ModelEndManagerInput) error
func (*NoopManager) OnModelError ¶ added in v0.0.28
func (m *NoopManager) OnModelError(ctx context.Context, input *schema.ModelErrorManagerInput) error
func (*NoopManager) OnModelNewToken ¶ added in v0.0.28
func (m *NoopManager) OnModelNewToken(ctx context.Context, input *schema.ModelNewTokenManagerInput) error
func (*NoopManager) OnText ¶ added in v0.0.28
func (m *NoopManager) OnText(ctx context.Context, input *schema.TextManagerInput) error
func (*NoopManager) OnToolEnd ¶ added in v0.0.28
func (m *NoopManager) OnToolEnd(ctx context.Context, input *schema.ToolEndManagerInput) error
func (*NoopManager) OnToolError ¶ added in v0.0.28
func (m *NoopManager) OnToolError(ctx context.Context, input *schema.ToolErrorManagerInput) error
func (*NoopManager) RunID ¶ added in v0.0.28
func (m *NoopManager) RunID() string
type OnPromptLayerOutputFunc ¶ added in v0.0.27
type OnPromptLayerOutputFunc func(output *promptlayer.TrackRequestOutput) error
type OpenAIHandler ¶ added in v0.0.5
type OpenAIHandler struct { NoopHandler // contains filtered or unexported fields }
func NewOpenAIHandler ¶ added in v0.0.7
func NewOpenAIHandler() *OpenAIHandler
func (*OpenAIHandler) AlwaysVerbose ¶ added in v0.0.5
func (cb *OpenAIHandler) AlwaysVerbose() bool
func (*OpenAIHandler) OnModelEnd ¶ added in v0.0.26
func (cb *OpenAIHandler) OnModelEnd(ctx context.Context, input *schema.ModelEndInput) error
func (*OpenAIHandler) String ¶ added in v0.0.5
func (cb *OpenAIHandler) String() string
type PromptLayerHandler ¶ added in v0.0.27
type PromptLayerHandler struct { NoopHandler // contains filtered or unexported fields }
func NewPromptLayerHandler ¶ added in v0.0.27
func NewPromptLayerHandler(apiKey string, optFns ...func(o *PromptLayerHandlerOptions)) *PromptLayerHandler
func (PromptLayerHandler) AlwaysVerbose ¶ added in v0.0.27
func (cb PromptLayerHandler) AlwaysVerbose() bool
func (PromptLayerHandler) OnChatModelStart ¶ added in v0.0.27
func (cb PromptLayerHandler) OnChatModelStart(ctx context.Context, input *schema.ChatModelStartInput) error
func (PromptLayerHandler) OnLLMStart ¶ added in v0.0.27
func (cb PromptLayerHandler) OnLLMStart(ctx context.Context, input *schema.LLMStartInput) error
func (PromptLayerHandler) OnModelEnd ¶ added in v0.0.27
func (cb PromptLayerHandler) OnModelEnd(ctx context.Context, input *schema.ModelEndInput) error
type PromptLayerHandlerOptions ¶ added in v0.0.27
type PromptLayerHandlerOptions struct { PromptID string OnPromptLayerOutputFunc OnPromptLayerOutputFunc Tags []string }
type StreamWriterHandler ¶ added in v0.0.52
type StreamWriterHandler struct { NoopHandler // contains filtered or unexported fields }
func NewStreamWriterHandler ¶ added in v0.0.52
func NewStreamWriterHandler(optFns ...func(o *StreamWriterHandlerOptions)) *StreamWriterHandler
func (*StreamWriterHandler) AlwaysVerbose ¶ added in v0.0.52
func (cb *StreamWriterHandler) AlwaysVerbose() bool
func (*StreamWriterHandler) OnModelNewToken ¶ added in v0.0.52
func (cb *StreamWriterHandler) OnModelNewToken(ctx context.Context, input *schema.ModelNewTokenInput) error
type StreamWriterHandlerOptions ¶ added in v0.0.52
type WriterHandler ¶ added in v0.0.52
type WriterHandler struct { NoopHandler // contains filtered or unexported fields }
func NewWriterHandler ¶ added in v0.0.52
func NewWriterHandler(optFns ...func(o *WriterHandlerOptions)) *WriterHandler
func (*WriterHandler) OnAgentAction ¶ added in v0.0.52
func (cb *WriterHandler) OnAgentAction(ctx context.Context, input *schema.AgentActionInput) error
func (*WriterHandler) OnAgentFinish ¶ added in v0.0.52
func (cb *WriterHandler) OnAgentFinish(ctx context.Context, input *schema.AgentFinishInput) error
func (*WriterHandler) OnChainEnd ¶ added in v0.0.52
func (cb *WriterHandler) OnChainEnd(ctx context.Context, input *schema.ChainEndInput) error
func (*WriterHandler) OnChainStart ¶ added in v0.0.52
func (cb *WriterHandler) OnChainStart(ctx context.Context, input *schema.ChainStartInput) error
func (*WriterHandler) OnToolEnd ¶ added in v0.0.52
func (cb *WriterHandler) OnToolEnd(ctx context.Context, input *schema.ToolEndInput) error
type WriterHandlerOptions ¶ added in v0.0.52
Click to show internal directories.
Click to hide internal directories.