agent

package
v1.54.2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 9 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const JobTokenValidFor = 10 * time.Minute

JobTokenValidFor is the lifetime of a token a job asks for with CreateJobTokenRequest.

View Source
const MaxDeploymentLength = 64

Variables

View Source
var ErrClaimNotAllowed = errors.New("claim not allowed")

Functions

func BuildAgentToken

func BuildAgentToken(
	apiKey, secret, roomName, participantIdentity, participantName, participantMetadata string,
	participantAttributes map[string]string,
	permissions *livekit.ParticipantPermission,
	kindDetails ...livekit.ParticipantInfo_KindDetail,
) (string, error)

func BuildJobToken added in v1.54.0

func BuildJobToken(apiKey, secret string, grants *auth.ClaimGrants) (token string, expiresAt time.Time, err error)

BuildJobToken signs a token that carries grants and is valid for JobTokenValidFor. The token holds only the grants given; the issuer and the times are set here. expiresAt is at most a second before the token's exp. Grants with a claim a job token never carries are refused here too, whatever produced them.

func ParseJobTokenClaims added in v1.54.0

func ParseJobTokenClaims(claims string) (*auth.ClaimGrants, error)

ParseJobTokenClaims reads the claims of CreateJobTokenRequest into typed grants. A field the grants do not know is dropped, so a client that sends a newer claim still gets a token, without that claim. Anything after the JSON object, or a claim a job token never carries, is an error.

func ValidateDeployment added in v1.45.8

func ValidateDeployment(deployment string) error

func ValidateThreadID added in v1.54.0

func ValidateThreadID(threadID string) error

ValidateThreadID accepts an empty thread id (the call keeps no durable thread) or an agent thread id as guid.New(guid.AgentThreadPrefix) mints it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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