AgentBlueprintProtocol.BoundsAlgebra.BoundSet (Agent Blueprint Protocol v1.1.0)

Copy Markdown View Source

This struct represents a set of named bounds.

Use it when constructing or inspecting bound sources for intersection.

This module does not authorize operations.

Example

AgentBlueprintProtocol.BoundsAlgebra.BoundSet.new(%{max_tokens: 1000})

Summary

Types

t()

The public data type for AgentBlueprintProtocol.BoundsAlgebra.BoundSet.

Functions

Returns the names of the supported bounds.

Builds and validates a value from the supplied options.

Returns the raw values stored in a bound set.

Types

t()

(since 1.0.0)
@type t() :: %AgentBlueprintProtocol.BoundsAlgebra.BoundSet{
  bounds: %{optional(atom()) => AgentBlueprintProtocol.BoundsAlgebra.Bound.t()}
}

The public data type for AgentBlueprintProtocol.BoundsAlgebra.BoundSet.

Functions

names()

(since 1.0.0)
@spec names() :: [atom()]

Returns the names of the supported bounds.

Example

AgentBlueprintProtocol.BoundsAlgebra.BoundSet.names()

new(map)

(since 1.0.0)
@spec new(%{optional(atom()) => term()}) ::
  {:ok, t()} | {:error, AgentBlueprintProtocol.Error.t()}

Builds and validates a value from the supplied options.

Example

AgentBlueprintProtocol.BoundsAlgebra.BoundSet.new(%{max_tokens: 1000})

to_map(arg1)

(since 1.0.0)
@spec to_map(t()) ::
  {:ok, %{optional(atom()) => term()}}
  | {:error, AgentBlueprintProtocol.Error.t()}

Returns the raw values stored in a bound set.

Example

{:ok, bounds} =
  AgentBlueprintProtocol.BoundsAlgebra.BoundSet.new(%{max_tokens: 1000})

AgentBlueprintProtocol.BoundsAlgebra.BoundSet.to_map(bounds)