Documentation ¶
Overview ¶
Package golc provides functions for executing chains.
Index ¶
- Variables
- func BatchCall(ctx context.Context, chain schema.Chain, inputs []schema.ChainValues, ...) ([]schema.ChainValues, error)
- func Call(ctx context.Context, chain schema.Chain, inputs schema.ChainValues, ...) (schema.ChainValues, error)
- func SimpleCall(ctx context.Context, chain schema.Chain, input any, ...) (string, error)
- type BatchCallOptions
- type CallOptions
- type SimpleCallOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Verbose controls the verbosity of the chain execution. Verbose = false // ErrMultipleInputs is returned when calling a chain with more than one expected input is not supported. ErrMultipleInputs = errors.New("chain with more than one expected input") // ErrMultipleOutputs is returned when calling a chain with more than one expected output is not supported. ErrMultipleOutputs = errors.New("chain with more than one expected output") // ErrMultipleOutputs is returned when calling a chain with more than one expected output is not supported. ErrWrongOutputType = errors.New("chain with non string return type") )
Functions ¶
func BatchCall ¶ added in v0.0.14
func BatchCall(ctx context.Context, chain schema.Chain, inputs []schema.ChainValues, optFns ...func(*BatchCallOptions)) ([]schema.ChainValues, error)
BatchCall executes multiple calls to the chain.Call function concurrently and collects the results in the same order as the inputs. It utilizes the errgroup package to manage the concurrent execution and handle any errors that may occur.
func Call ¶ added in v0.0.14
func Call(ctx context.Context, chain schema.Chain, inputs schema.ChainValues, optFns ...func(*CallOptions)) (schema.ChainValues, error)
Call executes a chain with multiple inputs. It returns the outputs of the chain or an error, if any.
func SimpleCall ¶ added in v0.0.14
func SimpleCall(ctx context.Context, chain schema.Chain, input any, optFns ...func(*SimpleCallOptions)) (string, error)
SimpleCall executes a chain with a single input and a single output. It returns the output value as a string or an error, if any.
Types ¶
type BatchCallOptions ¶ added in v0.0.22
type CallOptions ¶ added in v0.0.22
type SimpleCallOptions ¶ added in v0.0.22
Directories ¶
Path | Synopsis |
---|---|
_examples
|
|
Package embedding contains the implementation to create vector embeddings from text using different APIs
|
Package embedding contains the implementation to create vector embeddings from text using different APIs |
Packet memory contains implementations for managing conversation data
|
Packet memory contains implementations for managing conversation data |
Click to show internal directories.
Click to hide internal directories.