Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultParseCommandSystemPromptTemplate = `` /* 1475-byte string literal not displayed */
DefaultParseCommandSystemPromptTemplate is the default system prompt template used by ToolBasedCommandParser. The template may contain a single "%s" placeholder for the tool name.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FailbackCommandParser ¶
type FailbackCommandParser[T any] struct { // contains filtered or unexported fields }
func NewFailbackCommandParser ¶
func NewFailbackCommandParser[T any](parsers ...Parser[T]) *FailbackCommandParser[T]
func (*FailbackCommandParser[T]) ParseCommand ¶
func (p *FailbackCommandParser[T]) ParseCommand(ctx context.Context, req *types.ToolRequest[T]) (Command, error)
type LocalCommandParser ¶
func NewLocalCommandParser ¶
func NewLocalCommandParser[T any]() *LocalCommandParser[T]
func (*LocalCommandParser[T]) ParseCommand ¶
func (p *LocalCommandParser[T]) ParseCommand(ctx context.Context, req *types.ToolRequest[T]) (Command, error)
type ParserOption ¶ added in v0.0.2
type ParserOption func(*commandParserOptions)
func WithCommandSystemPrompt ¶ added in v0.0.2
func WithCommandSystemPrompt(systemPrompt string) ParserOption
WithCommandSystemPrompt overrides the system prompt used by ToolBasedCommandParser.
func WithCommandSystemPromptTemplate ¶ added in v0.0.2
func WithCommandSystemPromptTemplate(systemPromptTemplate string) ParserOption
WithCommandSystemPromptTemplate overrides the system prompt template used by ToolBasedCommandParser. If the template contains "%s", it will be formatted with the tool name.
type ToolBasedCommandParser ¶
type ToolBasedCommandParser[T any] struct { // contains filtered or unexported fields }
func NewToolBasedCommandParser ¶
func NewToolBasedCommandParser[T any](chatModel model.ToolCallingChatModel, opts ...ParserOption) (*ToolBasedCommandParser[T], error)
func (*ToolBasedCommandParser[T]) ParseCommand ¶
func (p *ToolBasedCommandParser[T]) ParseCommand(ctx context.Context, req *types.ToolRequest[T]) (Command, error)
Click to show internal directories.
Click to hide internal directories.