serverless

package
v1.18.13 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package serverless provides the server serverless function context.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

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

Context sfn handler context

func NewContext

func NewContext(writer frame.Writer, tag uint32, md metadata.M, data []byte) *Context

NewContext creates a new serverless Context

func (*Context) Data

func (c *Context) Data() []byte

Data returns the data of the data frame

func (*Context) HTTP added in v1.13.1

func (c *Context) HTTP() serverless.HTTP

HTTP is the interface of Context for HTTP request, but it is not implemented in the server side

func (*Context) LLMFunctionCall added in v1.18.10

func (c *Context) LLMFunctionCall() (*ai.FunctionCall, error)

LLMFunctionCall reads LLM function call

func (*Context) Metadata added in v1.18.5

func (c *Context) Metadata(key string) (string, bool)

Metadata returns the metadata of the data frame

func (*Context) ReadLLMArguments added in v1.18.9

func (c *Context) ReadLLMArguments(args any) error

ReadLLMArguments reads LLM function arguments

func (*Context) Tag

func (c *Context) Tag() uint32

Tag returns the tag of the data frame

func (*Context) Write

func (c *Context) Write(tag uint32, data []byte) error

Write writes the data

func (*Context) WriteLLMResult added in v1.18.9

func (c *Context) WriteLLMResult(result string) error

WriteLLMResult writes LLM function result

func (*Context) WriteWithTarget added in v1.17.4

func (c *Context) WriteWithTarget(tag uint32, data []byte, target string) error

type CronContext added in v1.17.5

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

CronContext sfn cron handler context

func NewCronContext added in v1.17.5

func NewCronContext(writer frame.Writer, md metadata.M) *CronContext

NewCronContext creates a new serverless CronContext

func (*CronContext) HTTP added in v1.17.5

func (c *CronContext) HTTP() serverless.HTTP

HTTP is the interface of CronContext for HTTP request, but it is not implemented in the server side

func (*CronContext) Write added in v1.17.5

func (c *CronContext) Write(tag uint32, data []byte) error

Write writes the data to next sfn instance.

func (*CronContext) WriteWithTarget added in v1.17.5

func (c *CronContext) WriteWithTarget(tag uint32, data []byte, target string) error

WriteWithTarget writes the data to next sfn instance with specified target.

Jump to

Keyboard shortcuts

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