Class: Cadenya::Models::WidgetSessionSpec

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/cadenya/models/widget_session_spec.rb,
sig/cadenya/models/widget_session_spec.rbs

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(widget_id:, token: nil, expires_at: nil, pinned_parameters: nil, subject: nil, tenant: nil, token_expires_at: nil) ⇒ Object

Some parameter documentations has been truncated, see Cadenya::Models::WidgetSessionSpec for more details.

WidgetSessionSpec is the configuration of a session, fixed at mint.

Parameters:

  • widget_id (String)

    Widget this session is minted against. Accepts the canonical wgt_… form

  • token (String) (defaults to: nil)

    The session bearer token. Returned only on creation — subsequent reads

  • expires_at (Time) (defaults to: nil)

    Hard session expiry. Tokens never outlive it; after it passes the session

  • pinned_parameters (Hash{Symbol=>String}) (defaults to: nil)

    Parameters forced onto tool calls made by this session's conversations.

  • subject (Cadenya::Models::SubjectAssertion) (defaults to: nil)

    SubjectAssertion identifies a person within a tenant in the customer's own

  • tenant (Cadenya::Models::TenantAssertion) (defaults to: nil)

    TenantAssertion identifies a tenant in the customer's own namespace — their

  • token_expires_at (Time) (defaults to: nil)

    Expiry of the token returned in token. Distinct from expires_at,



# File 'lib/cadenya/models/widget_session_spec.rb', line 68

Instance Attribute Details

#expires_atTime?

Hard session expiry. Tokens never outlive it; after it passes the session transitions to STATE_EXPIRED. Defaults to a server-chosen horizon when unset.

Parameters:

  • (Time)

Returns:

  • (Time, nil)


18
# File 'lib/cadenya/models/widget_session_spec.rb', line 18

optional :expires_at, Time, api_name: :expiresAt

#pinned_parametersHash{Symbol=>String}?

Parameters forced onto tool calls made by this session's conversations. A pinned parameter is an overlay on a tool's JSON schema: the parameter is removed from what the LLM sees, and its value is always overwritten server-side with the pinned value — so the model cannot be tricked into calling a tool with a different id than the one the session was minted for (e.g. pin "workspaceId" for an OpenAPI tool with a /workspaces/workspaceId path). Flows to every objective the session creates.

Parameters:

  • (::Hash[Symbol, String])

Returns:

  • (Hash{Symbol=>String}, nil)


30
# File 'lib/cadenya/models/widget_session_spec.rb', line 30

optional :pinned_parameters, Cadenya::Internal::Type::HashOf[String], api_name: :pinnedParameters

#subjectCadenya::Models::SubjectAssertion?

SubjectAssertion identifies a person within a tenant in the customer's own namespace — typically their user id. Asserting a subject upserts the subject record under the asserted tenant and associates the created resource with it. A subject assertion is only valid alongside a tenant assertion: subject identifiers are scoped to their tenant.



40
# File 'lib/cadenya/models/widget_session_spec.rb', line 40

optional :subject, -> { Cadenya::SubjectAssertion }

#tenantCadenya::Models::TenantAssertion?

TenantAssertion identifies a tenant in the customer's own namespace — their org, company, or team identifier for an end user. Asserting a tenant upserts the tenant record in the workspace (keyed on id as the tenant's external_id) and associates the created resource with it.



49
# File 'lib/cadenya/models/widget_session_spec.rb', line 49

optional :tenant, -> { Cadenya::TenantAssertion }

#tokenString? (readonly)

Returns the value of attribute token.

Returns:

  • (String, nil)


33
34
35
# File 'sig/cadenya/models/widget_session_spec.rbs', line 33

def token
  @token
end

#token_expires_atTime? (readonly)

Returns the value of attribute token_expires_at.

Returns:

  • (Time, nil)


37
38
39
# File 'sig/cadenya/models/widget_session_spec.rbs', line 37

def token_expires_at
  @token_expires_at
end

#widget_idString

Widget this session is minted against. Accepts the canonical wgt_… form or the external_id:<value> form.

Parameters:

  • value (String)

Returns:

  • (String)


11
# File 'lib/cadenya/models/widget_session_spec.rb', line 11

required :widget_id, String, api_name: :widgetId

Instance Method Details

#to_hash{

Returns:

  • ({)


51
# File 'sig/cadenya/models/widget_session_spec.rbs', line 51

def to_hash: -> {

#token=String (readonly)

Parameters:

  • (String)

Returns:

  • (String)


35
# File 'sig/cadenya/models/widget_session_spec.rbs', line 35

def token=: (String) -> String

#token_expires_at=Time (readonly)

Parameters:

  • (Time)

Returns:

  • (Time)


39
# File 'sig/cadenya/models/widget_session_spec.rbs', line 39

def token_expires_at=: (Time) -> Time