Class: Prescient::Agent::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/prescient/agent/configuration.rb

Overview

Runtime policies and safety limits for one agent execution.

Constant Summary collapse

DEFAULT_MAX_LOOPS =

Returns Default maximum loop count.

Returns:

  • (Integer)

    Default maximum loop count

5
DEFAULT_MAX_CONTEXT_BYTES =

Returns Default context size limit.

Returns:

  • (Integer)

    Default context size limit

64_000
DEFAULT_MAX_ACTION_BYTES =

Returns Default action size limit.

Returns:

  • (Integer)

    Default action size limit

8_192
DEFAULT_MAX_OBSERVATION_BYTES =

Returns Default observation size limit.

Returns:

  • (Integer)

    Default observation size limit

16_384
DEFAULT_MAX_TASK_BYTES =

Returns Default task size limit.

Returns:

  • (Integer)

    Default task size limit

8_192
DEFAULT_MAX_RESPONSE_BYTES =

Returns Default generated response size limit.

Returns:

  • (Integer)

    Default generated response size limit

32_768

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(max_loops: DEFAULT_MAX_LOOPS, max_context_bytes: DEFAULT_MAX_CONTEXT_BYTES, max_action_bytes: DEFAULT_MAX_ACTION_BYTES, max_observation_bytes: DEFAULT_MAX_OBSERVATION_BYTES, max_task_bytes: DEFAULT_MAX_TASK_BYTES, max_response_bytes: DEFAULT_MAX_RESPONSE_BYTES, authorization: nil, telemetry: nil) ⇒ Configuration

Returns a new instance of Configuration.

Parameters:

  • authorization (#call, nil) (defaults to: nil)

    Host policy receiving tool, arguments, and request-scoped context. Only exactly true permits a tool call.

  • telemetry (#call, nil) (defaults to: nil)

    Bounded event sink for execution metadata.



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/prescient/agent/configuration.rb', line 26

def initialize(max_loops: DEFAULT_MAX_LOOPS, max_context_bytes: DEFAULT_MAX_CONTEXT_BYTES,
               max_action_bytes: DEFAULT_MAX_ACTION_BYTES,
               max_observation_bytes: DEFAULT_MAX_OBSERVATION_BYTES,
               max_task_bytes: DEFAULT_MAX_TASK_BYTES,
               max_response_bytes: DEFAULT_MAX_RESPONSE_BYTES,
               authorization: nil, telemetry: nil)
  @max_loops = positive_integer(max_loops, "max_loops")
  @max_context_bytes = positive_integer(max_context_bytes, "max_context_bytes")
  @max_action_bytes = positive_integer(max_action_bytes, "max_action_bytes")
  @max_observation_bytes = positive_integer(max_observation_bytes, "max_observation_bytes")
  @max_task_bytes = positive_integer(max_task_bytes, "max_task_bytes")
  @max_response_bytes = positive_integer(max_response_bytes, "max_response_bytes")
  @authorization = callable_or_nil(authorization, "authorization")
  @telemetry = callable_or_nil(telemetry, "telemetry")
end

Instance Attribute Details

#authorizationObject (readonly)

Returns the value of attribute authorization.



20
21
22
# File 'lib/prescient/agent/configuration.rb', line 20

def authorization
  @authorization
end

#max_action_bytesObject (readonly)

Returns the value of attribute max_action_bytes.



20
21
22
# File 'lib/prescient/agent/configuration.rb', line 20

def max_action_bytes
  @max_action_bytes
end

#max_context_bytesObject (readonly)

Returns the value of attribute max_context_bytes.



20
21
22
# File 'lib/prescient/agent/configuration.rb', line 20

def max_context_bytes
  @max_context_bytes
end

#max_loopsObject (readonly)

Returns the value of attribute max_loops.



20
21
22
# File 'lib/prescient/agent/configuration.rb', line 20

def max_loops
  @max_loops
end

#max_observation_bytesObject (readonly)

Returns the value of attribute max_observation_bytes.



20
21
22
# File 'lib/prescient/agent/configuration.rb', line 20

def max_observation_bytes
  @max_observation_bytes
end

#max_response_bytesObject (readonly)

Returns the value of attribute max_response_bytes.



20
21
22
# File 'lib/prescient/agent/configuration.rb', line 20

def max_response_bytes
  @max_response_bytes
end

#max_task_bytesObject (readonly)

Returns the value of attribute max_task_bytes.



20
21
22
# File 'lib/prescient/agent/configuration.rb', line 20

def max_task_bytes
  @max_task_bytes
end

#telemetryObject (readonly)

Returns the value of attribute telemetry.



20
21
22
# File 'lib/prescient/agent/configuration.rb', line 20

def telemetry
  @telemetry
end