invoke

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateProjectFromProject added in v0.7.0

func CreateProjectFromProject(ctx context.Context, c kclient.WithWatch, projectThread *v1.Thread, threadName, userUID string) (*v1.Thread, error)

Types

type ErrToolResult

type ErrToolResult struct {
	Message string
}

func (ErrToolResult) Error

func (e ErrToolResult) Error() string

type Invoker

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

func NewInvoker

func NewInvoker(c kclient.WithWatch, gptClient *gptscript.GPTScript, gatewayClient *client.Client, mcpSessionManager *mcp.SessionManager, serverURL string, serverPort int, tokenService *ephemeral.TokenService, events *events.Emitter) *Invoker

func (*Invoker) Agent

func (i *Invoker) Agent(ctx context.Context, c kclient.WithWatch, agent *v1.Agent, input string, opt Options) (*Response, error)

func (*Invoker) EphemeralThreadTask added in v0.5.0

func (i *Invoker) EphemeralThreadTask(ctx context.Context, thread *v1.Thread, tool, input any, opts ...SystemTaskOptions) (string, error)

func (*Invoker) Resume

func (i *Invoker) Resume(ctx context.Context, c kclient.WithWatch, thread *v1.Thread, run *v1.Run) (err error)

func (*Invoker) Step

func (i *Invoker) Step(ctx context.Context, c kclient.WithWatch, step *v1.WorkflowStep, opt StepOptions) (*Response, error)

func (*Invoker) SystemTask

func (i *Invoker) SystemTask(ctx context.Context, thread *v1.Thread, tool, input any, opts ...SystemTaskOptions) (*Response, error)

func (*Invoker) Thread added in v0.7.0

func (i *Invoker) Thread(ctx context.Context, c kclient.WithWatch, thread *v1.Thread, input string, opt Options) (*Response, error)

func (*Invoker) Workflow

func (i *Invoker) Workflow(ctx context.Context, c kclient.WithWatch, wf *v1.Workflow, input string, opt WorkflowOptions) (*Response, error)

type Options

type Options struct {
	Synchronous           bool
	EphemeralThread       bool
	Thread                *v1.Thread
	ThreadName            string
	ParentThreadName      string
	WorkflowName          string
	WorkflowStepName      string
	WorkflowStepID        string
	WorkflowExecutionName string
	PreviousRunName       string
	ForceNoResume         bool
	CreateThread          bool
	CredentialContextIDs  []string
	UserUID               string
	UserIsAdmin           bool
	IgnoreMCPErrors       bool
	GenerateName          string
	ExtraEnv              []string
}

type Response

type Response struct {
	Run               *v1.Run
	Thread            *v1.Thread
	WorkflowExecution *v1.WorkflowExecution
	Events            <-chan types.Progress
	Message           string
	// contains filtered or unexported fields
}

func (*Response) Close

func (r *Response) Close()

func (*Response) Result

func (r *Response) Result(ctx context.Context) (TaskResult, error)

type StepOptions

type StepOptions struct {
	PreviousRunName string
}

type SystemTaskOptions

type SystemTaskOptions struct {
	CredentialContextIDs []string
	Env                  []string
	Timeout              time.Duration
}

type TaskResult

type TaskResult struct {
	// Task output
	Output string
}

type WorkflowOptions

type WorkflowOptions struct {
	StepID                string
	WorkflowExecutionName string
}

Jump to

Keyboard shortcuts

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