Documentation
¶
Index ¶
- Constants
- func IsSupportedRuntime(runtime string) bool
- func TokenV1(enc *encryption.Client, req TokenRequestV1) (string, error)
- type CallToolPayload
- type Deployer
- type FlyRunner
- func (f *FlyRunner) Deploy(ctx context.Context, req RunnerDeployRequest) (res *RunnerDeployResult, err error)
- func (f *FlyRunner) ReadResource(ctx context.Context, req RunnerResourceReadRequest) (httpreq *http.Request, err error)
- func (f *FlyRunner) ToolCall(ctx context.Context, req RunnerToolCallRequest) (httpreq *http.Request, err error)
- type FlyRunnerOptions
- type ImageRequest
- type ImageSelector
- type LocalRunner
- func (l *LocalRunner) Deploy(ctx context.Context, req RunnerDeployRequest) (*RunnerDeployResult, error)
- func (l *LocalRunner) ReadResource(ctx context.Context, readReq RunnerResourceReadRequest) (*http.Request, error)
- func (l *LocalRunner) ToolCall(ctx context.Context, call RunnerToolCallRequest) (*http.Request, error)
- type Manifest
- type ManifestResourceV0
- type ManifestToolV0
- type ManifestV0
- type ManifestVariableAttributeV0
- type Orchestrator
- type ProcessError
- type ReadResourcePayload
- type RunnerAsset
- type RunnerBaseRequest
- type RunnerDeployRequest
- type RunnerDeployResult
- type RunnerDestroyRequest
- type RunnerImageRequest
- type RunnerResourceReadRequest
- type RunnerToolCallRequest
- type RunnerVersion
- type Runtime
- type Runtimes
- type TemplateImageSelector
- type TokenRequestV1
- type ToolCaller
- type ToolExtractor
- type ToolExtractorResult
- type ToolExtractorTask
Constants ¶
View Source
const FunctionsCPUHeader = "X-Gram-Functions-Cpu"
View Source
const FunctionsExecutionTimeHeader = "X-Gram-Functions-Execution-Time"
View Source
const FunctionsMemoryHeader = "X-Gram-Functions-Memory"
Variables ¶
This section is empty.
Functions ¶
func IsSupportedRuntime ¶
func TokenV1 ¶
func TokenV1(enc *encryption.Client, req TokenRequestV1) (string, error)
Types ¶
type CallToolPayload ¶
type CallToolPayload struct {
ToolName string `json:"name"`
Input json.RawMessage `json:"input"`
Environment map[string]string `json:"environment,omitempty,omitzero"`
}
type Deployer ¶
type Deployer interface {
Deploy(context.Context, RunnerDeployRequest) (*RunnerDeployResult, error)
}
type FlyRunner ¶
type FlyRunner struct {
// contains filtered or unexported fields
}
func NewFlyRunner ¶
func NewFlyRunner( logger *slog.Logger, tracerProvider trace.TracerProvider, db *pgxpool.Pool, assetStorage assets.BlobStore, imageSelector ImageSelector, encryption *encryption.Client, o FlyRunnerOptions, ) *FlyRunner
func (*FlyRunner) Deploy ¶
func (f *FlyRunner) Deploy(ctx context.Context, req RunnerDeployRequest) (res *RunnerDeployResult, err error)
func (*FlyRunner) ReadResource ¶
type FlyRunnerOptions ¶
type ImageRequest ¶
type ImageSelector ¶
type ImageSelector interface {
Select(ctx context.Context, req ImageRequest) (string, error)
}
type LocalRunner ¶
type LocalRunner struct {
// contains filtered or unexported fields
}
func NewLocalRunner ¶
func NewLocalRunner(codeRoot *os.Root) *LocalRunner
func (*LocalRunner) Deploy ¶
func (l *LocalRunner) Deploy(ctx context.Context, req RunnerDeployRequest) (*RunnerDeployResult, error)
func (*LocalRunner) ReadResource ¶
func (l *LocalRunner) ReadResource(ctx context.Context, readReq RunnerResourceReadRequest) (*http.Request, error)
func (*LocalRunner) ToolCall ¶
func (l *LocalRunner) ToolCall(ctx context.Context, call RunnerToolCallRequest) (*http.Request, error)
type Manifest ¶
type Manifest struct {
Version string
V0 *ManifestV0
}
func (*Manifest) UnmarshalJSON ¶
type ManifestResourceV0 ¶
type ManifestResourceV0 struct {
Name string `json:"name"`
URI string `json:"uri"`
Description string `json:"description"`
MimeType *string `json:"mimeType,omitempty"`
Title *string `json:"title,omitempty"`
Variables map[string]*ManifestVariableAttributeV0 `json:"variables"`
Meta map[string]string `json:"meta"`
}
type ManifestToolV0 ¶
type ManifestToolV0 struct {
Name string `json:"name"`
Description string `json:"description"`
InputSchema json.RawMessage `json:"inputSchema"`
Variables map[string]*ManifestVariableAttributeV0 `json:"variables"`
Meta map[string]string `json:"meta"`
}
type ManifestV0 ¶
type ManifestV0 struct {
Version string `json:"version"`
Tools []ManifestToolV0 `json:"tools"`
Resources []ManifestResourceV0 `json:"resources"`
}
type ManifestVariableAttributeV0 ¶
type ManifestVariableAttributeV0 struct {
Description *string `json:"description"`
}
type Orchestrator ¶
type Orchestrator interface {
Deployer
ToolCaller
}
type ProcessError ¶
type ProcessError struct {
// contains filtered or unexported fields
}
func (*ProcessError) Error ¶
func (e *ProcessError) Error() string
func (*ProcessError) Reason ¶
func (e *ProcessError) Reason() string
func (*ProcessError) Unwrap ¶
func (e *ProcessError) Unwrap() error
type ReadResourcePayload ¶
type ReadResourcePayload struct {
URI string `json:"uri"`
Input json.RawMessage `json:"input"`
Environment map[string]string `json:"environment,omitempty,omitzero"`
}
type RunnerAsset ¶
type RunnerBaseRequest ¶
type RunnerDeployRequest ¶
type RunnerDeployResult ¶
type RunnerDeployResult struct {
URN urn.FunctionRunner
PublicURL *url.URL
Version RunnerVersion
Provider string
Region string
Scale int
}
type RunnerDestroyRequest ¶
type RunnerImageRequest ¶
type RunnerResourceReadRequest ¶
type RunnerResourceReadRequest struct {
RunnerBaseRequest
ResourceURN urn.Resource
ResourceURI string
ResourceName string
}
type RunnerToolCallRequest ¶
type RunnerToolCallRequest struct {
RunnerBaseRequest
ToolURN urn.Tool
ToolName string
}
type RunnerVersion ¶
type RunnerVersion string
type Runtimes ¶
type Runtimes map[Runtime]struct{}
func SupportedRuntimes ¶
func SupportedRuntimes() Runtimes
type TemplateImageSelector ¶
type TemplateImageSelector struct {
// contains filtered or unexported fields
}
func NewTemplateImageSelector ¶
func NewTemplateImageSelector(tpl string) (*TemplateImageSelector, error)
func (*TemplateImageSelector) Select ¶
func (s *TemplateImageSelector) Select(ctx context.Context, req ImageRequest) (string, error)
type TokenRequestV1 ¶
type ToolCaller ¶
type ToolExtractor ¶
type ToolExtractor struct {
// contains filtered or unexported fields
}
func NewToolExtractor ¶
func (*ToolExtractor) Do ¶
func (p *ToolExtractor) Do( ctx context.Context, task ToolExtractorTask, ) (*ToolExtractorResult, error)
type ToolExtractorResult ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.