/**
 * @author: dn-jinmin/dn-jinmin
 * @doc:
 */

package memoryx

import "github.com/tmc/langchaingo/callbacks"

type Options struct {
	outParser
	callback callbacks.Handler
}

type Option func(options *Options)

func newOption(opts ...Option) *Options {
	opt := &Options{
		callback:  nil,
		outParser: nil,
	}

	for _, o := range opts {
		o(opt)
	}
	return opt
}

func WithCallback(handler callbacks.Handler) Option {
	return func(options *Options) {
		options.callback = handler
	}
}

func WithOutParser(outParser outParser) Option {
	return func(options *Options) {
		options.outParser = outParser
	}
}
