Documentation
¶
Index ¶
- Constants
- func Bool(value bool) param.Field[bool]
- func DefaultClientOptions() []option.RequestOption
- func F[T any](value T) param.Field[T]
- func FileParam(reader io.Reader, filename string, contentType string) param.Field[io.Reader]
- func Float(value float64) param.Field[float64]
- func Int(value int64) param.Field[int64]
- func Null[T any]() param.Field[T]
- func Raw[T any](value any) param.Field[T]
- func String(value string) param.Field[string]
- type APIKey
- type APIKeyInfo
- type APIKeyListParams
- type APIKeyNewParams
- type APIKeyService
- func (r *APIKeyService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (err error)
- func (r *APIKeyService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *APIKey, err error)
- func (r *APIKeyService) List(ctx context.Context, query APIKeyListParams, opts ...option.RequestOption) (res *pagination.CursorPagination[APIKey], err error)
- func (r *APIKeyService) ListAutoPaging(ctx context.Context, query APIKeyListParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[APIKey]
- func (r *APIKeyService) New(ctx context.Context, body APIKeyNewParams, opts ...option.RequestOption) (res *APIKey, err error)
- func (r *APIKeyService) Rotate(ctx context.Context, id string, opts ...option.RequestOption) (res *APIKey, err error)
- func (r *APIKeyService) Update(ctx context.Context, id string, body APIKeyUpdateParams, ...) (res *APIKey, err error)
- type APIKeySpec
- type APIKeySpecParam
- type APIKeyUpdateParams
- type Account
- type AccountResourceMetadata
- type AccountResourceMetadataParam
- type AccountService
- type AccountSpec
- type Agent
- type AgentInfo
- type AgentInfoParam
- type AgentListParams
- type AgentNewParams
- type AgentNewParamsDefaultVariation
- type AgentParam
- type AgentService
- func (r *AgentService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (err error)
- func (r *AgentService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Agent, err error)
- func (r *AgentService) List(ctx context.Context, query AgentListParams, opts ...option.RequestOption) (res *pagination.CursorPagination[Agent], err error)
- func (r *AgentService) ListAutoPaging(ctx context.Context, query AgentListParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[Agent]
- func (r *AgentService) New(ctx context.Context, body AgentNewParams, opts ...option.RequestOption) (res *Agent, err error)
- func (r *AgentService) Update(ctx context.Context, id string, body AgentUpdateParams, ...) (res *Agent, err error)
- type AgentSpec
- type AgentSpecParam
- type AgentSpecStatus
- type AgentSpecVariationSelectionMode
- type AgentUpdateParams
- type AgentVariation
- type AgentVariationInfo
- type AgentVariationInfoParam
- type AgentVariationListParams
- type AgentVariationNewParams
- type AgentVariationParam
- type AgentVariationService
- func (r *AgentVariationService) Delete(ctx context.Context, agentID string, id string, opts ...option.RequestOption) (err error)
- func (r *AgentVariationService) Get(ctx context.Context, agentID string, id string, opts ...option.RequestOption) (res *AgentVariation, err error)
- func (r *AgentVariationService) List(ctx context.Context, agentID string, query AgentVariationListParams, ...) (res *pagination.CursorPagination[AgentVariation], err error)
- func (r *AgentVariationService) ListAutoPaging(ctx context.Context, agentID string, query AgentVariationListParams, ...) *pagination.CursorPaginationAutoPager[AgentVariation]
- func (r *AgentVariationService) New(ctx context.Context, agentID string, body AgentVariationNewParams, ...) (res *AgentVariation, err error)
- func (r *AgentVariationService) Update(ctx context.Context, agentID string, id string, ...) (res *AgentVariation, err error)
- type AgentVariationSpec
- type AgentVariationSpecAgentDocument
- type AgentVariationSpecAgentDocumentParam
- type AgentVariationSpecAgentTool
- type AgentVariationSpecAgentToolParam
- type AgentVariationSpecConstraints
- type AgentVariationSpecConstraintsParam
- type AgentVariationSpecModelConfig
- type AgentVariationSpecModelConfigParam
- type AgentVariationSpecParam
- type AgentVariationSpecToolSelection
- type AgentVariationSpecToolSelectionParam
- type AgentVariationUpdateParams
- type AgentWebhookDeliveryListParams
- type AgentWebhookDeliveryListParamsEventType
- type AgentWebhookDeliveryService
- func (r *AgentWebhookDeliveryService) List(ctx context.Context, agentID string, query AgentWebhookDeliveryListParams, ...) (res *pagination.CursorPagination[WebhookDelivery], err error)
- func (r *AgentWebhookDeliveryService) ListAutoPaging(ctx context.Context, agentID string, query AgentWebhookDeliveryListParams, ...) *pagination.CursorPaginationAutoPager[WebhookDelivery]
- type AssistantMessage
- type AssistantToolCall
- type BareMetadata
- type CallableTool
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params interface{}, ...) error
- func (r *Client) Get(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- func (r *Client) Post(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- func (r *Client) Put(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- type ConfigHTTP
- type ConfigHTTPParam
- type ConfigHTTPRequestMethod
- type ConfigMcp
- type ConfigMcpParam
- type CreateOperationMetadataParam
- type CreateResourceMetadataParam
- type Error
- type McpToolFilter
- type McpToolFilterFilter
- type McpToolFilterFilterParam
- type McpToolFilterFiltersAttribute
- type McpToolFilterFiltersMatcher
- type McpToolFilterFiltersMatcherParam
- type McpToolFilterOperator
- type McpToolFilterParam
- type Model
- type ModelListParams
- type ModelListParamsStatus
- type ModelService
- func (r *ModelService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Model, err error)
- func (r *ModelService) List(ctx context.Context, query ModelListParams, opts ...option.RequestOption) (res *pagination.CursorPagination[Model], err error)
- func (r *ModelService) ListAutoPaging(ctx context.Context, query ModelListParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[Model]
- func (r *ModelService) SetStatus(ctx context.Context, id string, body ModelSetStatusParams, ...) (res *Model, err error)
- type ModelSetStatusParams
- type ModelSetStatusParamsStatus
- type ModelSpec
- type ModelSpecStatus
- type Objective
- type ObjectiveCancelParams
- type ObjectiveContextWindow
- type ObjectiveContextWindowData
- type ObjectiveContextWindowInfo
- type ObjectiveContinueParams
- type ObjectiveContinueParamsSecret
- type ObjectiveContinueResponse
- type ObjectiveData
- type ObjectiveDataParam
- type ObjectiveDataSecret
- type ObjectiveDataSecretParam
- type ObjectiveError
- type ObjectiveEventData
- type ObjectiveEventInfo
- type ObjectiveInfo
- type ObjectiveListContextWindowsParams
- type ObjectiveListEventsParams
- type ObjectiveListEventsResponse
- type ObjectiveListParams
- type ObjectiveListParamsState
- type ObjectiveNewParams
- type ObjectiveService
- func (r *ObjectiveService) Cancel(ctx context.Context, objectiveID string, body ObjectiveCancelParams, ...) (res *Objective, err error)
- func (r *ObjectiveService) Continue(ctx context.Context, objectiveID string, body ObjectiveContinueParams, ...) (res *ObjectiveContinueResponse, err error)
- func (r *ObjectiveService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Objective, err error)
- func (r *ObjectiveService) List(ctx context.Context, query ObjectiveListParams, opts ...option.RequestOption) (res *pagination.CursorPagination[Objective], err error)
- func (r *ObjectiveService) ListAutoPaging(ctx context.Context, query ObjectiveListParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[Objective]
- func (r *ObjectiveService) ListContextWindows(ctx context.Context, objectiveID string, ...) (res *pagination.CursorPagination[ObjectiveContextWindow], err error)
- func (r *ObjectiveService) ListContextWindowsAutoPaging(ctx context.Context, objectiveID string, ...) *pagination.CursorPaginationAutoPager[ObjectiveContextWindow]
- func (r *ObjectiveService) ListEvents(ctx context.Context, objectiveID string, query ObjectiveListEventsParams, ...) (res *pagination.CursorPagination[ObjectiveListEventsResponse], err error)
- func (r *ObjectiveService) ListEventsAutoPaging(ctx context.Context, objectiveID string, query ObjectiveListEventsParams, ...) *pagination.CursorPaginationAutoPager[ObjectiveListEventsResponse]
- func (r *ObjectiveService) New(ctx context.Context, body ObjectiveNewParams, opts ...option.RequestOption) (res *Objective, err error)
- type ObjectiveStatus
- type ObjectiveStatusState
- type ObjectiveTask
- type ObjectiveTaskData
- type ObjectiveTaskListParams
- type ObjectiveTaskService
- func (r *ObjectiveTaskService) Get(ctx context.Context, objectiveID string, id string, ...) (res *ObjectiveTask, err error)
- func (r *ObjectiveTaskService) List(ctx context.Context, objectiveID string, query ObjectiveTaskListParams, ...) (res *pagination.CursorPagination[ObjectiveTask], err error)
- func (r *ObjectiveTaskService) ListAutoPaging(ctx context.Context, objectiveID string, query ObjectiveTaskListParams, ...) *pagination.CursorPaginationAutoPager[ObjectiveTask]
- type ObjectiveTool
- type ObjectiveToolCall
- type ObjectiveToolCallApproveParams
- type ObjectiveToolCallData
- type ObjectiveToolCallDenyParams
- type ObjectiveToolCallInfo
- type ObjectiveToolCallListParams
- type ObjectiveToolCallListParamsStatus
- type ObjectiveToolCallService
- func (r *ObjectiveToolCallService) Approve(ctx context.Context, objectiveID string, toolCallID string, ...) (res *ObjectiveToolCall, err error)
- func (r *ObjectiveToolCallService) Deny(ctx context.Context, objectiveID string, toolCallID string, ...) (res *ObjectiveToolCall, err error)
- func (r *ObjectiveToolCallService) List(ctx context.Context, objectiveID string, query ObjectiveToolCallListParams, ...) (res *pagination.CursorPagination[ObjectiveToolCall], err error)
- func (r *ObjectiveToolCallService) ListAutoPaging(ctx context.Context, objectiveID string, query ObjectiveToolCallListParams, ...) *pagination.CursorPaginationAutoPager[ObjectiveToolCall]
- type ObjectiveToolCallStatus
- type ObjectiveToolListParams
- type ObjectiveToolService
- func (r *ObjectiveToolService) List(ctx context.Context, objectiveID string, query ObjectiveToolListParams, ...) (res *pagination.CursorPagination[ObjectiveTool], err error)
- func (r *ObjectiveToolService) ListAutoPaging(ctx context.Context, objectiveID string, query ObjectiveToolListParams, ...) *pagination.CursorPaginationAutoPager[ObjectiveTool]
- type OperationMetadata
- type Page
- type Profile
- type ProfileParam
- type ProfileSpec
- type ProfileSpecParam
- type ProfileSpecType
- type ResourceMetadata
- type ResourceMetadataParam
- type SearchSearchToolsOrToolSetsParams
- type SearchSearchToolsOrToolSetsResponse
- type SearchService
- type SubObjectiveCreated
- type SyncCompleted
- type SyncFailed
- type SyncStarted
- type Tool
- type ToolApprovalRequested
- type ToolApproved
- type ToolCalled
- type ToolDenied
- type ToolError
- type ToolInfo
- type ToolResult
- type ToolSelectionAssignedTools
- type ToolSelectionAssignedToolsParam
- type ToolSelectionAutoDiscovery
- type ToolSelectionAutoDiscoveryParam
- type ToolSet
- type ToolSetAdapter
- type ToolSetAdapterHTTP
- type ToolSetAdapterHTTPParam
- type ToolSetAdapterMcp
- type ToolSetAdapterMcpParam
- type ToolSetAdapterMcpToolApprovals
- type ToolSetAdapterMcpToolApprovalsParam
- type ToolSetAdapterParam
- type ToolSetEvent
- type ToolSetEventData
- type ToolSetEventInfo
- type ToolSetInfo
- type ToolSetListEventsParams
- type ToolSetListParams
- type ToolSetNewParams
- type ToolSetService
- func (r *ToolSetService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (err error)
- func (r *ToolSetService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *ToolSet, err error)
- func (r *ToolSetService) List(ctx context.Context, query ToolSetListParams, opts ...option.RequestOption) (res *pagination.CursorPagination[ToolSet], err error)
- func (r *ToolSetService) ListAutoPaging(ctx context.Context, query ToolSetListParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[ToolSet]
- func (r *ToolSetService) ListEvents(ctx context.Context, toolSetID string, query ToolSetListEventsParams, ...) (res *pagination.CursorPagination[ToolSetEvent], err error)
- func (r *ToolSetService) ListEventsAutoPaging(ctx context.Context, toolSetID string, query ToolSetListEventsParams, ...) *pagination.CursorPaginationAutoPager[ToolSetEvent]
- func (r *ToolSetService) New(ctx context.Context, body ToolSetNewParams, opts ...option.RequestOption) (res *ToolSet, err error)
- func (r *ToolSetService) Update(ctx context.Context, id string, body ToolSetUpdateParams, ...) (res *ToolSet, err error)
- type ToolSetSpec
- type ToolSetSpecParam
- type ToolSetToolListParams
- type ToolSetToolNewParams
- type ToolSetToolService
- func (r *ToolSetToolService) Delete(ctx context.Context, toolSetID string, id string, opts ...option.RequestOption) (err error)
- func (r *ToolSetToolService) Get(ctx context.Context, toolSetID string, id string, opts ...option.RequestOption) (res *Tool, err error)
- func (r *ToolSetToolService) List(ctx context.Context, toolSetID string, query ToolSetToolListParams, ...) (res *pagination.CursorPagination[Tool], err error)
- func (r *ToolSetToolService) ListAutoPaging(ctx context.Context, toolSetID string, query ToolSetToolListParams, ...) *pagination.CursorPaginationAutoPager[Tool]
- func (r *ToolSetToolService) New(ctx context.Context, toolSetID string, body ToolSetToolNewParams, ...) (res *Tool, err error)
- func (r *ToolSetToolService) Update(ctx context.Context, toolSetID string, id string, body ToolSetToolUpdateParams, ...) (res *Tool, err error)
- type ToolSetToolUpdateParams
- type ToolSetUpdateParams
- type ToolSpec
- type ToolSpecConfig
- type ToolSpecConfigParam
- type ToolSpecParam
- type ToolSpecStatus
- type UpdateResourceMetadataParam
- type UserMessage
- type WebhookDelivery
- type WebhookDeliveryData
- type WebhookDeliveryDataEventType
- type WebhookDeliveryDataStatus
- type Workspace
- type WorkspaceListParams
- type WorkspaceSecret
- type WorkspaceSecretInfo
- type WorkspaceSecretListParams
- type WorkspaceSecretNewParams
- type WorkspaceSecretService
- func (r *WorkspaceSecretService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (err error)
- func (r *WorkspaceSecretService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *WorkspaceSecret, err error)
- func (r *WorkspaceSecretService) List(ctx context.Context, query WorkspaceSecretListParams, ...) (res *pagination.CursorPagination[WorkspaceSecret], err error)
- func (r *WorkspaceSecretService) ListAutoPaging(ctx context.Context, query WorkspaceSecretListParams, ...) *pagination.CursorPaginationAutoPager[WorkspaceSecret]
- func (r *WorkspaceSecretService) New(ctx context.Context, body WorkspaceSecretNewParams, ...) (res *WorkspaceSecret, err error)
- func (r *WorkspaceSecretService) Update(ctx context.Context, id string, body WorkspaceSecretUpdateParams, ...) (res *WorkspaceSecret, err error)
- type WorkspaceSecretSpec
- type WorkspaceSecretSpecParam
- type WorkspaceSecretUpdateParams
- type WorkspaceService
- func (r *WorkspaceService) Get(ctx context.Context, opts ...option.RequestOption) (res *shared.Workspace, err error)
- func (r *WorkspaceService) List(ctx context.Context, query WorkspaceListParams, opts ...option.RequestOption) (res *pagination.CursorPagination[shared.Workspace], err error)
- func (r *WorkspaceService) ListAutoPaging(ctx context.Context, query WorkspaceListParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[shared.Workspace]
- type WorkspaceSpec
Constants ¶
const ProfileSpecTypeProfileTypeAPIKey = shared.ProfileSpecTypeProfileTypeAPIKey
This is an alias to an internal value.
const ProfileSpecTypeProfileTypeSystem = shared.ProfileSpecTypeProfileTypeSystem
This is an alias to an internal value.
const ProfileSpecTypeProfileTypeUser = shared.ProfileSpecTypeProfileTypeUser
This is an alias to an internal value.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (CADENYA_API_KEY, CADENYA_BASE_URL). This should be used to initialize new clients.
func F ¶
F is a param field helper used to initialize a param.Field generic struct. This helps specify null, zero values, and overrides, as well as normal values. You can read more about this in our README.
func Int ¶
Int is a param field helper which helps specify integers. This is particularly helpful when specifying integer constants for fields.
func Raw ¶
Raw is a param field helper for specifying values for fields when the type you are looking to send is different from the type that is specified in the SDK. For example, if the type of the field is an integer, but you want to send a float, you could do that by setting the corresponding field with Raw[int](0.5).
Types ¶
type APIKey ¶
type APIKey struct {
// Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
Metadata shared.ResourceMetadata `json:"metadata" api:"required"`
// APIKeySpec contains the API Key-specific fields
Spec APIKeySpec `json:"spec" api:"required"`
Info APIKeyInfo `json:"info"`
JSON apiKeyJSON `json:"-"`
}
APIKey represents a workspace-scoped API key. Each API key belongs to exactly one workspace, ensuring workspace isolation. Authentication is handled via Cadenya-issued JWTs signed with the key's own signing secret.
func (*APIKey) UnmarshalJSON ¶
type APIKeyInfo ¶
type APIKeyInfo struct {
// Profile represents a human user at the account level. Profiles are
// account-scoped resources that can be associated with multiple workspaces through
// the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS).
CreatedBy shared.Profile `json:"createdBy"`
JSON apiKeyInfoJSON `json:"-"`
}
func (*APIKeyInfo) UnmarshalJSON ¶
func (r *APIKeyInfo) UnmarshalJSON(data []byte) (err error)
type APIKeyListParams ¶
type APIKeyListParams struct {
// Pagination cursor from previous response
Cursor param.Field[string] `query:"cursor"`
// When set to true you may use more of your alloted API rate-limit
IncludeInfo param.Field[bool] `query:"includeInfo"`
// Maximum number of results to return
Limit param.Field[int64] `query:"limit"`
// Filter expression (query param: prefix)
Prefix param.Field[string] `query:"prefix"`
// Sort order for results (asc or desc by creation time)
SortOrder param.Field[string] `query:"sortOrder"`
}
func (APIKeyListParams) URLQuery ¶
func (r APIKeyListParams) URLQuery() (v url.Values)
URLQuery serializes APIKeyListParams's query parameters as `url.Values`.
type APIKeyNewParams ¶
type APIKeyNewParams struct {
// CreateResourceMetadata contains the user-provided fields for creating a
// workspace-scoped resource. Read-only fields (id, account_id, workspace_id,
// profile_id, created_at) are excluded since they are set by the server.
Metadata param.Field[shared.CreateResourceMetadataParam] `json:"metadata" api:"required"`
// APIKeySpec contains the API Key-specific fields
Spec param.Field[APIKeySpecParam] `json:"spec" api:"required"`
}
func (APIKeyNewParams) MarshalJSON ¶
func (r APIKeyNewParams) MarshalJSON() (data []byte, err error)
type APIKeyService ¶
type APIKeyService struct {
Options []option.RequestOption
}
APIKeyService manages workspace-scoped API Keys. Each API key belongs to a single workspace, ensuring isolation between environments.
Authentication: Bearer token (JWT) Scope: Workspace-level operations
APIKeyService contains methods and other services that help with interacting with the cadenya API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAPIKeyService method instead.
func NewAPIKeyService ¶
func NewAPIKeyService(opts ...option.RequestOption) (r *APIKeyService)
NewAPIKeyService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*APIKeyService) Delete ¶
func (r *APIKeyService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (err error)
Deletes an API key from the workspace
func (*APIKeyService) Get ¶
func (r *APIKeyService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *APIKey, err error)
Retrieves an API key by ID from the workspace
func (*APIKeyService) List ¶
func (r *APIKeyService) List(ctx context.Context, query APIKeyListParams, opts ...option.RequestOption) (res *pagination.CursorPagination[APIKey], err error)
Lists all API keys in the workspace
func (*APIKeyService) ListAutoPaging ¶
func (r *APIKeyService) ListAutoPaging(ctx context.Context, query APIKeyListParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[APIKey]
Lists all API keys in the workspace
func (*APIKeyService) New ¶
func (r *APIKeyService) New(ctx context.Context, body APIKeyNewParams, opts ...option.RequestOption) (res *APIKey, err error)
Creates a new API key in the workspace.
func (*APIKeyService) Rotate ¶
func (r *APIKeyService) Rotate(ctx context.Context, id string, opts ...option.RequestOption) (res *APIKey, err error)
Rotates an API Key and returns a new token. All previous API Key tokens in use will be invalidated.
func (*APIKeyService) Update ¶
func (r *APIKeyService) Update(ctx context.Context, id string, body APIKeyUpdateParams, opts ...option.RequestOption) (res *APIKey, err error)
Updates an API key in the workspace
type APIKeySpec ¶
type APIKeySpec struct {
// The actual token value (only returned on creation and rotation, read-only)
Token string `json:"token"`
// Description of what this API Key is used for
Description string `json:"description"`
JSON apiKeySpecJSON `json:"-"`
}
APIKeySpec contains the API Key-specific fields
func (*APIKeySpec) UnmarshalJSON ¶
func (r *APIKeySpec) UnmarshalJSON(data []byte) (err error)
type APIKeySpecParam ¶
type APIKeySpecParam struct {
// Description of what this API Key is used for
Description param.Field[string] `json:"description"`
}
APIKeySpec contains the API Key-specific fields
func (APIKeySpecParam) MarshalJSON ¶
func (r APIKeySpecParam) MarshalJSON() (data []byte, err error)
type APIKeyUpdateParams ¶
type APIKeyUpdateParams struct {
// UpdateResourceMetadata contains the user-provided fields for updating a
// workspace-scoped resource. Read-only fields (id, account_id, workspace_id,
// profile_id, created_at) are excluded since they are set by the server.
Metadata param.Field[shared.UpdateResourceMetadataParam] `json:"metadata"`
// APIKeySpec contains the API Key-specific fields
Spec param.Field[APIKeySpecParam] `json:"spec"`
// Fields to update
UpdateMask param.Field[string] `json:"updateMask" format:"field-mask"`
}
func (APIKeyUpdateParams) MarshalJSON ¶
func (r APIKeyUpdateParams) MarshalJSON() (data []byte, err error)
type AccountResourceMetadata ¶
type AccountResourceMetadata = shared.AccountResourceMetadata
AccountResourceMetadata is used to represent a resource that is associated to an account but not to a workspace.
This is an alias to an internal type.
type AccountResourceMetadataParam ¶
type AccountResourceMetadataParam = shared.AccountResourceMetadataParam
AccountResourceMetadata is used to represent a resource that is associated to an account but not to a workspace.
This is an alias to an internal type.
type AccountService ¶
type AccountService struct {
Options []option.RequestOption
}
AccountService manages account-level operations. Accounts are the top-level organizational unit in the system. All operations are scoped to the authenticated account determined by the JWT token.
Authentication: Bearer token (JWT) Scope: Account-level operations
AccountService contains methods and other services that help with interacting with the cadenya API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAccountService method instead.
func NewAccountService ¶
func NewAccountService(opts ...option.RequestOption) (r *AccountService)
NewAccountService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*AccountService) Get ¶
func (r *AccountService) Get(ctx context.Context, opts ...option.RequestOption) (res *shared.Account, err error)
Retrieves the current account for the token accessing the API. Useful to check if the credentials are valid.
type Agent ¶
type Agent struct {
// Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
Metadata shared.ResourceMetadata `json:"metadata" api:"required"`
// Agent specification (user-provided configuration)
Spec AgentSpec `json:"spec" api:"required"`
// AgentInfo contains simple information about an agent for display or quick
// reference
Info AgentInfo `json:"info"`
JSON agentJSON `json:"-"`
}
Agent resource
func (*Agent) UnmarshalJSON ¶
type AgentInfo ¶
type AgentInfo struct {
// Profile represents a human user at the account level. Profiles are
// account-scoped resources that can be associated with multiple workspaces through
// the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS).
CreatedBy shared.Profile `json:"createdBy"`
VariationCount int64 `json:"variationCount"`
JSON agentInfoJSON `json:"-"`
}
AgentInfo contains simple information about an agent for display or quick reference
func (*AgentInfo) UnmarshalJSON ¶
type AgentInfoParam ¶
type AgentInfoParam struct {
// Profile represents a human user at the account level. Profiles are
// account-scoped resources that can be associated with multiple workspaces through
// the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS).
CreatedBy param.Field[shared.ProfileParam] `json:"createdBy"`
}
AgentInfo contains simple information about an agent for display or quick reference
func (AgentInfoParam) MarshalJSON ¶
func (r AgentInfoParam) MarshalJSON() (data []byte, err error)
type AgentListParams ¶
type AgentListParams struct {
// Pagination cursor from previous response
Cursor param.Field[string] `query:"cursor"`
// When set to true you may use more of your alloted API rate-limit
IncludeInfo param.Field[bool] `query:"includeInfo"`
// Maximum number of results to return
Limit param.Field[int64] `query:"limit"`
// Filter expression (query param: prefix)
Prefix param.Field[string] `query:"prefix"`
// Sort order for results (asc or desc by creation time)
SortOrder param.Field[string] `query:"sortOrder"`
}
func (AgentListParams) URLQuery ¶
func (r AgentListParams) URLQuery() (v url.Values)
URLQuery serializes AgentListParams's query parameters as `url.Values`.
type AgentNewParams ¶
type AgentNewParams struct {
// CreateResourceMetadata contains the user-provided fields for creating a
// workspace-scoped resource. Read-only fields (id, account_id, workspace_id,
// profile_id, created_at) are excluded since they are set by the server.
Metadata param.Field[shared.CreateResourceMetadataParam] `json:"metadata" api:"required"`
// Agent specification (user-provided configuration)
Spec param.Field[AgentSpecParam] `json:"spec" api:"required"`
// Create agent variation request
DefaultVariation param.Field[AgentNewParamsDefaultVariation] `json:"defaultVariation"`
}
func (AgentNewParams) MarshalJSON ¶
func (r AgentNewParams) MarshalJSON() (data []byte, err error)
type AgentNewParamsDefaultVariation ¶
type AgentNewParamsDefaultVariation struct {
// CreateResourceMetadata contains the user-provided fields for creating a
// workspace-scoped resource. Read-only fields (id, account_id, workspace_id,
// profile_id, created_at) are excluded since they are set by the server.
Metadata param.Field[shared.CreateResourceMetadataParam] `json:"metadata" api:"required"`
// AgentVariationSpec defines the operational configuration for a variation
Spec param.Field[AgentVariationSpecParam] `json:"spec" api:"required"`
}
Create agent variation request
func (AgentNewParamsDefaultVariation) MarshalJSON ¶
func (r AgentNewParamsDefaultVariation) MarshalJSON() (data []byte, err error)
type AgentParam ¶
type AgentParam struct {
// Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
Metadata param.Field[shared.ResourceMetadataParam] `json:"metadata" api:"required"`
// Agent specification (user-provided configuration)
Spec param.Field[AgentSpecParam] `json:"spec" api:"required"`
}
Agent resource
func (AgentParam) MarshalJSON ¶
func (r AgentParam) MarshalJSON() (data []byte, err error)
type AgentService ¶
type AgentService struct {
Options []option.RequestOption
Variations *AgentVariationService
// AgentService manages AI agents at the WORKSPACE level. Agents are
// workspace-scoped resources that define AI behavior and tool access. All
// operations are implicitly scoped to the workspace determined by the JWT token.
//
// Authentication: Bearer token (JWT) Scope: Workspace-level operations
WebhookDeliveries *AgentWebhookDeliveryService
}
AgentService manages AI agents at the WORKSPACE level. Agents are workspace-scoped resources that define AI behavior and tool access. All operations are implicitly scoped to the workspace determined by the JWT token.
Authentication: Bearer token (JWT) Scope: Workspace-level operations
AgentService contains methods and other services that help with interacting with the cadenya API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAgentService method instead.
func NewAgentService ¶
func NewAgentService(opts ...option.RequestOption) (r *AgentService)
NewAgentService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*AgentService) Delete ¶
func (r *AgentService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (err error)
Deletes an agent from the workspace
func (*AgentService) Get ¶
func (r *AgentService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Agent, err error)
Retrieves an agent by ID from the workspace
func (*AgentService) List ¶
func (r *AgentService) List(ctx context.Context, query AgentListParams, opts ...option.RequestOption) (res *pagination.CursorPagination[Agent], err error)
Lists all agents in the workspace
func (*AgentService) ListAutoPaging ¶
func (r *AgentService) ListAutoPaging(ctx context.Context, query AgentListParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[Agent]
Lists all agents in the workspace
func (*AgentService) New ¶
func (r *AgentService) New(ctx context.Context, body AgentNewParams, opts ...option.RequestOption) (res *Agent, err error)
Creates a new agent in the workspace
func (*AgentService) Update ¶
func (r *AgentService) Update(ctx context.Context, id string, body AgentUpdateParams, opts ...option.RequestOption) (res *Agent, err error)
Updates an agent in the workspace
type AgentSpec ¶
type AgentSpec struct {
// Status of the agent
Status AgentSpecStatus `json:"status" api:"required"`
// Controls how variations are automatically selected when creating objectives
// Defaults to RANDOM when unspecified
VariationSelectionMode AgentSpecVariationSelectionMode `json:"variationSelectionMode" api:"required"`
// Description of the agent's purpose
Description string `json:"description"`
// The generated secret that will sign all webhooks that are sent to your
// configured Webhook URL. Formatted as "wh_asdf1234" per the
// https://www.standardwebhooks.com/ format.
WebhookEventsHmacSecret string `json:"webhookEventsHmacSecret"`
// The URL that Cadenya will send events for any objective assigned to the agent.
WebhookEventsURL string `json:"webhookEventsUrl"`
JSON agentSpecJSON `json:"-"`
}
Agent specification (user-provided configuration)
func (*AgentSpec) UnmarshalJSON ¶
type AgentSpecParam ¶
type AgentSpecParam struct {
// Status of the agent
Status param.Field[AgentSpecStatus] `json:"status" api:"required"`
// Controls how variations are automatically selected when creating objectives
// Defaults to RANDOM when unspecified
VariationSelectionMode param.Field[AgentSpecVariationSelectionMode] `json:"variationSelectionMode" api:"required"`
// Description of the agent's purpose
Description param.Field[string] `json:"description"`
// The URL that Cadenya will send events for any objective assigned to the agent.
WebhookEventsURL param.Field[string] `json:"webhookEventsUrl"`
}
Agent specification (user-provided configuration)
func (AgentSpecParam) MarshalJSON ¶
func (r AgentSpecParam) MarshalJSON() (data []byte, err error)
type AgentSpecStatus ¶
type AgentSpecStatus string
Status of the agent
const ( AgentSpecStatusAgentStatusUnspecified AgentSpecStatus = "AGENT_STATUS_UNSPECIFIED" AgentSpecStatusAgentStatusDraft AgentSpecStatus = "AGENT_STATUS_DRAFT" AgentSpecStatusAgentStatusPublished AgentSpecStatus = "AGENT_STATUS_PUBLISHED" AgentSpecStatusAgentStatusArchived AgentSpecStatus = "AGENT_STATUS_ARCHIVED" )
func (AgentSpecStatus) IsKnown ¶
func (r AgentSpecStatus) IsKnown() bool
type AgentSpecVariationSelectionMode ¶
type AgentSpecVariationSelectionMode string
Controls how variations are automatically selected when creating objectives Defaults to RANDOM when unspecified
const ( AgentSpecVariationSelectionModeVariationSelectionModeUnspecified AgentSpecVariationSelectionMode = "VARIATION_SELECTION_MODE_UNSPECIFIED" AgentSpecVariationSelectionModeVariationSelectionModeRandom AgentSpecVariationSelectionMode = "VARIATION_SELECTION_MODE_RANDOM" AgentSpecVariationSelectionModeVariationSelectionModeWeighted AgentSpecVariationSelectionMode = "VARIATION_SELECTION_MODE_WEIGHTED" )
func (AgentSpecVariationSelectionMode) IsKnown ¶
func (r AgentSpecVariationSelectionMode) IsKnown() bool
type AgentUpdateParams ¶
type AgentUpdateParams struct {
// UpdateResourceMetadata contains the user-provided fields for updating a
// workspace-scoped resource. Read-only fields (id, account_id, workspace_id,
// profile_id, created_at) are excluded since they are set by the server.
Metadata param.Field[shared.UpdateResourceMetadataParam] `json:"metadata"`
// Agent specification (user-provided configuration)
Spec param.Field[AgentSpecParam] `json:"spec"`
// Fields to update
UpdateMask param.Field[string] `json:"updateMask" format:"field-mask"`
}
func (AgentUpdateParams) MarshalJSON ¶
func (r AgentUpdateParams) MarshalJSON() (data []byte, err error)
type AgentVariation ¶
type AgentVariation struct {
// Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
Metadata shared.ResourceMetadata `json:"metadata" api:"required"`
// AgentVariationSpec defines the operational configuration for a variation
Spec AgentVariationSpec `json:"spec" api:"required"`
// AgentVariationInfo provides read-only summary information about a variation
Info AgentVariationInfo `json:"info"`
JSON agentVariationJSON `json:"-"`
}
AgentVariation resource
func (*AgentVariation) UnmarshalJSON ¶
func (r *AgentVariation) UnmarshalJSON(data []byte) (err error)
type AgentVariationInfo ¶
type AgentVariationInfo struct {
// Profile represents a human user at the account level. Profiles are
// account-scoped resources that can be associated with multiple workspaces through
// the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS).
CreatedBy shared.Profile `json:"createdBy"`
// Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
Model shared.ResourceMetadata `json:"model"`
// Number of sub-agents assigned to this variation
SubAgentCount int64 `json:"subAgentCount"`
// Number of individual tools assigned to this variation
ToolCount int64 `json:"toolCount"`
// Number of tool sets assigned to this variation
ToolSetCount int64 `json:"toolSetCount"`
JSON agentVariationInfoJSON `json:"-"`
}
AgentVariationInfo provides read-only summary information about a variation
func (*AgentVariationInfo) UnmarshalJSON ¶
func (r *AgentVariationInfo) UnmarshalJSON(data []byte) (err error)
type AgentVariationInfoParam ¶
type AgentVariationInfoParam struct {
// Profile represents a human user at the account level. Profiles are
// account-scoped resources that can be associated with multiple workspaces through
// the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS).
CreatedBy param.Field[shared.ProfileParam] `json:"createdBy"`
}
AgentVariationInfo provides read-only summary information about a variation
func (AgentVariationInfoParam) MarshalJSON ¶
func (r AgentVariationInfoParam) MarshalJSON() (data []byte, err error)
type AgentVariationListParams ¶
type AgentVariationListParams struct {
// Pagination cursor from previous response
Cursor param.Field[string] `query:"cursor"`
// When set to true you may use more of your alloted API rate-limit
IncludeInfo param.Field[bool] `query:"includeInfo"`
// Maximum number of results to return
Limit param.Field[int64] `query:"limit"`
// Sort order for results (asc or desc by creation time)
SortOrder param.Field[string] `query:"sortOrder"`
}
func (AgentVariationListParams) URLQuery ¶
func (r AgentVariationListParams) URLQuery() (v url.Values)
URLQuery serializes AgentVariationListParams's query parameters as `url.Values`.
type AgentVariationNewParams ¶
type AgentVariationNewParams struct {
// CreateResourceMetadata contains the user-provided fields for creating a
// workspace-scoped resource. Read-only fields (id, account_id, workspace_id,
// profile_id, created_at) are excluded since they are set by the server.
Metadata param.Field[shared.CreateResourceMetadataParam] `json:"metadata" api:"required"`
// AgentVariationSpec defines the operational configuration for a variation
Spec param.Field[AgentVariationSpecParam] `json:"spec" api:"required"`
}
func (AgentVariationNewParams) MarshalJSON ¶
func (r AgentVariationNewParams) MarshalJSON() (data []byte, err error)
type AgentVariationParam ¶
type AgentVariationParam struct {
// Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
Metadata param.Field[shared.ResourceMetadataParam] `json:"metadata" api:"required"`
// AgentVariationSpec defines the operational configuration for a variation
Spec param.Field[AgentVariationSpecParam] `json:"spec" api:"required"`
}
AgentVariation resource
func (AgentVariationParam) MarshalJSON ¶
func (r AgentVariationParam) MarshalJSON() (data []byte, err error)
type AgentVariationService ¶
type AgentVariationService struct {
Options []option.RequestOption
}
AgentVariationService contains methods and other services that help with interacting with the cadenya API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAgentVariationService method instead.
func NewAgentVariationService ¶
func NewAgentVariationService(opts ...option.RequestOption) (r *AgentVariationService)
NewAgentVariationService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*AgentVariationService) Delete ¶
func (r *AgentVariationService) Delete(ctx context.Context, agentID string, id string, opts ...option.RequestOption) (err error)
Deletes a variation from an agent
func (*AgentVariationService) Get ¶
func (r *AgentVariationService) Get(ctx context.Context, agentID string, id string, opts ...option.RequestOption) (res *AgentVariation, err error)
Retrieves a variation by ID from an agent
func (*AgentVariationService) List ¶
func (r *AgentVariationService) List(ctx context.Context, agentID string, query AgentVariationListParams, opts ...option.RequestOption) (res *pagination.CursorPagination[AgentVariation], err error)
Lists all variations for an agent
func (*AgentVariationService) ListAutoPaging ¶
func (r *AgentVariationService) ListAutoPaging(ctx context.Context, agentID string, query AgentVariationListParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[AgentVariation]
Lists all variations for an agent
func (*AgentVariationService) New ¶
func (r *AgentVariationService) New(ctx context.Context, agentID string, body AgentVariationNewParams, opts ...option.RequestOption) (res *AgentVariation, err error)
Creates a new variation for an agent
func (*AgentVariationService) Update ¶
func (r *AgentVariationService) Update(ctx context.Context, agentID string, id string, body AgentVariationUpdateParams, opts ...option.RequestOption) (res *AgentVariation, err error)
Updates a variation for an agent
type AgentVariationSpec ¶
type AgentVariationSpec struct {
// Documents assigned to this variation. Can include individual documents or entire
// document namespaces (which include all documents in the namespace).
AgentDocuments []AgentVariationSpecAgentDocument `json:"agentDocuments"`
// Tools assigned to this variation
AgentTools []AgentVariationSpecAgentTool `json:"agentTools"`
// Execution constraints
Constraints AgentVariationSpecConstraints `json:"constraints"`
// Human-readable description of what this variation does or when it should be used
Description string `json:"description"`
// Enable episodic memory for objectives using this variation. When true, the
// system automatically creates a document namespace for each objective using the
// objective's episodic_key as the external_id, allowing the agent to store and
// retrieve documents specific to that episode.
EnableEpisodicMemory bool `json:"enableEpisodicMemory"`
// How long episodic memories should be retained. After this duration, episodic
// document namespaces can be automatically cleaned up. If not set, episodic
// memories are retained indefinitely.
EpisodicMemoryTtl int64 `json:"episodicMemoryTtl"`
// ModelConfig defines the model configuration for a variation
ModelConfig AgentVariationSpecModelConfig `json:"modelConfig"`
// The system prompt for this variation
Prompt string `json:"prompt"`
// Tool selection strategy
ToolSelection AgentVariationSpecToolSelection `json:"toolSelection"`
// Weight for weighted random selection (>= 0). P(v) = v.weight / sum(all_weights).
// Only used when the agent's variation_selection_mode is WEIGHTED. A weight of 0
// means never auto-selected, but can still be chosen explicitly via variation_id
// on CreateObjectiveRequest.
Weight int64 `json:"weight"`
JSON agentVariationSpecJSON `json:"-"`
}
AgentVariationSpec defines the operational configuration for a variation
func (*AgentVariationSpec) UnmarshalJSON ¶
func (r *AgentVariationSpec) UnmarshalJSON(data []byte) (err error)
type AgentVariationSpecAgentDocument ¶
type AgentVariationSpecAgentDocument struct {
DocumentID string `json:"documentId"`
// Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
DocumentMetadata shared.ResourceMetadata `json:"documentMetadata"`
DocumentNamespaceID string `json:"documentNamespaceId"`
// Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
DocumentNamespaceMetadata shared.ResourceMetadata `json:"documentNamespaceMetadata"`
JSON agentVariationSpecAgentDocumentJSON `json:"-"`
}
func (*AgentVariationSpecAgentDocument) UnmarshalJSON ¶
func (r *AgentVariationSpecAgentDocument) UnmarshalJSON(data []byte) (err error)
type AgentVariationSpecAgentDocumentParam ¶
type AgentVariationSpecAgentDocumentParam struct {
DocumentID param.Field[string] `json:"documentId"`
// Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
DocumentMetadata param.Field[shared.ResourceMetadataParam] `json:"documentMetadata"`
DocumentNamespaceID param.Field[string] `json:"documentNamespaceId"`
// Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
DocumentNamespaceMetadata param.Field[shared.ResourceMetadataParam] `json:"documentNamespaceMetadata"`
}
func (AgentVariationSpecAgentDocumentParam) MarshalJSON ¶
func (r AgentVariationSpecAgentDocumentParam) MarshalJSON() (data []byte, err error)
type AgentVariationSpecAgentTool ¶
type AgentVariationSpecAgentTool struct {
AgentID string `json:"agentId"`
// Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
AgentMetadata shared.ResourceMetadata `json:"agentMetadata"`
ToolID string `json:"toolId"`
// Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
ToolMetadata shared.ResourceMetadata `json:"toolMetadata"`
ToolSetID string `json:"toolSetId"`
// Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
ToolSetMetadata shared.ResourceMetadata `json:"toolSetMetadata"`
JSON agentVariationSpecAgentToolJSON `json:"-"`
}
func (*AgentVariationSpecAgentTool) UnmarshalJSON ¶
func (r *AgentVariationSpecAgentTool) UnmarshalJSON(data []byte) (err error)
type AgentVariationSpecAgentToolParam ¶
type AgentVariationSpecAgentToolParam struct {
AgentID param.Field[string] `json:"agentId"`
// Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
AgentMetadata param.Field[shared.ResourceMetadataParam] `json:"agentMetadata"`
ToolID param.Field[string] `json:"toolId"`
// Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
ToolMetadata param.Field[shared.ResourceMetadataParam] `json:"toolMetadata"`
ToolSetID param.Field[string] `json:"toolSetId"`
// Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
ToolSetMetadata param.Field[shared.ResourceMetadataParam] `json:"toolSetMetadata"`
}
func (AgentVariationSpecAgentToolParam) MarshalJSON ¶
func (r AgentVariationSpecAgentToolParam) MarshalJSON() (data []byte, err error)
type AgentVariationSpecConstraints ¶
type AgentVariationSpecConstraints struct {
// The maximum number of sub-objectives that can be created. 0 means no limit.
MaxSubObjectives int64 `json:"maxSubObjectives"`
// The maximum number of tool calls that can be made. 0 means no limit.
MaxToolCalls int64 `json:"maxToolCalls"`
JSON agentVariationSpecConstraintsJSON `json:"-"`
}
func (*AgentVariationSpecConstraints) UnmarshalJSON ¶
func (r *AgentVariationSpecConstraints) UnmarshalJSON(data []byte) (err error)
type AgentVariationSpecConstraintsParam ¶
type AgentVariationSpecConstraintsParam struct {
// The maximum number of sub-objectives that can be created. 0 means no limit.
MaxSubObjectives param.Field[int64] `json:"maxSubObjectives"`
// The maximum number of tool calls that can be made. 0 means no limit.
MaxToolCalls param.Field[int64] `json:"maxToolCalls"`
}
func (AgentVariationSpecConstraintsParam) MarshalJSON ¶
func (r AgentVariationSpecConstraintsParam) MarshalJSON() (data []byte, err error)
type AgentVariationSpecModelConfig ¶
type AgentVariationSpecModelConfig struct {
// The model identifier in family/model format (e.g., "claude/opus-4.6",
// "claude/sonnet-4.5")
ModelID string `json:"modelId"`
// Sampling temperature for model inference (0.0 to 1.0) Lower values produce more
// deterministic outputs, higher values increase randomness
Temperature float64 `json:"temperature"`
JSON agentVariationSpecModelConfigJSON `json:"-"`
}
ModelConfig defines the model configuration for a variation
func (*AgentVariationSpecModelConfig) UnmarshalJSON ¶
func (r *AgentVariationSpecModelConfig) UnmarshalJSON(data []byte) (err error)
type AgentVariationSpecModelConfigParam ¶
type AgentVariationSpecModelConfigParam struct {
// The model identifier in family/model format (e.g., "claude/opus-4.6",
// "claude/sonnet-4.5")
ModelID param.Field[string] `json:"modelId"`
// Sampling temperature for model inference (0.0 to 1.0) Lower values produce more
// deterministic outputs, higher values increase randomness
Temperature param.Field[float64] `json:"temperature"`
}
ModelConfig defines the model configuration for a variation
func (AgentVariationSpecModelConfigParam) MarshalJSON ¶
func (r AgentVariationSpecModelConfigParam) MarshalJSON() (data []byte, err error)
type AgentVariationSpecParam ¶
type AgentVariationSpecParam struct {
// Documents assigned to this variation. Can include individual documents or entire
// document namespaces (which include all documents in the namespace).
AgentDocuments param.Field[[]AgentVariationSpecAgentDocumentParam] `json:"agentDocuments"`
// Tools assigned to this variation
AgentTools param.Field[[]AgentVariationSpecAgentToolParam] `json:"agentTools"`
// Execution constraints
Constraints param.Field[AgentVariationSpecConstraintsParam] `json:"constraints"`
// Human-readable description of what this variation does or when it should be used
Description param.Field[string] `json:"description"`
// Enable episodic memory for objectives using this variation. When true, the
// system automatically creates a document namespace for each objective using the
// objective's episodic_key as the external_id, allowing the agent to store and
// retrieve documents specific to that episode.
EnableEpisodicMemory param.Field[bool] `json:"enableEpisodicMemory"`
// How long episodic memories should be retained. After this duration, episodic
// document namespaces can be automatically cleaned up. If not set, episodic
// memories are retained indefinitely.
EpisodicMemoryTtl param.Field[int64] `json:"episodicMemoryTtl"`
// ModelConfig defines the model configuration for a variation
ModelConfig param.Field[AgentVariationSpecModelConfigParam] `json:"modelConfig"`
// The system prompt for this variation
Prompt param.Field[string] `json:"prompt"`
// Tool selection strategy
ToolSelection param.Field[AgentVariationSpecToolSelectionParam] `json:"toolSelection"`
// Weight for weighted random selection (>= 0). P(v) = v.weight / sum(all_weights).
// Only used when the agent's variation_selection_mode is WEIGHTED. A weight of 0
// means never auto-selected, but can still be chosen explicitly via variation_id
// on CreateObjectiveRequest.
Weight param.Field[int64] `json:"weight"`
}
AgentVariationSpec defines the operational configuration for a variation
func (AgentVariationSpecParam) MarshalJSON ¶
func (r AgentVariationSpecParam) MarshalJSON() (data []byte, err error)
type AgentVariationSpecToolSelection ¶
type AgentVariationSpecToolSelection struct {
// AssignedTools is used to indicate that the agent should only use the tools/tool
// sets that are explicitly assigned to it. Allow discovery is used when the agent
// thinks it needs to discover more tools.
AssignedTools ToolSelectionAssignedTools `json:"assignedTools"`
// AutoDiscovery is used to indicate that the agent should automatically discover
// tools that are not explicitly assigned to it. Max tools is the maximum number of
// tools that can be discovered. Hints are optional hints for tool search. These
// are used in conjunction with the context-aware tool search and can help select
// the best tools for the task.
AutoDiscovery ToolSelectionAutoDiscovery `json:"autoDiscovery"`
JSON agentVariationSpecToolSelectionJSON `json:"-"`
}
func (*AgentVariationSpecToolSelection) UnmarshalJSON ¶
func (r *AgentVariationSpecToolSelection) UnmarshalJSON(data []byte) (err error)
type AgentVariationSpecToolSelectionParam ¶
type AgentVariationSpecToolSelectionParam struct {
// AssignedTools is used to indicate that the agent should only use the tools/tool
// sets that are explicitly assigned to it. Allow discovery is used when the agent
// thinks it needs to discover more tools.
AssignedTools param.Field[ToolSelectionAssignedToolsParam] `json:"assignedTools"`
// AutoDiscovery is used to indicate that the agent should automatically discover
// tools that are not explicitly assigned to it. Max tools is the maximum number of
// tools that can be discovered. Hints are optional hints for tool search. These
// are used in conjunction with the context-aware tool search and can help select
// the best tools for the task.
AutoDiscovery param.Field[ToolSelectionAutoDiscoveryParam] `json:"autoDiscovery"`
}
func (AgentVariationSpecToolSelectionParam) MarshalJSON ¶
func (r AgentVariationSpecToolSelectionParam) MarshalJSON() (data []byte, err error)
type AgentVariationUpdateParams ¶
type AgentVariationUpdateParams struct {
// UpdateResourceMetadata contains the user-provided fields for updating a
// workspace-scoped resource. Read-only fields (id, account_id, workspace_id,
// profile_id, created_at) are excluded since they are set by the server.
Metadata param.Field[shared.UpdateResourceMetadataParam] `json:"metadata"`
// AgentVariationSpec defines the operational configuration for a variation
Spec param.Field[AgentVariationSpecParam] `json:"spec"`
// Fields to update
UpdateMask param.Field[string] `json:"updateMask" format:"field-mask"`
}
func (AgentVariationUpdateParams) MarshalJSON ¶
func (r AgentVariationUpdateParams) MarshalJSON() (data []byte, err error)
type AgentWebhookDeliveryListParams ¶
type AgentWebhookDeliveryListParams struct {
// Pagination cursor from previous response
Cursor param.Field[string] `query:"cursor"`
// Optional filter by event type
EventType param.Field[AgentWebhookDeliveryListParamsEventType] `query:"eventType"`
// Maximum number of results to return
Limit param.Field[int64] `query:"limit"`
// Optional filter by objective ID
ObjectiveID param.Field[string] `query:"objectiveId"`
}
func (AgentWebhookDeliveryListParams) URLQuery ¶
func (r AgentWebhookDeliveryListParams) URLQuery() (v url.Values)
URLQuery serializes AgentWebhookDeliveryListParams's query parameters as `url.Values`.
type AgentWebhookDeliveryListParamsEventType ¶
type AgentWebhookDeliveryListParamsEventType string
Optional filter by event type
const ( AgentWebhookDeliveryListParamsEventTypeObjectiveEventTypeUnspecified AgentWebhookDeliveryListParamsEventType = "OBJECTIVE_EVENT_TYPE_UNSPECIFIED" AgentWebhookDeliveryListParamsEventTypeObjectiveEventTypeUserMessage AgentWebhookDeliveryListParamsEventType = "OBJECTIVE_EVENT_TYPE_USER_MESSAGE" AgentWebhookDeliveryListParamsEventTypeObjectiveEventTypeToolApprovalRequested AgentWebhookDeliveryListParamsEventType = "OBJECTIVE_EVENT_TYPE_TOOL_APPROVAL_REQUESTED" AgentWebhookDeliveryListParamsEventTypeObjectiveEventTypeToolApproved AgentWebhookDeliveryListParamsEventType = "OBJECTIVE_EVENT_TYPE_TOOL_APPROVED" AgentWebhookDeliveryListParamsEventTypeObjectiveEventTypeToolDenied AgentWebhookDeliveryListParamsEventType = "OBJECTIVE_EVENT_TYPE_TOOL_DENIED" AgentWebhookDeliveryListParamsEventTypeObjectiveEventTypeToolCalled AgentWebhookDeliveryListParamsEventType = "OBJECTIVE_EVENT_TYPE_TOOL_CALLED" AgentWebhookDeliveryListParamsEventTypeObjectiveEventTypeSubObjectiveCreated AgentWebhookDeliveryListParamsEventType = "OBJECTIVE_EVENT_TYPE_SUB_OBJECTIVE_CREATED" AgentWebhookDeliveryListParamsEventTypeObjectiveEventTypeError AgentWebhookDeliveryListParamsEventType = "OBJECTIVE_EVENT_TYPE_ERROR" AgentWebhookDeliveryListParamsEventTypeObjectiveEventTypeAssistantMessage AgentWebhookDeliveryListParamsEventType = "OBJECTIVE_EVENT_TYPE_ASSISTANT_MESSAGE" AgentWebhookDeliveryListParamsEventTypeObjectiveEventTypeToolResult AgentWebhookDeliveryListParamsEventType = "OBJECTIVE_EVENT_TYPE_TOOL_RESULT" AgentWebhookDeliveryListParamsEventTypeObjectiveEventTypeToolError AgentWebhookDeliveryListParamsEventType = "OBJECTIVE_EVENT_TYPE_TOOL_ERROR" )
func (AgentWebhookDeliveryListParamsEventType) IsKnown ¶
func (r AgentWebhookDeliveryListParamsEventType) IsKnown() bool
type AgentWebhookDeliveryService ¶
type AgentWebhookDeliveryService struct {
Options []option.RequestOption
}
AgentService manages AI agents at the WORKSPACE level. Agents are workspace-scoped resources that define AI behavior and tool access. All operations are implicitly scoped to the workspace determined by the JWT token.
Authentication: Bearer token (JWT) Scope: Workspace-level operations
AgentWebhookDeliveryService contains methods and other services that help with interacting with the cadenya API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAgentWebhookDeliveryService method instead.
func NewAgentWebhookDeliveryService ¶
func NewAgentWebhookDeliveryService(opts ...option.RequestOption) (r *AgentWebhookDeliveryService)
NewAgentWebhookDeliveryService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*AgentWebhookDeliveryService) List ¶
func (r *AgentWebhookDeliveryService) List(ctx context.Context, agentID string, query AgentWebhookDeliveryListParams, opts ...option.RequestOption) (res *pagination.CursorPagination[WebhookDelivery], err error)
Lists all webhook deliveries for an agent
func (*AgentWebhookDeliveryService) ListAutoPaging ¶
func (r *AgentWebhookDeliveryService) ListAutoPaging(ctx context.Context, agentID string, query AgentWebhookDeliveryListParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[WebhookDelivery]
Lists all webhook deliveries for an agent
type AssistantMessage ¶
type AssistantMessage struct {
Content string `json:"content"`
ToolCalls []AssistantToolCall `json:"toolCalls"`
JSON assistantMessageJSON `json:"-"`
}
func (*AssistantMessage) UnmarshalJSON ¶
func (r *AssistantMessage) UnmarshalJSON(data []byte) (err error)
type AssistantToolCall ¶
type AssistantToolCall struct {
Arguments string `json:"arguments"`
FunctionName string `json:"functionName"`
// CallableTool is a union that represents a tool that can be called by an agent.
// In Cadenya, a tool that is used within an agent objective might be a
// user-defined tool (IE: MCP, HTTP), another Agent (useful to separate context),
// or a Cadenya Tool (one Cadenya provides).
Tool shared.CallableTool `json:"tool"`
JSON assistantToolCallJSON `json:"-"`
}
func (*AssistantToolCall) UnmarshalJSON ¶
func (r *AssistantToolCall) UnmarshalJSON(data []byte) (err error)
type BareMetadata ¶
type BareMetadata = shared.BareMetadata
BareMetadata contains the minimal metadata for a resource, including the ID. These are used sparingly in Cadenya for resources where the full metadata is not needed. You will come across them in list responses and other places where the full metadata is not required like listing the tools that were assigned to an objective. Because these types records are commonly created by other processes in Cadenya, they do not have things like external IDs, labels, or names.
This is an alias to an internal type.
type CallableTool ¶
type CallableTool = shared.CallableTool
CallableTool is a union that represents a tool that can be called by an agent. In Cadenya, a tool that is used within an agent objective might be a user-defined tool (IE: MCP, HTTP), another Agent (useful to separate context), or a Cadenya Tool (one Cadenya provides).
This is an alias to an internal type.
type Client ¶
type Client struct {
Options []option.RequestOption
// AccountService manages account-level operations. Accounts are the top-level
// organizational unit in the system. All operations are scoped to the
// authenticated account determined by the JWT token.
//
// Authentication: Bearer token (JWT) Scope: Account-level operations
Account *AccountService
// AgentService manages AI agents at the WORKSPACE level. Agents are
// workspace-scoped resources that define AI behavior and tool access. All
// operations are implicitly scoped to the workspace determined by the JWT token.
//
// Authentication: Bearer token (JWT) Scope: Workspace-level operations
Agents *AgentService
Objectives *ObjectiveService
// ModelService manages LLM models at the WORKSPACE level. Models represent
// available LLM providers and families (e.g., "anthropic/claude-sonnet-4.6").
// Models are seeded into workspaces and can be enabled or disabled. All operations
// are implicitly scoped to the workspace determined by the JWT token.
//
// Authentication: Bearer token (JWT) Scope: Workspace-level operations
Models *ModelService
Search *SearchService
// ToolService manages tool sets and tools at the WORKSPACE level. Tool sets group
// related tools, and tools define specific capabilities for agents. All operations
// are implicitly scoped to the workspace determined by the JWT token.
//
// Note: When a ToolSet has managed=true, only API Key actors can modify its tools.
// Profile actors (humans) are restricted from modifying managed tool sets.
//
// Authentication: Bearer token (JWT) Scope: Workspace-level operations
ToolSets *ToolSetService
// APIKeyService manages workspace-scoped API Keys. Each API key belongs to a
// single workspace, ensuring isolation between environments.
//
// Authentication: Bearer token (JWT) Scope: Workspace-level operations
APIKeys *APIKeyService
WorkspaceSecrets *WorkspaceSecretService
// WorkspaceService manages workspaces at the ACCOUNT level. This service is
// responsible for creating and listing workspaces within an account. Workspaces
// provide organizational grouping for resources within an account.
//
// Authentication: Bearer token (JWT) Scope: Account-level operations (manages
// workspaces themselves, not resources within workspaces)
Workspaces *WorkspaceService
}
Client creates a struct with services and top level methods that help with interacting with the cadenya API. You should not instantiate this client directly, and instead use the NewClient method instead.
func NewClient ¶
func NewClient(opts ...option.RequestOption) (r *Client)
NewClient generates a new client with the default option read from the environment (CADENYA_API_KEY, CADENYA_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.
func (*Client) Delete ¶
func (r *Client) Delete(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error
Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Execute ¶
func (r *Client) Execute(ctx context.Context, method string, path string, params interface{}, res interface{}, opts ...option.RequestOption) error
Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.
If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.
The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.
If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.
Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.
The response body will be deserialized into the res variable, depending on its type:
- A pointer to a *http.Response is populated by the raw response.
- A pointer to a byte array will be populated with the contents of the request body.
- A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
- A nil value will not read the response body.
For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.
func (*Client) Get ¶
func (r *Client) Get(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error
Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Patch ¶
func (r *Client) Patch(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error
Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Post ¶
func (r *Client) Post(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error
Post makes a POST request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
type ConfigHTTP ¶
type ConfigHTTP struct {
RequestMethod ConfigHTTPRequestMethod `json:"requestMethod" api:"required"`
Headers map[string]string `json:"headers"`
Path string `json:"path"`
Query string `json:"query"`
RequestBodyContentType string `json:"requestBodyContentType"`
// These are only used when the request method is a POST, PUT, or PATCH
RequestBodyTemplate string `json:"requestBodyTemplate"`
// The tool name (commonly an "operation id" in OpenAPI specs) to call on the HTTP
// adapter. This is used to match the tool spec to the correct endpoint on the HTTP
// adapter. it will be derived from the name of the tool if not provided.
ToolName string `json:"toolName"`
JSON configHTTPJSON `json:"-"`
}
func (*ConfigHTTP) UnmarshalJSON ¶
func (r *ConfigHTTP) UnmarshalJSON(data []byte) (err error)
type ConfigHTTPParam ¶
type ConfigHTTPParam struct {
RequestMethod param.Field[ConfigHTTPRequestMethod] `json:"requestMethod" api:"required"`
Headers param.Field[map[string]string] `json:"headers"`
Path param.Field[string] `json:"path"`
Query param.Field[string] `json:"query"`
RequestBodyContentType param.Field[string] `json:"requestBodyContentType"`
// These are only used when the request method is a POST, PUT, or PATCH
RequestBodyTemplate param.Field[string] `json:"requestBodyTemplate"`
// The tool name (commonly an "operation id" in OpenAPI specs) to call on the HTTP
// adapter. This is used to match the tool spec to the correct endpoint on the HTTP
// adapter. it will be derived from the name of the tool if not provided.
ToolName param.Field[string] `json:"toolName"`
}
func (ConfigHTTPParam) MarshalJSON ¶
func (r ConfigHTTPParam) MarshalJSON() (data []byte, err error)
type ConfigHTTPRequestMethod ¶
type ConfigHTTPRequestMethod string
const ( ConfigHTTPRequestMethodGet ConfigHTTPRequestMethod = "GET" ConfigHTTPRequestMethodPost ConfigHTTPRequestMethod = "POST" ConfigHTTPRequestMethodPut ConfigHTTPRequestMethod = "PUT" ConfigHTTPRequestMethodPatch ConfigHTTPRequestMethod = "PATCH" ConfigHTTPRequestMethodDelete ConfigHTTPRequestMethod = "DELETE" )
func (ConfigHTTPRequestMethod) IsKnown ¶
func (r ConfigHTTPRequestMethod) IsKnown() bool
type ConfigMcp ¶
type ConfigMcp struct {
ToolDescription string `json:"toolDescription"`
ToolName string `json:"toolName"`
ToolTitle string `json:"toolTitle"`
JSON configMcpJSON `json:"-"`
}
func (*ConfigMcp) UnmarshalJSON ¶
type ConfigMcpParam ¶
type ConfigMcpParam struct {
ToolDescription param.Field[string] `json:"toolDescription"`
ToolName param.Field[string] `json:"toolName"`
ToolTitle param.Field[string] `json:"toolTitle"`
}
func (ConfigMcpParam) MarshalJSON ¶
func (r ConfigMcpParam) MarshalJSON() (data []byte, err error)
type CreateOperationMetadataParam ¶
type CreateOperationMetadataParam = shared.CreateOperationMetadataParam
CreateOperationMetadata contains the user-provided fields for creating an operation. Read-only fields (id, account_id, workspace_id, created_at, profile_id) are excluded since they are set by the server.
This is an alias to an internal type.
type CreateResourceMetadataParam ¶
type CreateResourceMetadataParam = shared.CreateResourceMetadataParam
CreateResourceMetadata contains the user-provided fields for creating a workspace-scoped resource. Read-only fields (id, account_id, workspace_id, profile_id, created_at) are excluded since they are set by the server.
This is an alias to an internal type.
type McpToolFilter ¶
type McpToolFilter struct {
Operator McpToolFilterOperator `json:"operator" api:"required"`
Filters []McpToolFilterFilter `json:"filters"`
JSON mcpToolFilterJSON `json:"-"`
}
Top-level filter with simple boolean logic (no nesting)
func (*McpToolFilter) UnmarshalJSON ¶
func (r *McpToolFilter) UnmarshalJSON(data []byte) (err error)
type McpToolFilterFilter ¶
type McpToolFilterFilter struct {
Attribute McpToolFilterFiltersAttribute `json:"attribute" api:"required"`
// String matching operations
Matcher McpToolFilterFiltersMatcher `json:"matcher"`
JSON mcpToolFilterFilterJSON `json:"-"`
}
Single attribute filter
func (*McpToolFilterFilter) UnmarshalJSON ¶
func (r *McpToolFilterFilter) UnmarshalJSON(data []byte) (err error)
type McpToolFilterFilterParam ¶
type McpToolFilterFilterParam struct {
Attribute param.Field[McpToolFilterFiltersAttribute] `json:"attribute" api:"required"`
// String matching operations
Matcher param.Field[McpToolFilterFiltersMatcherParam] `json:"matcher"`
}
Single attribute filter
func (McpToolFilterFilterParam) MarshalJSON ¶
func (r McpToolFilterFilterParam) MarshalJSON() (data []byte, err error)
type McpToolFilterFiltersAttribute ¶
type McpToolFilterFiltersAttribute string
const ( McpToolFilterFiltersAttributeAttributeUnspecified McpToolFilterFiltersAttribute = "ATTRIBUTE_UNSPECIFIED" McpToolFilterFiltersAttributeAttributeName McpToolFilterFiltersAttribute = "ATTRIBUTE_NAME" McpToolFilterFiltersAttributeAttributeTitle McpToolFilterFiltersAttribute = "ATTRIBUTE_TITLE" McpToolFilterFiltersAttributeAttributeDescription McpToolFilterFiltersAttribute = "ATTRIBUTE_DESCRIPTION" )
func (McpToolFilterFiltersAttribute) IsKnown ¶
func (r McpToolFilterFiltersAttribute) IsKnown() bool
type McpToolFilterFiltersMatcher ¶
type McpToolFilterFiltersMatcher struct {
CaseSensitive bool `json:"caseSensitive"`
Contains string `json:"contains"`
EndsWith string `json:"endsWith"`
Exact string `json:"exact"`
Regex string `json:"regex"`
StartsWith string `json:"startsWith"`
JSON mcpToolFilterFiltersMatcherJSON `json:"-"`
}
String matching operations
func (*McpToolFilterFiltersMatcher) UnmarshalJSON ¶
func (r *McpToolFilterFiltersMatcher) UnmarshalJSON(data []byte) (err error)
type McpToolFilterFiltersMatcherParam ¶
type McpToolFilterFiltersMatcherParam struct {
CaseSensitive param.Field[bool] `json:"caseSensitive"`
Contains param.Field[string] `json:"contains"`
EndsWith param.Field[string] `json:"endsWith"`
Exact param.Field[string] `json:"exact"`
Regex param.Field[string] `json:"regex"`
StartsWith param.Field[string] `json:"startsWith"`
}
String matching operations
func (McpToolFilterFiltersMatcherParam) MarshalJSON ¶
func (r McpToolFilterFiltersMatcherParam) MarshalJSON() (data []byte, err error)
type McpToolFilterOperator ¶
type McpToolFilterOperator string
const ( McpToolFilterOperatorOperatorUnspecified McpToolFilterOperator = "OPERATOR_UNSPECIFIED" McpToolFilterOperatorOperatorAnd McpToolFilterOperator = "OPERATOR_AND" McpToolFilterOperatorOperatorOr McpToolFilterOperator = "OPERATOR_OR" )
func (McpToolFilterOperator) IsKnown ¶
func (r McpToolFilterOperator) IsKnown() bool
type McpToolFilterParam ¶
type McpToolFilterParam struct {
Operator param.Field[McpToolFilterOperator] `json:"operator" api:"required"`
Filters param.Field[[]McpToolFilterFilterParam] `json:"filters"`
}
Top-level filter with simple boolean logic (no nesting)
func (McpToolFilterParam) MarshalJSON ¶
func (r McpToolFilterParam) MarshalJSON() (data []byte, err error)
type Model ¶
type Model struct {
// Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
Metadata shared.ResourceMetadata `json:"metadata" api:"required"`
// Model specification
Spec ModelSpec `json:"spec" api:"required"`
JSON modelJSON `json:"-"`
}
func (*Model) UnmarshalJSON ¶
type ModelListParams ¶
type ModelListParams struct {
// Pagination cursor from previous response
Cursor param.Field[string] `query:"cursor"`
// Maximum number of results to return
Limit param.Field[int64] `query:"limit"`
// Filter by name prefix
Prefix param.Field[string] `query:"prefix"`
// Sort order for results (asc or desc by creation time)
SortOrder param.Field[string] `query:"sortOrder"`
// Filter by model status
Status param.Field[ModelListParamsStatus] `query:"status"`
}
func (ModelListParams) URLQuery ¶
func (r ModelListParams) URLQuery() (v url.Values)
URLQuery serializes ModelListParams's query parameters as `url.Values`.
type ModelListParamsStatus ¶
type ModelListParamsStatus string
Filter by model status
const ( ModelListParamsStatusModelStatusUnspecified ModelListParamsStatus = "MODEL_STATUS_UNSPECIFIED" ModelListParamsStatusModelStatusEnabled ModelListParamsStatus = "MODEL_STATUS_ENABLED" ModelListParamsStatusModelStatusDisabled ModelListParamsStatus = "MODEL_STATUS_DISABLED" )
func (ModelListParamsStatus) IsKnown ¶
func (r ModelListParamsStatus) IsKnown() bool
type ModelService ¶
type ModelService struct {
Options []option.RequestOption
}
ModelService manages LLM models at the WORKSPACE level. Models represent available LLM providers and families (e.g., "anthropic/claude-sonnet-4.6"). Models are seeded into workspaces and can be enabled or disabled. All operations are implicitly scoped to the workspace determined by the JWT token.
Authentication: Bearer token (JWT) Scope: Workspace-level operations
ModelService contains methods and other services that help with interacting with the cadenya API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewModelService method instead.
func NewModelService ¶
func NewModelService(opts ...option.RequestOption) (r *ModelService)
NewModelService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ModelService) Get ¶
func (r *ModelService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Model, err error)
Retrieves a model by ID from the workspace
func (*ModelService) List ¶
func (r *ModelService) List(ctx context.Context, query ModelListParams, opts ...option.RequestOption) (res *pagination.CursorPagination[Model], err error)
Lists all models in the workspace
func (*ModelService) ListAutoPaging ¶
func (r *ModelService) ListAutoPaging(ctx context.Context, query ModelListParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[Model]
Lists all models in the workspace
func (*ModelService) SetStatus ¶
func (r *ModelService) SetStatus(ctx context.Context, id string, body ModelSetStatusParams, opts ...option.RequestOption) (res *Model, err error)
Enables or disables a model in the workspace
type ModelSetStatusParams ¶
type ModelSetStatusParams struct {
// The new status for the model
Status param.Field[ModelSetStatusParamsStatus] `json:"status"`
}
func (ModelSetStatusParams) MarshalJSON ¶
func (r ModelSetStatusParams) MarshalJSON() (data []byte, err error)
type ModelSetStatusParamsStatus ¶
type ModelSetStatusParamsStatus string
The new status for the model
const ( ModelSetStatusParamsStatusModelStatusUnspecified ModelSetStatusParamsStatus = "MODEL_STATUS_UNSPECIFIED" ModelSetStatusParamsStatusModelStatusEnabled ModelSetStatusParamsStatus = "MODEL_STATUS_ENABLED" ModelSetStatusParamsStatusModelStatusDisabled ModelSetStatusParamsStatus = "MODEL_STATUS_DISABLED" )
func (ModelSetStatusParamsStatus) IsKnown ¶
func (r ModelSetStatusParamsStatus) IsKnown() bool
type ModelSpec ¶
type ModelSpec struct {
// The model family (e.g., "claude-sonnet-4.6", "gpt-5.4", "gemini-2.5-flash")
Family string `json:"family"`
// Cost per million input tokens in cents (e.g., 300 = $3.00)
InputPricePerMillionTokens string `json:"inputPricePerMillionTokens"`
// Maximum number of input tokens the model supports
MaxInputTokens int64 `json:"maxInputTokens"`
// Maximum number of output tokens the model can generate
MaxOutputTokens int64 `json:"maxOutputTokens"`
// Cost per million output tokens in cents (e.g., 1500 = $15.00)
OutputPricePerMillionTokens string `json:"outputPricePerMillionTokens"`
// The model provider (e.g., "anthropic", "openai", "google")
Provider string `json:"provider"`
// The status of the model in the workspace
Status ModelSpecStatus `json:"status"`
JSON modelSpecJSON `json:"-"`
}
func (*ModelSpec) UnmarshalJSON ¶
type ModelSpecStatus ¶
type ModelSpecStatus string
The status of the model in the workspace
const ( ModelSpecStatusModelStatusUnspecified ModelSpecStatus = "MODEL_STATUS_UNSPECIFIED" ModelSpecStatusModelStatusEnabled ModelSpecStatus = "MODEL_STATUS_ENABLED" ModelSpecStatusModelStatusDisabled ModelSpecStatus = "MODEL_STATUS_DISABLED" )
func (ModelSpecStatus) IsKnown ¶
func (r ModelSpecStatus) IsKnown() bool
type Objective ¶
type Objective struct {
Data ObjectiveData `json:"data" api:"required"`
// Metadata for ephemeral operations and activities (e.g., objectives, executions,
// runs)
Metadata shared.OperationMetadata `json:"metadata" api:"required"`
Status ObjectiveStatus `json:"status" api:"required"`
// ObjectiveInfo provides read-only aggregated statistics about an objective's
// execution
Info ObjectiveInfo `json:"info"`
// Read-only list of the last five windows of execution for this objective, ordered
// by most recent first. Is only included in singular RPC calls (GetObjective, for
// example).
LastFiveWindows []ObjectiveContextWindow `json:"lastFiveWindows"`
JSON objectiveJSON `json:"-"`
}
func (*Objective) UnmarshalJSON ¶
type ObjectiveCancelParams ¶
type ObjectiveCancelParams struct {
// Optional reason for cancellation
Reason param.Field[string] `json:"reason"`
}
func (ObjectiveCancelParams) MarshalJSON ¶
func (r ObjectiveCancelParams) MarshalJSON() (data []byte, err error)
type ObjectiveContextWindow ¶
type ObjectiveContextWindow struct {
Data ObjectiveContextWindowData `json:"data" api:"required"`
// Metadata for ephemeral operations and activities (e.g., objectives, executions,
// runs)
Metadata shared.OperationMetadata `json:"metadata" api:"required"`
Info ObjectiveContextWindowInfo `json:"info"`
JSON objectiveContextWindowJSON `json:"-"`
}
ObjectiveContextWindow is a window of chat completions that is grouped together to prevent context-window overflows. Context windows also allow agents to compact their windows and carry on into a new one.
func (*ObjectiveContextWindow) UnmarshalJSON ¶
func (r *ObjectiveContextWindow) UnmarshalJSON(data []byte) (err error)
type ObjectiveContextWindowData ¶
type ObjectiveContextWindowData struct {
// A calculated value for how many completion tokens (output tokens) have been used
// in this context window
CompletionTokens int64 `json:"completionTokens"`
// The objective's ID that this window belongs to
ObjectiveID string `json:"objectiveId"`
// The instructions for this window to continue from a previous window's chat
// history.
PreviousWindowContinueInstructions string `json:"previousWindowContinueInstructions"`
// A calculated value for how many prompt tokens (input tokens) have been used in
// this context window
PromptTokens int64 `json:"promptTokens"`
// sequence is a numeric representation of which context window this is. Sequences
// are useful to perform a max(sequence) on in order to calculate how many context
// windows an objective has.
Sequence int64 `json:"sequence"`
JSON objectiveContextWindowDataJSON `json:"-"`
}
func (*ObjectiveContextWindowData) UnmarshalJSON ¶
func (r *ObjectiveContextWindowData) UnmarshalJSON(data []byte) (err error)
type ObjectiveContextWindowInfo ¶
type ObjectiveContextWindowInfo struct {
// Profile represents a human user at the account level. Profiles are
// account-scoped resources that can be associated with multiple workspaces through
// the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS).
CreatedBy shared.Profile `json:"createdBy"`
// Metadata for ephemeral operations and activities (e.g., objectives, executions,
// runs)
Objective shared.OperationMetadata `json:"objective"`
JSON objectiveContextWindowInfoJSON `json:"-"`
}
func (*ObjectiveContextWindowInfo) UnmarshalJSON ¶
func (r *ObjectiveContextWindowInfo) UnmarshalJSON(data []byte) (err error)
type ObjectiveContinueParams ¶
type ObjectiveContinueParams struct {
// When set to true, the message will be enqueued for when the agent loop is
// available to process it.
Enqueue param.Field[bool] `json:"enqueue"`
// The message to continue an objective that has completed (or you are enqueing)
Message param.Field[string] `json:"message"`
// Secrets that should be included with the message. Helpful for when you need to
// update secrets on the objective (IE: A secret expires and needs to be refreshed)
Secrets param.Field[[]ObjectiveContinueParamsSecret] `json:"secrets"`
}
func (ObjectiveContinueParams) MarshalJSON ¶
func (r ObjectiveContinueParams) MarshalJSON() (data []byte, err error)
type ObjectiveContinueParamsSecret ¶
type ObjectiveContinueParamsSecret struct {
Name param.Field[string] `json:"name"`
Value param.Field[string] `json:"value"`
}
func (ObjectiveContinueParamsSecret) MarshalJSON ¶
func (r ObjectiveContinueParamsSecret) MarshalJSON() (data []byte, err error)
type ObjectiveContinueResponse ¶
type ObjectiveContinueResponse struct {
Data ObjectiveEventData `json:"data" api:"required"`
// Metadata for ephemeral operations and activities (e.g., objectives, executions,
// runs)
Metadata shared.OperationMetadata `json:"metadata" api:"required"`
ContextWindowID string `json:"contextWindowId"`
Info ObjectiveEventInfo `json:"info"`
JSON objectiveContinueResponseJSON `json:"-"`
}
func (*ObjectiveContinueResponse) UnmarshalJSON ¶
func (r *ObjectiveContinueResponse) UnmarshalJSON(data []byte) (err error)
type ObjectiveData ¶
type ObjectiveData struct {
// Agent resource
Agent Agent `json:"agent"`
// Represents a dynamically typed value which can be either null, a number, a
// string, a boolean, a recursive struct value, or a list of values.
Data interface{} `json:"data"`
// The initial message sent to the agent. This becomes the first user message in
// the LLM chat history.
InitialMessage string `json:"initialMessage"`
// A parent objective means the objective was spawned off using a separate agent to
// complete an objective
ParentObjectiveID string `json:"parentObjectiveId"`
// Secrets that can be used in the headers for tool calls using the secret
// interpolation format.
Secrets []ObjectiveDataSecret `json:"secrets"`
// system_prompt is read-only, derived from the selected variation's prompt
SystemPrompt string `json:"systemPrompt"`
// AgentVariation resource
Variation AgentVariation `json:"variation"`
JSON objectiveDataJSON `json:"-"`
}
func (*ObjectiveData) UnmarshalJSON ¶
func (r *ObjectiveData) UnmarshalJSON(data []byte) (err error)
type ObjectiveDataParam ¶
type ObjectiveDataParam struct {
// Represents a dynamically typed value which can be either null, a number, a
// string, a boolean, a recursive struct value, or a list of values.
Data param.Field[interface{}] `json:"data"`
// The initial message sent to the agent. This becomes the first user message in
// the LLM chat history.
InitialMessage param.Field[string] `json:"initialMessage"`
// Secrets that can be used in the headers for tool calls using the secret
// interpolation format.
Secrets param.Field[[]ObjectiveDataSecretParam] `json:"secrets"`
}
func (ObjectiveDataParam) MarshalJSON ¶
func (r ObjectiveDataParam) MarshalJSON() (data []byte, err error)
type ObjectiveDataSecret ¶
type ObjectiveDataSecret struct {
Name string `json:"name"`
Value string `json:"value"`
JSON objectiveDataSecretJSON `json:"-"`
}
func (*ObjectiveDataSecret) UnmarshalJSON ¶
func (r *ObjectiveDataSecret) UnmarshalJSON(data []byte) (err error)
type ObjectiveDataSecretParam ¶
type ObjectiveDataSecretParam struct {
Name param.Field[string] `json:"name"`
Value param.Field[string] `json:"value"`
}
func (ObjectiveDataSecretParam) MarshalJSON ¶
func (r ObjectiveDataSecretParam) MarshalJSON() (data []byte, err error)
type ObjectiveError ¶
type ObjectiveError struct {
Message string `json:"message"`
Type string `json:"type"`
JSON objectiveErrorJSON `json:"-"`
}
func (*ObjectiveError) UnmarshalJSON ¶
func (r *ObjectiveError) UnmarshalJSON(data []byte) (err error)
type ObjectiveEventData ¶
type ObjectiveEventData struct {
AssistantMessage AssistantMessage `json:"assistantMessage"`
Error ObjectiveError `json:"error"`
SubObjectiveCreated SubObjectiveCreated `json:"subObjectiveCreated"`
ToolApprovalRequested ToolApprovalRequested `json:"toolApprovalRequested"`
ToolApproved ToolApproved `json:"toolApproved"`
ToolCalled ToolCalled `json:"toolCalled"`
ToolDenied ToolDenied `json:"toolDenied"`
ToolError ToolError `json:"toolError"`
ToolResult ToolResult `json:"toolResult"`
Type string `json:"type"`
UserMessage UserMessage `json:"userMessage"`
JSON objectiveEventDataJSON `json:"-"`
}
func (*ObjectiveEventData) UnmarshalJSON ¶
func (r *ObjectiveEventData) UnmarshalJSON(data []byte) (err error)
type ObjectiveEventInfo ¶
type ObjectiveEventInfo struct {
// Profile represents a human user at the account level. Profiles are
// account-scoped resources that can be associated with multiple workspaces through
// the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS).
CreatedBy shared.Profile `json:"createdBy"`
// Metadata for ephemeral operations and activities (e.g., objectives, executions,
// runs)
Objective shared.OperationMetadata `json:"objective"`
JSON objectiveEventInfoJSON `json:"-"`
}
func (*ObjectiveEventInfo) UnmarshalJSON ¶
func (r *ObjectiveEventInfo) UnmarshalJSON(data []byte) (err error)
type ObjectiveInfo ¶
type ObjectiveInfo struct {
// List of callable tools assigned to the agent for this objective Includes tools,
// agents, and cadenya-provided tools from the agent's configuration
CallableTools []shared.CallableTool `json:"callableTools"`
// Profile represents a human user at the account level. Profiles are
// account-scoped resources that can be associated with multiple workspaces through
// the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS).
CreatedBy shared.Profile `json:"createdBy"`
// Total number of context windows that this objective has generated
TotalContextWindows int64 `json:"totalContextWindows"`
// Total number of events generated during this objective's execution
TotalEvents int64 `json:"totalEvents"`
// Total input tokens consumed across all LLM completions across all context
// windows
TotalInputTokens int64 `json:"totalInputTokens"`
// Total output tokens generated across all LLM completions across all context
// windows
TotalOutputTokens int64 `json:"totalOutputTokens"`
// Total number of tool calls made during execution
TotalToolCalls int64 `json:"totalToolCalls"`
JSON objectiveInfoJSON `json:"-"`
}
ObjectiveInfo provides read-only aggregated statistics about an objective's execution
func (*ObjectiveInfo) UnmarshalJSON ¶
func (r *ObjectiveInfo) UnmarshalJSON(data []byte) (err error)
type ObjectiveListContextWindowsParams ¶
type ObjectiveListContextWindowsParams struct {
// Pagination cursor from previous response
Cursor param.Field[string] `query:"cursor"`
// When set to true you may use more of your alloted API rate-limit
IncludeInfo param.Field[bool] `query:"includeInfo"`
// Maximum number of results to return
Limit param.Field[int64] `query:"limit"`
}
func (ObjectiveListContextWindowsParams) URLQuery ¶
func (r ObjectiveListContextWindowsParams) URLQuery() (v url.Values)
URLQuery serializes ObjectiveListContextWindowsParams's query parameters as `url.Values`.
type ObjectiveListEventsParams ¶
type ObjectiveListEventsParams struct {
// Pagination cursor from previous response
Cursor param.Field[string] `query:"cursor"`
// When set to true you may use more of your alloted API rate-limit
IncludeInfo param.Field[bool] `query:"includeInfo"`
// Maximum number of results to return
Limit param.Field[int64] `query:"limit"`
// Sort order for results (asc or desc by creation time)
SortOrder param.Field[string] `query:"sortOrder"`
// Optional context window ID to filter events by
WindowID param.Field[string] `query:"windowId"`
}
func (ObjectiveListEventsParams) URLQuery ¶
func (r ObjectiveListEventsParams) URLQuery() (v url.Values)
URLQuery serializes ObjectiveListEventsParams's query parameters as `url.Values`.
type ObjectiveListEventsResponse ¶
type ObjectiveListEventsResponse struct {
Data ObjectiveEventData `json:"data" api:"required"`
// Metadata for ephemeral operations and activities (e.g., objectives, executions,
// runs)
Metadata shared.OperationMetadata `json:"metadata" api:"required"`
ContextWindowID string `json:"contextWindowId"`
Info ObjectiveEventInfo `json:"info"`
JSON objectiveListEventsResponseJSON `json:"-"`
}
func (*ObjectiveListEventsResponse) UnmarshalJSON ¶
func (r *ObjectiveListEventsResponse) UnmarshalJSON(data []byte) (err error)
type ObjectiveListParams ¶
type ObjectiveListParams struct {
// Agent ID for filtering
AgentID param.Field[string] `query:"agentId"`
// Pagination cursor from previous response
Cursor param.Field[string] `query:"cursor"`
// When set to true you may use more of your alloted API rate-limit
IncludeInfo param.Field[bool] `query:"includeInfo"`
// Maximum number of results to return
Limit param.Field[int64] `query:"limit"`
// Optional filters
ParentObjectiveID param.Field[string] `query:"parentObjectiveId"`
ProfileID param.Field[string] `query:"profileId"`
// Sort order for results (asc or desc by creation time)
SortOrder param.Field[string] `query:"sortOrder"`
// Filter by state
State param.Field[ObjectiveListParamsState] `query:"state"`
}
func (ObjectiveListParams) URLQuery ¶
func (r ObjectiveListParams) URLQuery() (v url.Values)
URLQuery serializes ObjectiveListParams's query parameters as `url.Values`.
type ObjectiveListParamsState ¶
type ObjectiveListParamsState string
Filter by state
const ( ObjectiveListParamsStateStateUnspecified ObjectiveListParamsState = "STATE_UNSPECIFIED" ObjectiveListParamsStateStatePending ObjectiveListParamsState = "STATE_PENDING" ObjectiveListParamsStateStateRunning ObjectiveListParamsState = "STATE_RUNNING" ObjectiveListParamsStateStateCompleted ObjectiveListParamsState = "STATE_COMPLETED" ObjectiveListParamsStateStateFailed ObjectiveListParamsState = "STATE_FAILED" ObjectiveListParamsStateStateCancelled ObjectiveListParamsState = "STATE_CANCELLED" )
func (ObjectiveListParamsState) IsKnown ¶
func (r ObjectiveListParamsState) IsKnown() bool
type ObjectiveNewParams ¶
type ObjectiveNewParams struct {
AgentID param.Field[string] `json:"agentId" api:"required"`
Data param.Field[ObjectiveDataParam] `json:"data" api:"required"`
// CreateOperationMetadata contains the user-provided fields for creating an
// operation. Read-only fields (id, account_id, workspace_id, created_at,
// profile_id) are excluded since they are set by the server.
Metadata param.Field[shared.CreateOperationMetadataParam] `json:"metadata" api:"required"`
// Optional explicit variation selection. Overrides the agent's
// variation_selection_mode.
VariationID param.Field[string] `json:"variationId"`
}
func (ObjectiveNewParams) MarshalJSON ¶
func (r ObjectiveNewParams) MarshalJSON() (data []byte, err error)
type ObjectiveService ¶
type ObjectiveService struct {
Options []option.RequestOption
Tools *ObjectiveToolService
ToolCalls *ObjectiveToolCallService
Tasks *ObjectiveTaskService
}
ObjectiveService contains methods and other services that help with interacting with the cadenya API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewObjectiveService method instead.
func NewObjectiveService ¶
func NewObjectiveService(opts ...option.RequestOption) (r *ObjectiveService)
NewObjectiveService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ObjectiveService) Cancel ¶
func (r *ObjectiveService) Cancel(ctx context.Context, objectiveID string, body ObjectiveCancelParams, opts ...option.RequestOption) (res *Objective, err error)
Cancels a running or pending objective. The objective's state will be set to STATE_CANCELLED.
func (*ObjectiveService) Continue ¶
func (r *ObjectiveService) Continue(ctx context.Context, objectiveID string, body ObjectiveContinueParams, opts ...option.RequestOption) (res *ObjectiveContinueResponse, err error)
Continues an objective that has completed
func (*ObjectiveService) Get ¶
func (r *ObjectiveService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Objective, err error)
Retrieves an objective by ID from the workspace
func (*ObjectiveService) List ¶
func (r *ObjectiveService) List(ctx context.Context, query ObjectiveListParams, opts ...option.RequestOption) (res *pagination.CursorPagination[Objective], err error)
Lists all objectives in the workspace
func (*ObjectiveService) ListAutoPaging ¶
func (r *ObjectiveService) ListAutoPaging(ctx context.Context, query ObjectiveListParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[Objective]
Lists all objectives in the workspace
func (*ObjectiveService) ListContextWindows ¶
func (r *ObjectiveService) ListContextWindows(ctx context.Context, objectiveID string, query ObjectiveListContextWindowsParams, opts ...option.RequestOption) (res *pagination.CursorPagination[ObjectiveContextWindow], err error)
Read-only list of the last five windows of execution for this objective, ordered by most recent first
func (*ObjectiveService) ListContextWindowsAutoPaging ¶
func (r *ObjectiveService) ListContextWindowsAutoPaging(ctx context.Context, objectiveID string, query ObjectiveListContextWindowsParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[ObjectiveContextWindow]
Read-only list of the last five windows of execution for this objective, ordered by most recent first
func (*ObjectiveService) ListEvents ¶
func (r *ObjectiveService) ListEvents(ctx context.Context, objectiveID string, query ObjectiveListEventsParams, opts ...option.RequestOption) (res *pagination.CursorPagination[ObjectiveListEventsResponse], err error)
Lists all events for an objective
func (*ObjectiveService) ListEventsAutoPaging ¶
func (r *ObjectiveService) ListEventsAutoPaging(ctx context.Context, objectiveID string, query ObjectiveListEventsParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[ObjectiveListEventsResponse]
Lists all events for an objective
func (*ObjectiveService) New ¶
func (r *ObjectiveService) New(ctx context.Context, body ObjectiveNewParams, opts ...option.RequestOption) (res *Objective, err error)
Creates a new objective in the workspace
type ObjectiveStatus ¶
type ObjectiveStatus struct {
State ObjectiveStatusState `json:"state" api:"required"`
Message string `json:"message"`
JSON objectiveStatusJSON `json:"-"`
}
func (*ObjectiveStatus) UnmarshalJSON ¶
func (r *ObjectiveStatus) UnmarshalJSON(data []byte) (err error)
type ObjectiveStatusState ¶
type ObjectiveStatusState string
const ( ObjectiveStatusStateStateUnspecified ObjectiveStatusState = "STATE_UNSPECIFIED" ObjectiveStatusStateStatePending ObjectiveStatusState = "STATE_PENDING" ObjectiveStatusStateStateRunning ObjectiveStatusState = "STATE_RUNNING" ObjectiveStatusStateStateCompleted ObjectiveStatusState = "STATE_COMPLETED" ObjectiveStatusStateStateFailed ObjectiveStatusState = "STATE_FAILED" ObjectiveStatusStateStateCancelled ObjectiveStatusState = "STATE_CANCELLED" )
func (ObjectiveStatusState) IsKnown ¶
func (r ObjectiveStatusState) IsKnown() bool
type ObjectiveTask ¶
type ObjectiveTask struct {
Data ObjectiveTaskData `json:"data" api:"required"`
// BareMetadata contains the minimal metadata for a resource, including the ID.
// These are used sparingly in Cadenya for resources where the full metadata is not
// needed. You will come across them in list responses and other places where the
// full metadata is not required like listing the tools that were assigned to an
// objective. Because these types records are commonly created by other processes
// in Cadenya, they do not have things like external IDs, labels, or names.
Metadata shared.BareMetadata `json:"metadata" api:"required"`
JSON objectiveTaskJSON `json:"-"`
}
ObjectiveTask represents a task within an objective, typically created and managed by an AI agent to track progress toward completing the objective.
func (*ObjectiveTask) UnmarshalJSON ¶
func (r *ObjectiveTask) UnmarshalJSON(data []byte) (err error)
type ObjectiveTaskData ¶
type ObjectiveTaskData struct {
// Description of the task to be completed
Task string `json:"task" api:"required"`
// Whether the task has been completed
Completed bool `json:"completed"`
// Timestamp when the task was marked as completed
CompletedAt time.Time `json:"completedAt" format:"date-time"`
// The sequential number of this task within the objective (auto-assigned, 1-based)
Number int64 `json:"number"`
JSON objectiveTaskDataJSON `json:"-"`
}
func (*ObjectiveTaskData) UnmarshalJSON ¶
func (r *ObjectiveTaskData) UnmarshalJSON(data []byte) (err error)
type ObjectiveTaskListParams ¶
type ObjectiveTaskListParams struct {
// Pagination cursor from previous response
Cursor param.Field[string] `query:"cursor"`
// Maximum number of results to return
Limit param.Field[int64] `query:"limit"`
// Sort order for results
SortOrder param.Field[string] `query:"sortOrder"`
}
func (ObjectiveTaskListParams) URLQuery ¶
func (r ObjectiveTaskListParams) URLQuery() (v url.Values)
URLQuery serializes ObjectiveTaskListParams's query parameters as `url.Values`.
type ObjectiveTaskService ¶
type ObjectiveTaskService struct {
Options []option.RequestOption
}
ObjectiveTaskService contains methods and other services that help with interacting with the cadenya API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewObjectiveTaskService method instead.
func NewObjectiveTaskService ¶
func NewObjectiveTaskService(opts ...option.RequestOption) (r *ObjectiveTaskService)
NewObjectiveTaskService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ObjectiveTaskService) Get ¶
func (r *ObjectiveTaskService) Get(ctx context.Context, objectiveID string, id string, opts ...option.RequestOption) (res *ObjectiveTask, err error)
Retrieves a task by ID from an objective
func (*ObjectiveTaskService) List ¶
func (r *ObjectiveTaskService) List(ctx context.Context, objectiveID string, query ObjectiveTaskListParams, opts ...option.RequestOption) (res *pagination.CursorPagination[ObjectiveTask], err error)
Lists all tasks for an objective
func (*ObjectiveTaskService) ListAutoPaging ¶
func (r *ObjectiveTaskService) ListAutoPaging(ctx context.Context, objectiveID string, query ObjectiveTaskListParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[ObjectiveTask]
Lists all tasks for an objective
type ObjectiveTool ¶
type ObjectiveTool struct {
// BareMetadata contains the minimal metadata for a resource, including the ID.
// These are used sparingly in Cadenya for resources where the full metadata is not
// needed. You will come across them in list responses and other places where the
// full metadata is not required like listing the tools that were assigned to an
// objective. Because these types records are commonly created by other processes
// in Cadenya, they do not have things like external IDs, labels, or names.
Metadata shared.BareMetadata `json:"metadata" api:"required"`
// Snapshot of the tool at the time it was assigned to the objective. Because tools
// can change over time, snapshots are used to ensure tools don't change
// unexpectedly during an objective's lifecycle.
Snapshot Tool `json:"snapshot"`
JSON objectiveToolJSON `json:"-"`
}
ObjectiveTool represents a tool that was assigned to an objective.
func (*ObjectiveTool) UnmarshalJSON ¶
func (r *ObjectiveTool) UnmarshalJSON(data []byte) (err error)
type ObjectiveToolCall ¶
type ObjectiveToolCall struct {
Data ObjectiveToolCallData `json:"data" api:"required"`
// Metadata for ephemeral operations and activities (e.g., objectives, executions,
// runs)
Metadata shared.OperationMetadata `json:"metadata" api:"required"`
// Current status of the tool call
Status ObjectiveToolCallStatus `json:"status" api:"required"`
Info ObjectiveToolCallInfo `json:"info"`
JSON objectiveToolCallJSON `json:"-"`
}
ObjectiveToolCall is a record of a tool call made during an objective's execution. Tool calls are mutable — their status changes as they are approved, denied, or executed.
func (*ObjectiveToolCall) UnmarshalJSON ¶
func (r *ObjectiveToolCall) UnmarshalJSON(data []byte) (err error)
type ObjectiveToolCallApproveParams ¶
type ObjectiveToolCallApproveParams struct {
}
func (ObjectiveToolCallApproveParams) MarshalJSON ¶
func (r ObjectiveToolCallApproveParams) MarshalJSON() (data []byte, err error)
type ObjectiveToolCallData ¶
type ObjectiveToolCallData struct {
// CallableTool is a union that represents a tool that can be called by an agent.
// In Cadenya, a tool that is used within an agent objective might be a
// user-defined tool (IE: MCP, HTTP), another Agent (useful to separate context),
// or a Cadenya Tool (one Cadenya provides).
Callable shared.CallableTool `json:"callable" api:"required"`
// The arguments passed to the tool
Arguments map[string]interface{} `json:"arguments"`
// A memo supplied by the reviewer when denying the tool call
Memo string `json:"memo"`
// The result content returned by the tool after execution
Result string `json:"result"`
// Profile represents a human user at the account level. Profiles are
// account-scoped resources that can be associated with multiple workspaces through
// the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS).
StatusChangedBy shared.Profile `json:"statusChangedBy"`
JSON objectiveToolCallDataJSON `json:"-"`
}
func (*ObjectiveToolCallData) UnmarshalJSON ¶
func (r *ObjectiveToolCallData) UnmarshalJSON(data []byte) (err error)
type ObjectiveToolCallDenyParams ¶
type ObjectiveToolCallDenyParams struct {
// A memo to associate to the tool call denial. Use a memo to steer the LLM to a
// different decision or usage of the tool.
Memo param.Field[string] `json:"memo"`
}
func (ObjectiveToolCallDenyParams) MarshalJSON ¶
func (r ObjectiveToolCallDenyParams) MarshalJSON() (data []byte, err error)
type ObjectiveToolCallInfo ¶
type ObjectiveToolCallInfo struct {
// Profile represents a human user at the account level. Profiles are
// account-scoped resources that can be associated with multiple workspaces through
// the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS).
CreatedBy shared.Profile `json:"createdBy"`
// Metadata for ephemeral operations and activities (e.g., objectives, executions,
// runs)
Objective shared.OperationMetadata `json:"objective"`
JSON objectiveToolCallInfoJSON `json:"-"`
}
func (*ObjectiveToolCallInfo) UnmarshalJSON ¶
func (r *ObjectiveToolCallInfo) UnmarshalJSON(data []byte) (err error)
type ObjectiveToolCallListParams ¶
type ObjectiveToolCallListParams struct {
// Pagination cursor from previous response
Cursor param.Field[string] `query:"cursor"`
// When set to true you may use more of your alloted API rate-limit
IncludeInfo param.Field[bool] `query:"includeInfo"`
// Maximum number of results to return
Limit param.Field[int64] `query:"limit"`
// Filter by tool call status
Status param.Field[ObjectiveToolCallListParamsStatus] `query:"status"`
}
func (ObjectiveToolCallListParams) URLQuery ¶
func (r ObjectiveToolCallListParams) URLQuery() (v url.Values)
URLQuery serializes ObjectiveToolCallListParams's query parameters as `url.Values`.
type ObjectiveToolCallListParamsStatus ¶
type ObjectiveToolCallListParamsStatus string
Filter by tool call status
const ( ObjectiveToolCallListParamsStatusToolCallStatusUnspecified ObjectiveToolCallListParamsStatus = "TOOL_CALL_STATUS_UNSPECIFIED" ObjectiveToolCallListParamsStatusToolCallStatusAutoApproved ObjectiveToolCallListParamsStatus = "TOOL_CALL_STATUS_AUTO_APPROVED" ObjectiveToolCallListParamsStatusToolCallStatusWaitingForApproval ObjectiveToolCallListParamsStatus = "TOOL_CALL_STATUS_WAITING_FOR_APPROVAL" ObjectiveToolCallListParamsStatusToolCallStatusApproved ObjectiveToolCallListParamsStatus = "TOOL_CALL_STATUS_APPROVED" ObjectiveToolCallListParamsStatusToolCallStatusDenied ObjectiveToolCallListParamsStatus = "TOOL_CALL_STATUS_DENIED" )
func (ObjectiveToolCallListParamsStatus) IsKnown ¶
func (r ObjectiveToolCallListParamsStatus) IsKnown() bool
type ObjectiveToolCallService ¶
type ObjectiveToolCallService struct {
Options []option.RequestOption
}
ObjectiveToolCallService contains methods and other services that help with interacting with the cadenya API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewObjectiveToolCallService method instead.
func NewObjectiveToolCallService ¶
func NewObjectiveToolCallService(opts ...option.RequestOption) (r *ObjectiveToolCallService)
NewObjectiveToolCallService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ObjectiveToolCallService) Approve ¶
func (r *ObjectiveToolCallService) Approve(ctx context.Context, objectiveID string, toolCallID string, body ObjectiveToolCallApproveParams, opts ...option.RequestOption) (res *ObjectiveToolCall, err error)
When an agent attempts to use a tool that requires approval, use this endpoint to mark it as approved.
func (*ObjectiveToolCallService) Deny ¶
func (r *ObjectiveToolCallService) Deny(ctx context.Context, objectiveID string, toolCallID string, body ObjectiveToolCallDenyParams, opts ...option.RequestOption) (res *ObjectiveToolCall, err error)
When an agent attempts to use a tool that requires approval, use this endpoint to mark it as denied. Use a memo to steer the LLM to a different decision or usage of the tool.
func (*ObjectiveToolCallService) List ¶
func (r *ObjectiveToolCallService) List(ctx context.Context, objectiveID string, query ObjectiveToolCallListParams, opts ...option.RequestOption) (res *pagination.CursorPagination[ObjectiveToolCall], err error)
Lists all tool calls for an objective
func (*ObjectiveToolCallService) ListAutoPaging ¶
func (r *ObjectiveToolCallService) ListAutoPaging(ctx context.Context, objectiveID string, query ObjectiveToolCallListParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[ObjectiveToolCall]
Lists all tool calls for an objective
type ObjectiveToolCallStatus ¶
type ObjectiveToolCallStatus string
Current status of the tool call
const ( ObjectiveToolCallStatusToolCallStatusUnspecified ObjectiveToolCallStatus = "TOOL_CALL_STATUS_UNSPECIFIED" ObjectiveToolCallStatusToolCallStatusAutoApproved ObjectiveToolCallStatus = "TOOL_CALL_STATUS_AUTO_APPROVED" ObjectiveToolCallStatusToolCallStatusWaitingForApproval ObjectiveToolCallStatus = "TOOL_CALL_STATUS_WAITING_FOR_APPROVAL" ObjectiveToolCallStatusToolCallStatusApproved ObjectiveToolCallStatus = "TOOL_CALL_STATUS_APPROVED" ObjectiveToolCallStatusToolCallStatusDenied ObjectiveToolCallStatus = "TOOL_CALL_STATUS_DENIED" )
func (ObjectiveToolCallStatus) IsKnown ¶
func (r ObjectiveToolCallStatus) IsKnown() bool
type ObjectiveToolListParams ¶
type ObjectiveToolListParams struct {
// Pagination cursor from previous response
Cursor param.Field[string] `query:"cursor"`
// Maximum number of results to return
Limit param.Field[int64] `query:"limit"`
}
func (ObjectiveToolListParams) URLQuery ¶
func (r ObjectiveToolListParams) URLQuery() (v url.Values)
URLQuery serializes ObjectiveToolListParams's query parameters as `url.Values`.
type ObjectiveToolService ¶
type ObjectiveToolService struct {
Options []option.RequestOption
}
ObjectiveToolService contains methods and other services that help with interacting with the cadenya API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewObjectiveToolService method instead.
func NewObjectiveToolService ¶
func NewObjectiveToolService(opts ...option.RequestOption) (r *ObjectiveToolService)
NewObjectiveToolService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ObjectiveToolService) List ¶
func (r *ObjectiveToolService) List(ctx context.Context, objectiveID string, query ObjectiveToolListParams, opts ...option.RequestOption) (res *pagination.CursorPagination[ObjectiveTool], err error)
Lists all tools that were assigned to an objective
func (*ObjectiveToolService) ListAutoPaging ¶
func (r *ObjectiveToolService) ListAutoPaging(ctx context.Context, objectiveID string, query ObjectiveToolListParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[ObjectiveTool]
Lists all tools that were assigned to an objective
type OperationMetadata ¶
type OperationMetadata = shared.OperationMetadata
Metadata for ephemeral operations and activities (e.g., objectives, executions, runs)
This is an alias to an internal type.
type Page ¶
type Page struct {
NextCursor string `json:"nextCursor"`
Total int64 `json:"total"`
JSON pageJSON `json:"-"`
}
func (*Page) UnmarshalJSON ¶
type Profile ¶
Profile represents a human user at the account level. Profiles are account-scoped resources that can be associated with multiple workspaces through the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS).
This is an alias to an internal type.
type ProfileParam ¶
type ProfileParam = shared.ProfileParam
Profile represents a human user at the account level. Profiles are account-scoped resources that can be associated with multiple workspaces through the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS).
This is an alias to an internal type.
type ProfileSpec ¶
type ProfileSpec = shared.ProfileSpec
ProfileSpec contains the profile-specific fields
This is an alias to an internal type.
type ProfileSpecParam ¶
type ProfileSpecParam = shared.ProfileSpecParam
ProfileSpec contains the profile-specific fields
This is an alias to an internal type.
type ProfileSpecType ¶
type ProfileSpecType = shared.ProfileSpecType
Type is the type of profile. User's are humans, API keys are computers. You know the deal.
This is an alias to an internal type.
type ResourceMetadata ¶
type ResourceMetadata = shared.ResourceMetadata
Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
This is an alias to an internal type.
type ResourceMetadataParam ¶
type ResourceMetadataParam = shared.ResourceMetadataParam
Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
This is an alias to an internal type.
type SearchSearchToolsOrToolSetsParams ¶
func (SearchSearchToolsOrToolSetsParams) URLQuery ¶
func (r SearchSearchToolsOrToolSetsParams) URLQuery() (v url.Values)
URLQuery serializes SearchSearchToolsOrToolSetsParams's query parameters as `url.Values`.
type SearchSearchToolsOrToolSetsResponse ¶
type SearchSearchToolsOrToolSetsResponse struct {
Agents []Agent `json:"agents"`
Tools []Tool `json:"tools"`
ToolSets []ToolSet `json:"toolSets"`
JSON searchSearchToolsOrToolSetsResponseJSON `json:"-"`
}
func (*SearchSearchToolsOrToolSetsResponse) UnmarshalJSON ¶
func (r *SearchSearchToolsOrToolSetsResponse) UnmarshalJSON(data []byte) (err error)
type SearchService ¶
type SearchService struct {
Options []option.RequestOption
}
SearchService contains methods and other services that help with interacting with the cadenya API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSearchService method instead.
func NewSearchService ¶
func NewSearchService(opts ...option.RequestOption) (r *SearchService)
NewSearchService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SearchService) SearchToolsOrToolSets ¶
func (r *SearchService) SearchToolsOrToolSets(ctx context.Context, query SearchSearchToolsOrToolSetsParams, opts ...option.RequestOption) (res *SearchSearchToolsOrToolSetsResponse, err error)
Searches for tools or tool sets in the workspace
type SubObjectiveCreated ¶
type SubObjectiveCreated struct {
// Metadata for ephemeral operations and activities (e.g., objectives, executions,
// runs)
Metadata shared.OperationMetadata `json:"metadata"`
JSON subObjectiveCreatedJSON `json:"-"`
}
func (*SubObjectiveCreated) UnmarshalJSON ¶
func (r *SubObjectiveCreated) UnmarshalJSON(data []byte) (err error)
type SyncCompleted ¶
type SyncCompleted struct {
// Optional message with additional details
Message string `json:"message"`
// Number of tools synced
ToolsSynced int64 `json:"toolsSynced"`
JSON syncCompletedJSON `json:"-"`
}
SyncCompleted is emitted when a tool set sync operation completes successfully
func (*SyncCompleted) UnmarshalJSON ¶
func (r *SyncCompleted) UnmarshalJSON(data []byte) (err error)
type SyncFailed ¶
type SyncFailed struct {
// Indicates this is an error event
Error bool `json:"error"`
// Optional error type/code for programmatic handling
ErrorType string `json:"errorType"`
// Error message describing what went wrong
Message string `json:"message"`
JSON syncFailedJSON `json:"-"`
}
SyncFailed is emitted when a tool set sync operation fails
func (*SyncFailed) UnmarshalJSON ¶
func (r *SyncFailed) UnmarshalJSON(data []byte) (err error)
type SyncStarted ¶
type SyncStarted struct {
// Timestamp when the sync was initiated
Message string `json:"message"`
JSON syncStartedJSON `json:"-"`
}
SyncStarted is emitted when a tool set sync operation begins
func (*SyncStarted) UnmarshalJSON ¶
func (r *SyncStarted) UnmarshalJSON(data []byte) (err error)
type Tool ¶
type Tool struct {
// Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
Metadata shared.ResourceMetadata `json:"metadata" api:"required"`
Spec ToolSpec `json:"spec" api:"required"`
Info ToolInfo `json:"info"`
JSON toolJSON `json:"-"`
}
func (*Tool) UnmarshalJSON ¶
type ToolApprovalRequested ¶
type ToolApprovalRequested struct {
// The ID of the objective tool call record. Use this ID with the ApproveToolCall
// or DenyToolCall RPCs to approve or deny the tool call.
ToolCallID string `json:"toolCallId"`
JSON toolApprovalRequestedJSON `json:"-"`
}
func (*ToolApprovalRequested) UnmarshalJSON ¶
func (r *ToolApprovalRequested) UnmarshalJSON(data []byte) (err error)
type ToolApproved ¶
type ToolApproved struct {
// The ID of the objective tool call record that was approved via the
// ApproveToolCall RPC.
ToolCallID string `json:"toolCallId"`
JSON toolApprovedJSON `json:"-"`
}
func (*ToolApproved) UnmarshalJSON ¶
func (r *ToolApproved) UnmarshalJSON(data []byte) (err error)
type ToolCalled ¶
type ToolCalled struct {
// The ID of the objective tool call record that was executed.
ToolCallID string `json:"toolCallId"`
JSON toolCalledJSON `json:"-"`
}
func (*ToolCalled) UnmarshalJSON ¶
func (r *ToolCalled) UnmarshalJSON(data []byte) (err error)
type ToolDenied ¶
type ToolDenied struct {
// The memo provided by the reviewer when denying the tool call. This is passed to
// the agent to provide further instructions.
Memo string `json:"memo"`
// The ID of the objective tool call record that was denied via the DenyToolCall
// RPC.
ToolCallID string `json:"toolCallId"`
JSON toolDeniedJSON `json:"-"`
}
func (*ToolDenied) UnmarshalJSON ¶
func (r *ToolDenied) UnmarshalJSON(data []byte) (err error)
type ToolError ¶
type ToolError struct {
Message string `json:"message"`
// The ID of the objective tool call record that encountered an error during
// execution.
ToolCallID string `json:"toolCallId"`
JSON toolErrorJSON `json:"-"`
}
func (*ToolError) UnmarshalJSON ¶
type ToolInfo ¶
type ToolInfo struct {
// Profile represents a human user at the account level. Profiles are
// account-scoped resources that can be associated with multiple workspaces through
// the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS).
CreatedBy shared.Profile `json:"createdBy"`
// Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
ToolSet shared.ResourceMetadata `json:"toolSet"`
JSON toolInfoJSON `json:"-"`
}
func (*ToolInfo) UnmarshalJSON ¶
type ToolResult ¶
type ToolResult struct {
Content string `json:"content"`
ToolCallID string `json:"toolCallId"`
JSON toolResultJSON `json:"-"`
}
func (*ToolResult) UnmarshalJSON ¶
func (r *ToolResult) UnmarshalJSON(data []byte) (err error)
type ToolSelectionAssignedTools ¶
type ToolSelectionAssignedTools struct {
AllowDiscovery bool `json:"allowDiscovery"`
JSON toolSelectionAssignedToolsJSON `json:"-"`
}
AssignedTools is used to indicate that the agent should only use the tools/tool sets that are explicitly assigned to it. Allow discovery is used when the agent thinks it needs to discover more tools.
func (*ToolSelectionAssignedTools) UnmarshalJSON ¶
func (r *ToolSelectionAssignedTools) UnmarshalJSON(data []byte) (err error)
type ToolSelectionAssignedToolsParam ¶
type ToolSelectionAssignedToolsParam struct {
AllowDiscovery param.Field[bool] `json:"allowDiscovery"`
}
AssignedTools is used to indicate that the agent should only use the tools/tool sets that are explicitly assigned to it. Allow discovery is used when the agent thinks it needs to discover more tools.
func (ToolSelectionAssignedToolsParam) MarshalJSON ¶
func (r ToolSelectionAssignedToolsParam) MarshalJSON() (data []byte, err error)
type ToolSelectionAutoDiscovery ¶
type ToolSelectionAutoDiscovery struct {
Hints []string `json:"hints"`
MaxTools int64 `json:"maxTools"`
JSON toolSelectionAutoDiscoveryJSON `json:"-"`
}
AutoDiscovery is used to indicate that the agent should automatically discover tools that are not explicitly assigned to it. Max tools is the maximum number of tools that can be discovered. Hints are optional hints for tool search. These are used in conjunction with the context-aware tool search and can help select the best tools for the task.
func (*ToolSelectionAutoDiscovery) UnmarshalJSON ¶
func (r *ToolSelectionAutoDiscovery) UnmarshalJSON(data []byte) (err error)
type ToolSelectionAutoDiscoveryParam ¶
type ToolSelectionAutoDiscoveryParam struct {
Hints param.Field[[]string] `json:"hints"`
MaxTools param.Field[int64] `json:"maxTools"`
}
AutoDiscovery is used to indicate that the agent should automatically discover tools that are not explicitly assigned to it. Max tools is the maximum number of tools that can be discovered. Hints are optional hints for tool search. These are used in conjunction with the context-aware tool search and can help select the best tools for the task.
func (ToolSelectionAutoDiscoveryParam) MarshalJSON ¶
func (r ToolSelectionAutoDiscoveryParam) MarshalJSON() (data []byte, err error)
type ToolSet ¶
type ToolSet struct {
// Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
Metadata shared.ResourceMetadata `json:"metadata" api:"required"`
Spec ToolSetSpec `json:"spec" api:"required"`
// Tool set information
Info ToolSetInfo `json:"info"`
JSON toolSetJSON `json:"-"`
}
func (*ToolSet) UnmarshalJSON ¶
type ToolSetAdapter ¶
type ToolSetAdapter struct {
HTTP ToolSetAdapterHTTP `json:"http"`
Mcp ToolSetAdapterMcp `json:"mcp"`
JSON toolSetAdapterJSON `json:"-"`
}
func (*ToolSetAdapter) UnmarshalJSON ¶
func (r *ToolSetAdapter) UnmarshalJSON(data []byte) (err error)
type ToolSetAdapterHTTP ¶
type ToolSetAdapterHTTP struct {
BaseURL string `json:"baseUrl"`
Headers map[string]string `json:"headers"`
JSON toolSetAdapterHTTPJSON `json:"-"`
}
func (*ToolSetAdapterHTTP) UnmarshalJSON ¶
func (r *ToolSetAdapterHTTP) UnmarshalJSON(data []byte) (err error)
type ToolSetAdapterHTTPParam ¶
type ToolSetAdapterHTTPParam struct {
BaseURL param.Field[string] `json:"baseUrl"`
Headers param.Field[map[string]string] `json:"headers"`
}
func (ToolSetAdapterHTTPParam) MarshalJSON ¶
func (r ToolSetAdapterHTTPParam) MarshalJSON() (data []byte, err error)
type ToolSetAdapterMcp ¶
type ToolSetAdapterMcp struct {
// Top-level filter with simple boolean logic (no nesting)
ExcludeTools McpToolFilter `json:"excludeTools"`
Headers map[string]string `json:"headers"`
// Top-level filter with simple boolean logic (no nesting)
IncludeTools McpToolFilter `json:"includeTools"`
// Approval filters that will automatically set the approval requirement on the
// tools synced from the MCP server
ToolApprovals ToolSetAdapterMcpToolApprovals `json:"toolApprovals"`
URL string `json:"url"`
JSON toolSetAdapterMcpJSON `json:"-"`
}
func (*ToolSetAdapterMcp) UnmarshalJSON ¶
func (r *ToolSetAdapterMcp) UnmarshalJSON(data []byte) (err error)
type ToolSetAdapterMcpParam ¶
type ToolSetAdapterMcpParam struct {
// Top-level filter with simple boolean logic (no nesting)
ExcludeTools param.Field[McpToolFilterParam] `json:"excludeTools"`
Headers param.Field[map[string]string] `json:"headers"`
// Top-level filter with simple boolean logic (no nesting)
IncludeTools param.Field[McpToolFilterParam] `json:"includeTools"`
// Approval filters that will automatically set the approval requirement on the
// tools synced from the MCP server
ToolApprovals param.Field[ToolSetAdapterMcpToolApprovalsParam] `json:"toolApprovals"`
URL param.Field[string] `json:"url"`
}
func (ToolSetAdapterMcpParam) MarshalJSON ¶
func (r ToolSetAdapterMcpParam) MarshalJSON() (data []byte, err error)
type ToolSetAdapterMcpToolApprovals ¶
type ToolSetAdapterMcpToolApprovals struct {
Always bool `json:"always"`
// Top-level filter with simple boolean logic (no nesting)
Only McpToolFilter `json:"only"`
JSON toolSetAdapterMcpToolApprovalsJSON `json:"-"`
}
Approval filters that will automatically set the approval requirement on the tools synced from the MCP server
func (*ToolSetAdapterMcpToolApprovals) UnmarshalJSON ¶
func (r *ToolSetAdapterMcpToolApprovals) UnmarshalJSON(data []byte) (err error)
type ToolSetAdapterMcpToolApprovalsParam ¶
type ToolSetAdapterMcpToolApprovalsParam struct {
Always param.Field[bool] `json:"always"`
// Top-level filter with simple boolean logic (no nesting)
Only param.Field[McpToolFilterParam] `json:"only"`
}
Approval filters that will automatically set the approval requirement on the tools synced from the MCP server
func (ToolSetAdapterMcpToolApprovalsParam) MarshalJSON ¶
func (r ToolSetAdapterMcpToolApprovalsParam) MarshalJSON() (data []byte, err error)
type ToolSetAdapterParam ¶
type ToolSetAdapterParam struct {
HTTP param.Field[ToolSetAdapterHTTPParam] `json:"http"`
Mcp param.Field[ToolSetAdapterMcpParam] `json:"mcp"`
}
func (ToolSetAdapterParam) MarshalJSON ¶
func (r ToolSetAdapterParam) MarshalJSON() (data []byte, err error)
type ToolSetEvent ¶
type ToolSetEvent struct {
// Metadata for ephemeral operations and activities (e.g., objectives, executions,
// runs)
Metadata shared.OperationMetadata `json:"metadata" api:"required"`
// ToolSetEventData represents the actual event payload for tool set operations
Event ToolSetEventData `json:"event"`
Info ToolSetEventInfo `json:"info"`
// The tool set this event is associated with
ToolSetID string `json:"toolSetId"`
JSON toolSetEventJSON `json:"-"`
}
ToolSetEvent represents a single event in the tool set's operation timeline
func (*ToolSetEvent) UnmarshalJSON ¶
func (r *ToolSetEvent) UnmarshalJSON(data []byte) (err error)
type ToolSetEventData ¶
type ToolSetEventData struct {
// SyncCompleted is emitted when a tool set sync operation completes successfully
SyncCompleted SyncCompleted `json:"syncCompleted"`
// SyncFailed is emitted when a tool set sync operation fails
SyncFailed SyncFailed `json:"syncFailed"`
// SyncStarted is emitted when a tool set sync operation begins
SyncStarted SyncStarted `json:"syncStarted"`
// Type of the event (e.g., "sync_started", "sync_completed", "sync_failed")
Type string `json:"type"`
JSON toolSetEventDataJSON `json:"-"`
}
ToolSetEventData represents the actual event payload for tool set operations
func (*ToolSetEventData) UnmarshalJSON ¶
func (r *ToolSetEventData) UnmarshalJSON(data []byte) (err error)
type ToolSetEventInfo ¶
type ToolSetEventInfo struct {
// Profile represents a human user at the account level. Profiles are
// account-scoped resources that can be associated with multiple workspaces through
// the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS).
CreatedBy shared.Profile `json:"createdBy"`
// Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
ToolSet shared.ResourceMetadata `json:"toolSet"`
JSON toolSetEventInfoJSON `json:"-"`
}
func (*ToolSetEventInfo) UnmarshalJSON ¶
func (r *ToolSetEventInfo) UnmarshalJSON(data []byte) (err error)
type ToolSetInfo ¶
type ToolSetInfo struct {
AgentCount int64 `json:"agentCount"`
// Profile represents a human user at the account level. Profiles are
// account-scoped resources that can be associated with multiple workspaces through
// the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS).
CreatedBy shared.Profile `json:"createdBy"`
LastSync time.Time `json:"lastSync" format:"date-time"`
ToolCount int64 `json:"toolCount"`
JSON toolSetInfoJSON `json:"-"`
}
func (*ToolSetInfo) UnmarshalJSON ¶
func (r *ToolSetInfo) UnmarshalJSON(data []byte) (err error)
type ToolSetListEventsParams ¶
type ToolSetListEventsParams struct {
// Pagination cursor from previous response
Cursor param.Field[string] `query:"cursor"`
// When set to true you may use more of your alloted API rate-limit
IncludeInfo param.Field[bool] `query:"includeInfo"`
// Maximum number of results to return
Limit param.Field[int64] `query:"limit"`
// Sort order for results (asc or desc by creation time)
SortOrder param.Field[string] `query:"sortOrder"`
}
func (ToolSetListEventsParams) URLQuery ¶
func (r ToolSetListEventsParams) URLQuery() (v url.Values)
URLQuery serializes ToolSetListEventsParams's query parameters as `url.Values`.
type ToolSetListParams ¶
type ToolSetListParams struct {
// Pagination cursor from previous response
Cursor param.Field[string] `query:"cursor"`
// When set to true you may use more of your alloted API rate-limit
IncludeInfo param.Field[bool] `query:"includeInfo"`
// Maximum number of results to return
Limit param.Field[int64] `query:"limit"`
// Filter expression (query param: prefix)
Prefix param.Field[string] `query:"prefix"`
// Sort order for results (asc or desc by creation time)
SortOrder param.Field[string] `query:"sortOrder"`
}
func (ToolSetListParams) URLQuery ¶
func (r ToolSetListParams) URLQuery() (v url.Values)
URLQuery serializes ToolSetListParams's query parameters as `url.Values`.
type ToolSetNewParams ¶
type ToolSetNewParams struct {
// CreateResourceMetadata contains the user-provided fields for creating a
// workspace-scoped resource. Read-only fields (id, account_id, workspace_id,
// profile_id, created_at) are excluded since they are set by the server.
Metadata param.Field[shared.CreateResourceMetadataParam] `json:"metadata" api:"required"`
Spec param.Field[ToolSetSpecParam] `json:"spec" api:"required"`
}
func (ToolSetNewParams) MarshalJSON ¶
func (r ToolSetNewParams) MarshalJSON() (data []byte, err error)
type ToolSetService ¶
type ToolSetService struct {
Options []option.RequestOption
// ToolService manages tool sets and tools at the WORKSPACE level. Tool sets group
// related tools, and tools define specific capabilities for agents. All operations
// are implicitly scoped to the workspace determined by the JWT token.
//
// Note: When a ToolSet has managed=true, only API Key actors can modify its tools.
// Profile actors (humans) are restricted from modifying managed tool sets.
//
// Authentication: Bearer token (JWT) Scope: Workspace-level operations
Tools *ToolSetToolService
}
ToolService manages tool sets and tools at the WORKSPACE level. Tool sets group related tools, and tools define specific capabilities for agents. All operations are implicitly scoped to the workspace determined by the JWT token.
Note: When a ToolSet has managed=true, only API Key actors can modify its tools. Profile actors (humans) are restricted from modifying managed tool sets.
Authentication: Bearer token (JWT) Scope: Workspace-level operations
ToolSetService contains methods and other services that help with interacting with the cadenya API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewToolSetService method instead.
func NewToolSetService ¶
func NewToolSetService(opts ...option.RequestOption) (r *ToolSetService)
NewToolSetService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ToolSetService) Delete ¶
func (r *ToolSetService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (err error)
Deletes a tool set in the workspace
func (*ToolSetService) Get ¶
func (r *ToolSetService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *ToolSet, err error)
Retrieves a tool set by ID from the workspace
func (*ToolSetService) List ¶
func (r *ToolSetService) List(ctx context.Context, query ToolSetListParams, opts ...option.RequestOption) (res *pagination.CursorPagination[ToolSet], err error)
Lists all tool sets in the workspace
func (*ToolSetService) ListAutoPaging ¶
func (r *ToolSetService) ListAutoPaging(ctx context.Context, query ToolSetListParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[ToolSet]
Lists all tool sets in the workspace
func (*ToolSetService) ListEvents ¶
func (r *ToolSetService) ListEvents(ctx context.Context, toolSetID string, query ToolSetListEventsParams, opts ...option.RequestOption) (res *pagination.CursorPagination[ToolSetEvent], err error)
Lists all events (including sync status) for a tool set
func (*ToolSetService) ListEventsAutoPaging ¶
func (r *ToolSetService) ListEventsAutoPaging(ctx context.Context, toolSetID string, query ToolSetListEventsParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[ToolSetEvent]
Lists all events (including sync status) for a tool set
func (*ToolSetService) New ¶
func (r *ToolSetService) New(ctx context.Context, body ToolSetNewParams, opts ...option.RequestOption) (res *ToolSet, err error)
Creates a new tool set in the workspace
func (*ToolSetService) Update ¶
func (r *ToolSetService) Update(ctx context.Context, id string, body ToolSetUpdateParams, opts ...option.RequestOption) (res *ToolSet, err error)
Updates a tool set in the workspace
type ToolSetSpec ¶
type ToolSetSpec struct {
Adapter ToolSetAdapter `json:"adapter"`
Description string `json:"description"`
JSON toolSetSpecJSON `json:"-"`
}
func (*ToolSetSpec) UnmarshalJSON ¶
func (r *ToolSetSpec) UnmarshalJSON(data []byte) (err error)
type ToolSetSpecParam ¶
type ToolSetSpecParam struct {
Adapter param.Field[ToolSetAdapterParam] `json:"adapter"`
Description param.Field[string] `json:"description"`
}
func (ToolSetSpecParam) MarshalJSON ¶
func (r ToolSetSpecParam) MarshalJSON() (data []byte, err error)
type ToolSetToolListParams ¶
type ToolSetToolListParams struct {
// Pagination cursor from previous response
Cursor param.Field[string] `query:"cursor"`
// When set to true you may use more of your alloted API rate-limit
IncludeInfo param.Field[bool] `query:"includeInfo"`
// Maximum number of results to return
Limit param.Field[int64] `query:"limit"`
// Filter expression (query param: prefix)
Prefix param.Field[string] `query:"prefix"`
// Sort order for results (asc or desc by creation time)
SortOrder param.Field[string] `query:"sortOrder"`
}
func (ToolSetToolListParams) URLQuery ¶
func (r ToolSetToolListParams) URLQuery() (v url.Values)
URLQuery serializes ToolSetToolListParams's query parameters as `url.Values`.
type ToolSetToolNewParams ¶
type ToolSetToolNewParams struct {
// CreateResourceMetadata contains the user-provided fields for creating a
// workspace-scoped resource. Read-only fields (id, account_id, workspace_id,
// profile_id, created_at) are excluded since they are set by the server.
Metadata param.Field[shared.CreateResourceMetadataParam] `json:"metadata" api:"required"`
Spec param.Field[ToolSpecParam] `json:"spec" api:"required"`
}
func (ToolSetToolNewParams) MarshalJSON ¶
func (r ToolSetToolNewParams) MarshalJSON() (data []byte, err error)
type ToolSetToolService ¶
type ToolSetToolService struct {
Options []option.RequestOption
}
ToolService manages tool sets and tools at the WORKSPACE level. Tool sets group related tools, and tools define specific capabilities for agents. All operations are implicitly scoped to the workspace determined by the JWT token.
Note: When a ToolSet has managed=true, only API Key actors can modify its tools. Profile actors (humans) are restricted from modifying managed tool sets.
Authentication: Bearer token (JWT) Scope: Workspace-level operations
ToolSetToolService contains methods and other services that help with interacting with the cadenya API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewToolSetToolService method instead.
func NewToolSetToolService ¶
func NewToolSetToolService(opts ...option.RequestOption) (r *ToolSetToolService)
NewToolSetToolService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ToolSetToolService) Delete ¶
func (r *ToolSetToolService) Delete(ctx context.Context, toolSetID string, id string, opts ...option.RequestOption) (err error)
Deletes a tool in the tool set
func (*ToolSetToolService) Get ¶
func (r *ToolSetToolService) Get(ctx context.Context, toolSetID string, id string, opts ...option.RequestOption) (res *Tool, err error)
Retrieves a tool by ID from the workspace
func (*ToolSetToolService) List ¶
func (r *ToolSetToolService) List(ctx context.Context, toolSetID string, query ToolSetToolListParams, opts ...option.RequestOption) (res *pagination.CursorPagination[Tool], err error)
Lists all tools in the tool set
func (*ToolSetToolService) ListAutoPaging ¶
func (r *ToolSetToolService) ListAutoPaging(ctx context.Context, toolSetID string, query ToolSetToolListParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[Tool]
Lists all tools in the tool set
func (*ToolSetToolService) New ¶
func (r *ToolSetToolService) New(ctx context.Context, toolSetID string, body ToolSetToolNewParams, opts ...option.RequestOption) (res *Tool, err error)
Creates a new tool in the tool set
func (*ToolSetToolService) Update ¶
func (r *ToolSetToolService) Update(ctx context.Context, toolSetID string, id string, body ToolSetToolUpdateParams, opts ...option.RequestOption) (res *Tool, err error)
Updates a tool in the tool set
type ToolSetToolUpdateParams ¶
type ToolSetToolUpdateParams struct {
// UpdateResourceMetadata contains the user-provided fields for updating a
// workspace-scoped resource. Read-only fields (id, account_id, workspace_id,
// profile_id, created_at) are excluded since they are set by the server.
Metadata param.Field[shared.UpdateResourceMetadataParam] `json:"metadata"`
Spec param.Field[ToolSpecParam] `json:"spec"`
UpdateMask param.Field[string] `json:"updateMask" format:"field-mask"`
}
func (ToolSetToolUpdateParams) MarshalJSON ¶
func (r ToolSetToolUpdateParams) MarshalJSON() (data []byte, err error)
type ToolSetUpdateParams ¶
type ToolSetUpdateParams struct {
// UpdateResourceMetadata contains the user-provided fields for updating a
// workspace-scoped resource. Read-only fields (id, account_id, workspace_id,
// profile_id, created_at) are excluded since they are set by the server.
Metadata param.Field[shared.UpdateResourceMetadataParam] `json:"metadata"`
Spec param.Field[ToolSetSpecParam] `json:"spec"`
UpdateMask param.Field[string] `json:"updateMask" format:"field-mask"`
}
func (ToolSetUpdateParams) MarshalJSON ¶
func (r ToolSetUpdateParams) MarshalJSON() (data []byte, err error)
type ToolSpec ¶
type ToolSpec struct {
// Config defines the adapter to use for the tool. This is used to determine how
// the tool is called. For example, if the tool is an HTTP tool, the adapter will
// be Http. If the tool is an inline tool, the adapter will be Inline.
Config ToolSpecConfig `json:"config" api:"required"`
Description string `json:"description" api:"required"`
Parameters map[string]interface{} `json:"parameters" api:"required"`
Status ToolSpecStatus `json:"status" api:"required"`
RequiresApproval bool `json:"requiresApproval"`
JSON toolSpecJSON `json:"-"`
}
func (*ToolSpec) UnmarshalJSON ¶
type ToolSpecConfig ¶
type ToolSpecConfig struct {
HTTP ConfigHTTP `json:"http"`
Mcp ConfigMcp `json:"mcp"`
JSON toolSpecConfigJSON `json:"-"`
}
Config defines the adapter to use for the tool. This is used to determine how the tool is called. For example, if the tool is an HTTP tool, the adapter will be Http. If the tool is an inline tool, the adapter will be Inline.
func (*ToolSpecConfig) UnmarshalJSON ¶
func (r *ToolSpecConfig) UnmarshalJSON(data []byte) (err error)
type ToolSpecConfigParam ¶
type ToolSpecConfigParam struct {
HTTP param.Field[ConfigHTTPParam] `json:"http"`
Mcp param.Field[ConfigMcpParam] `json:"mcp"`
}
Config defines the adapter to use for the tool. This is used to determine how the tool is called. For example, if the tool is an HTTP tool, the adapter will be Http. If the tool is an inline tool, the adapter will be Inline.
func (ToolSpecConfigParam) MarshalJSON ¶
func (r ToolSpecConfigParam) MarshalJSON() (data []byte, err error)
type ToolSpecParam ¶
type ToolSpecParam struct {
// Config defines the adapter to use for the tool. This is used to determine how
// the tool is called. For example, if the tool is an HTTP tool, the adapter will
// be Http. If the tool is an inline tool, the adapter will be Inline.
Config param.Field[ToolSpecConfigParam] `json:"config" api:"required"`
Description param.Field[string] `json:"description" api:"required"`
Parameters param.Field[map[string]interface{}] `json:"parameters" api:"required"`
Status param.Field[ToolSpecStatus] `json:"status" api:"required"`
RequiresApproval param.Field[bool] `json:"requiresApproval"`
}
func (ToolSpecParam) MarshalJSON ¶
func (r ToolSpecParam) MarshalJSON() (data []byte, err error)
type ToolSpecStatus ¶
type ToolSpecStatus string
const ( ToolSpecStatusToolStatusUnspecified ToolSpecStatus = "TOOL_STATUS_UNSPECIFIED" ToolSpecStatusToolStatusAvailable ToolSpecStatus = "TOOL_STATUS_AVAILABLE" ToolSpecStatusToolStatusFiltered ToolSpecStatus = "TOOL_STATUS_FILTERED" ToolSpecStatusToolStatusArchived ToolSpecStatus = "TOOL_STATUS_ARCHIVED" )
func (ToolSpecStatus) IsKnown ¶
func (r ToolSpecStatus) IsKnown() bool
type UpdateResourceMetadataParam ¶
type UpdateResourceMetadataParam = shared.UpdateResourceMetadataParam
UpdateResourceMetadata contains the user-provided fields for updating a workspace-scoped resource. Read-only fields (id, account_id, workspace_id, profile_id, created_at) are excluded since they are set by the server.
This is an alias to an internal type.
type UserMessage ¶
type UserMessage struct {
Content string `json:"content"`
JSON userMessageJSON `json:"-"`
}
func (*UserMessage) UnmarshalJSON ¶
func (r *UserMessage) UnmarshalJSON(data []byte) (err error)
type WebhookDelivery ¶
type WebhookDelivery struct {
// Webhook delivery data
Data WebhookDeliveryData `json:"data" api:"required"`
// Metadata for ephemeral operations and activities (e.g., objectives, executions,
// runs)
Metadata shared.OperationMetadata `json:"metadata" api:"required"`
JSON webhookDeliveryJSON `json:"-"`
}
func (*WebhookDelivery) UnmarshalJSON ¶
func (r *WebhookDelivery) UnmarshalJSON(data []byte) (err error)
type WebhookDeliveryData ¶
type WebhookDeliveryData struct {
// Related resources
AgentID string `json:"agentId" api:"required"`
AttemptCount int64 `json:"attemptCount" api:"required"`
// The type of objective event that triggered this webhook delivery
EventType WebhookDeliveryDataEventType `json:"eventType" api:"required"`
// Response details (no response_body to avoid storing large payloads)
HTTPStatusCode int64 `json:"httpStatusCode" api:"required"`
LastAttemptAt time.Time `json:"lastAttemptAt" api:"required" format:"date-time"`
LatencyMs int64 `json:"latencyMs" api:"required"`
ObjectiveEventID string `json:"objectiveEventId" api:"required"`
ObjectiveID string `json:"objectiveId" api:"required"`
// Content length of the response body in bytes
ResponseContentLength string `json:"responseContentLength" api:"required"`
Status WebhookDeliveryDataStatus `json:"status" api:"required"`
WebhookID string `json:"webhookId" api:"required"`
// Webhook delivery details
WebhookURL string `json:"webhookUrl" api:"required"`
ErrorMessage string `json:"errorMessage"`
// Response headers received from the webhook endpoint
ResponseHeaders map[string]string `json:"responseHeaders"`
JSON webhookDeliveryDataJSON `json:"-"`
}
func (*WebhookDeliveryData) UnmarshalJSON ¶
func (r *WebhookDeliveryData) UnmarshalJSON(data []byte) (err error)
type WebhookDeliveryDataEventType ¶
type WebhookDeliveryDataEventType string
The type of objective event that triggered this webhook delivery
const ( WebhookDeliveryDataEventTypeObjectiveEventTypeUnspecified WebhookDeliveryDataEventType = "OBJECTIVE_EVENT_TYPE_UNSPECIFIED" WebhookDeliveryDataEventTypeObjectiveEventTypeUserMessage WebhookDeliveryDataEventType = "OBJECTIVE_EVENT_TYPE_USER_MESSAGE" WebhookDeliveryDataEventTypeObjectiveEventTypeToolApprovalRequested WebhookDeliveryDataEventType = "OBJECTIVE_EVENT_TYPE_TOOL_APPROVAL_REQUESTED" WebhookDeliveryDataEventTypeObjectiveEventTypeToolApproved WebhookDeliveryDataEventType = "OBJECTIVE_EVENT_TYPE_TOOL_APPROVED" WebhookDeliveryDataEventTypeObjectiveEventTypeToolDenied WebhookDeliveryDataEventType = "OBJECTIVE_EVENT_TYPE_TOOL_DENIED" WebhookDeliveryDataEventTypeObjectiveEventTypeToolCalled WebhookDeliveryDataEventType = "OBJECTIVE_EVENT_TYPE_TOOL_CALLED" WebhookDeliveryDataEventTypeObjectiveEventTypeSubObjectiveCreated WebhookDeliveryDataEventType = "OBJECTIVE_EVENT_TYPE_SUB_OBJECTIVE_CREATED" WebhookDeliveryDataEventTypeObjectiveEventTypeError WebhookDeliveryDataEventType = "OBJECTIVE_EVENT_TYPE_ERROR" WebhookDeliveryDataEventTypeObjectiveEventTypeAssistantMessage WebhookDeliveryDataEventType = "OBJECTIVE_EVENT_TYPE_ASSISTANT_MESSAGE" WebhookDeliveryDataEventTypeObjectiveEventTypeToolResult WebhookDeliveryDataEventType = "OBJECTIVE_EVENT_TYPE_TOOL_RESULT" WebhookDeliveryDataEventTypeObjectiveEventTypeToolError WebhookDeliveryDataEventType = "OBJECTIVE_EVENT_TYPE_TOOL_ERROR" )
func (WebhookDeliveryDataEventType) IsKnown ¶
func (r WebhookDeliveryDataEventType) IsKnown() bool
type WebhookDeliveryDataStatus ¶
type WebhookDeliveryDataStatus string
const ( WebhookDeliveryDataStatusWebhookDeliveryStatusUnspecified WebhookDeliveryDataStatus = "WEBHOOK_DELIVERY_STATUS_UNSPECIFIED" WebhookDeliveryDataStatusWebhookDeliveryStatusPending WebhookDeliveryDataStatus = "WEBHOOK_DELIVERY_STATUS_PENDING" WebhookDeliveryDataStatusWebhookDeliveryStatusCompleted WebhookDeliveryDataStatus = "WEBHOOK_DELIVERY_STATUS_COMPLETED" WebhookDeliveryDataStatusWebhookDeliveryStatusFailed WebhookDeliveryDataStatus = "WEBHOOK_DELIVERY_STATUS_FAILED" WebhookDeliveryDataStatusWebhookDeliveryStatusDisabled WebhookDeliveryDataStatus = "WEBHOOK_DELIVERY_STATUS_DISABLED" )
func (WebhookDeliveryDataStatus) IsKnown ¶
func (r WebhookDeliveryDataStatus) IsKnown() bool
type WorkspaceListParams ¶
type WorkspaceListParams struct {
// Pagination cursor from previous response
Cursor param.Field[string] `query:"cursor"`
// When set to true you may use more of your alloted API rate-limit
IncludeInfo param.Field[bool] `query:"includeInfo"`
// Maximum number of results to return
Limit param.Field[int64] `query:"limit"`
// Sort order for results (asc or desc by creation time)
SortOrder param.Field[string] `query:"sortOrder"`
}
func (WorkspaceListParams) URLQuery ¶
func (r WorkspaceListParams) URLQuery() (v url.Values)
URLQuery serializes WorkspaceListParams's query parameters as `url.Values`.
type WorkspaceSecret ¶
type WorkspaceSecret struct {
// Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
Metadata shared.ResourceMetadata `json:"metadata" api:"required"`
Spec WorkspaceSecretSpec `json:"spec" api:"required"`
// Workspace secret information
Info WorkspaceSecretInfo `json:"info"`
JSON workspaceSecretJSON `json:"-"`
}
func (*WorkspaceSecret) UnmarshalJSON ¶
func (r *WorkspaceSecret) UnmarshalJSON(data []byte) (err error)
type WorkspaceSecretInfo ¶
type WorkspaceSecretInfo struct {
// Profile represents a human user at the account level. Profiles are
// account-scoped resources that can be associated with multiple workspaces through
// the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS).
CreatedBy shared.Profile `json:"createdBy"`
LastUsedAt time.Time `json:"lastUsedAt" format:"date-time"`
JSON workspaceSecretInfoJSON `json:"-"`
}
func (*WorkspaceSecretInfo) UnmarshalJSON ¶
func (r *WorkspaceSecretInfo) UnmarshalJSON(data []byte) (err error)
type WorkspaceSecretListParams ¶
type WorkspaceSecretListParams struct {
// Pagination cursor from previous response
Cursor param.Field[string] `query:"cursor"`
// When set to true you may use more of your alloted API rate-limit
IncludeInfo param.Field[bool] `query:"includeInfo"`
// Maximum number of results to return
Limit param.Field[int64] `query:"limit"`
// Filter expression (query param: prefix)
Prefix param.Field[string] `query:"prefix"`
// Sort order for results (asc or desc by creation time)
SortOrder param.Field[string] `query:"sortOrder"`
}
func (WorkspaceSecretListParams) URLQuery ¶
func (r WorkspaceSecretListParams) URLQuery() (v url.Values)
URLQuery serializes WorkspaceSecretListParams's query parameters as `url.Values`.
type WorkspaceSecretNewParams ¶
type WorkspaceSecretNewParams struct {
// CreateResourceMetadata contains the user-provided fields for creating a
// workspace-scoped resource. Read-only fields (id, account_id, workspace_id,
// profile_id, created_at) are excluded since they are set by the server.
Metadata param.Field[shared.CreateResourceMetadataParam] `json:"metadata" api:"required"`
Spec param.Field[WorkspaceSecretSpecParam] `json:"spec" api:"required"`
}
func (WorkspaceSecretNewParams) MarshalJSON ¶
func (r WorkspaceSecretNewParams) MarshalJSON() (data []byte, err error)
type WorkspaceSecretService ¶
type WorkspaceSecretService struct {
Options []option.RequestOption
}
WorkspaceSecretService contains methods and other services that help with interacting with the cadenya API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewWorkspaceSecretService method instead.
func NewWorkspaceSecretService ¶
func NewWorkspaceSecretService(opts ...option.RequestOption) (r *WorkspaceSecretService)
NewWorkspaceSecretService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*WorkspaceSecretService) Delete ¶
func (r *WorkspaceSecretService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (err error)
Deletes a workspace secret from the workspace
func (*WorkspaceSecretService) Get ¶
func (r *WorkspaceSecretService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *WorkspaceSecret, err error)
Retrieves a workspace secret by ID from the workspace
func (*WorkspaceSecretService) List ¶
func (r *WorkspaceSecretService) List(ctx context.Context, query WorkspaceSecretListParams, opts ...option.RequestOption) (res *pagination.CursorPagination[WorkspaceSecret], err error)
Lists all workspace secrets in the workspace
func (*WorkspaceSecretService) ListAutoPaging ¶
func (r *WorkspaceSecretService) ListAutoPaging(ctx context.Context, query WorkspaceSecretListParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[WorkspaceSecret]
Lists all workspace secrets in the workspace
func (*WorkspaceSecretService) New ¶
func (r *WorkspaceSecretService) New(ctx context.Context, body WorkspaceSecretNewParams, opts ...option.RequestOption) (res *WorkspaceSecret, err error)
Creates a new workspace secret in the workspace
func (*WorkspaceSecretService) Update ¶
func (r *WorkspaceSecretService) Update(ctx context.Context, id string, body WorkspaceSecretUpdateParams, opts ...option.RequestOption) (res *WorkspaceSecret, err error)
Updates a workspace secret in the workspace
type WorkspaceSecretSpec ¶
type WorkspaceSecretSpec struct {
Value string `json:"value"`
JSON workspaceSecretSpecJSON `json:"-"`
}
func (*WorkspaceSecretSpec) UnmarshalJSON ¶
func (r *WorkspaceSecretSpec) UnmarshalJSON(data []byte) (err error)
type WorkspaceSecretSpecParam ¶
func (WorkspaceSecretSpecParam) MarshalJSON ¶
func (r WorkspaceSecretSpecParam) MarshalJSON() (data []byte, err error)
type WorkspaceSecretUpdateParams ¶
type WorkspaceSecretUpdateParams struct {
// UpdateResourceMetadata contains the user-provided fields for updating a
// workspace-scoped resource. Read-only fields (id, account_id, workspace_id,
// profile_id, created_at) are excluded since they are set by the server.
Metadata param.Field[shared.UpdateResourceMetadataParam] `json:"metadata"`
Spec param.Field[WorkspaceSecretSpecParam] `json:"spec"`
// Fields to update
UpdateMask param.Field[string] `json:"updateMask" format:"field-mask"`
}
func (WorkspaceSecretUpdateParams) MarshalJSON ¶
func (r WorkspaceSecretUpdateParams) MarshalJSON() (data []byte, err error)
type WorkspaceService ¶
type WorkspaceService struct {
Options []option.RequestOption
}
WorkspaceService manages workspaces at the ACCOUNT level. This service is responsible for creating and listing workspaces within an account. Workspaces provide organizational grouping for resources within an account.
Authentication: Bearer token (JWT) Scope: Account-level operations (manages workspaces themselves, not resources within workspaces)
WorkspaceService contains methods and other services that help with interacting with the cadenya API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewWorkspaceService method instead.
func NewWorkspaceService ¶
func NewWorkspaceService(opts ...option.RequestOption) (r *WorkspaceService)
NewWorkspaceService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*WorkspaceService) Get ¶
func (r *WorkspaceService) Get(ctx context.Context, opts ...option.RequestOption) (res *shared.Workspace, err error)
Retrieves the workspace associated with the current API token. Useful for workspace-scoped tokens to identify which workspace they belong to.
func (*WorkspaceService) List ¶
func (r *WorkspaceService) List(ctx context.Context, query WorkspaceListParams, opts ...option.RequestOption) (res *pagination.CursorPagination[shared.Workspace], err error)
Lists all workspaces for the current account
func (*WorkspaceService) ListAutoPaging ¶
func (r *WorkspaceService) ListAutoPaging(ctx context.Context, query WorkspaceListParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[shared.Workspace]
Lists all workspaces for the current account
type WorkspaceSpec ¶
type WorkspaceSpec = shared.WorkspaceSpec
This is an alias to an internal type.