sk-agents
sk_agents
sk_agents.a2a
sk_agents.a2a.redis_task_store
Redis implementation of the TaskStore interface. This implementation uses Redis as the persistent store for Task objects.
sk_agents.a2a.redis_task_store.RedisTaskStore
Bases: TaskStore
Redis implementation of the TaskStore interface.
This class provides Redis-based persistence for Task objects.
Source code in src/sk_agents/a2a/redis_task_store.py
sk_agents.a2a.redis_task_store.RedisTaskStore.__init__
Initialize the RedisTaskStore with a Redis client.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
redis_client
|
Redis
|
An instance of Redis client |
required |
key_prefix
|
str
|
Prefix used for Redis keys (default: "task:") |
'task:'
|
Source code in src/sk_agents/a2a/redis_task_store.py
sk_agents.a2a.redis_task_store.RedisTaskStore.save
async
Saves or updates a task in the Redis store.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task
|
Task
|
The Task object to save |
required |
Source code in src/sk_agents/a2a/redis_task_store.py
sk_agents.a2a.redis_task_store.RedisTaskStore.get
async
Retrieves a task from the Redis store by ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task_id
|
str
|
The ID of the task to retrieve |
required |
Returns:
Type | Description |
---|---|
Task | None
|
The Task object if found, None otherwise |
Source code in src/sk_agents/a2a/redis_task_store.py
sk_agents.a2a.redis_task_store.RedisTaskStore.delete
async
Deletes a task from the Redis store by ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task_id
|
str
|
The ID of the task to delete |
required |
sk_agents.a2a.response_classifier
sk_agents.a2a.response_classifier.A2AResponseClassifier
A class to classify responses from the A2A agent.
Source code in src/sk_agents/a2a/response_classifier.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
|
sk_agents.a2a.response_classifier.A2AResponseClassifier.classify_response
async
Classify the response from the A2A agent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
response
|
str
|
The response from the A2A agent. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
A2AResponseClassification
|
The classification of the response. |
Source code in src/sk_agents/a2a/response_classifier.py
sk_agents.authorization
sk_agents.authorization.request_authorizer
sk_agents.authorization.request_authorizer.RequestAuthorizer
Bases: ABC
Source code in src/sk_agents/authorization/request_authorizer.py
sk_agents.authorization.request_authorizer.RequestAuthorizer.authorize_request
abstractmethod
Validates the given authorization header and returns a unique identifier for the authenticated user.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth_header
|
str
|
The value of the 'Authorization' HTTP header.
Typically, this is in the format 'Bearer |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
A unique string that identifies the authenticated user. This could be a user ID, username, email, or any other unique identifier suitable for tracking and authorization. |
Examples |
str
|
"user_12345" "alice@example.com" |
Raises:
Type | Description |
---|---|
ValueError
|
If the authorization header is missing, malformed, or invalid. |
AuthenticationError(optional)
|
If used in your implementation, it may be raised to signal an authentication failure. |
Source code in src/sk_agents/authorization/request_authorizer.py
sk_agents.exceptions
sk_agents.exceptions.AgentsException
sk_agents.exceptions.InvalidConfigException
Bases: AgentsException
Exception raised when the provided configuration is invalid
Source code in src/sk_agents/exceptions.py
sk_agents.exceptions.InvalidInputException
Bases: AgentsException
Exception raised when the provided input type is invalid
Source code in src/sk_agents/exceptions.py
sk_agents.exceptions.AgentInvokeException
Bases: AgentsException
Exception raised when invoking an Agent failed
Source code in src/sk_agents/exceptions.py
sk_agents.exceptions.PersistenceCreateError
Bases: AgentsException
Exception raised for errors during task creation.
Source code in src/sk_agents/exceptions.py
sk_agents.exceptions.PersistenceLoadError
Bases: AgentsException
Exception raised for errors during task loading.
Source code in src/sk_agents/exceptions.py
sk_agents.exceptions.PersistenceUpdateError
Bases: AgentsException
Exception raised for errors during task update.
Source code in src/sk_agents/exceptions.py
sk_agents.exceptions.PersistenceDeleteError
Bases: AgentsException
Exception raised for errors during task deletion.
Source code in src/sk_agents/exceptions.py
sk_agents.exceptions.AuthenticationException
Bases: AgentsException
Exception raised errors when authenticating users
Source code in src/sk_agents/exceptions.py
sk_agents.ska_types
sk_agents.ska_types.HistoryMessage
Bases: BaseModel
A single interaction in a chat history.
'role' - Either 'user' (requestor) or 'assistant' (responder) indicating
who sent the message.
'content' - The content of the message
Source code in src/sk_agents/ska_types.py
sk_agents.ska_types.BaseInput
Bases: KernelBaseModel
The history of a chat interaction between an automated assistant and a human.
Source code in src/sk_agents/ska_types.py
sk_agents.ska_types.BaseInputWithUserContext
Bases: KernelBaseModel
The history of a chat interaction between an automated assistant and a human, along with context about the user.
Source code in src/sk_agents/ska_types.py
sk_agents.state
sk_agents.state.redis_state_manager
Redis implementation of the StateManager interface. This implementation uses Redis as the persistent store for task state management.
sk_agents.state.redis_state_manager.RedisStateManager
Bases: StateManager
Redis implementation of the StateManager interface.
This class provides Redis-based persistence for task state management.
Source code in src/sk_agents/state/redis_state_manager.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
|
sk_agents.state.redis_state_manager.RedisStateManager.__init__
Initialize the RedisStateManager with a Redis client.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
redis_client
|
Redis
|
An instance of Redis client |
required |
key_prefix
|
str
|
Prefix used for Redis keys (default: "task_state:") |
'task_state:'
|
Source code in src/sk_agents/state/redis_state_manager.py
sk_agents.state.redis_state_manager.RedisStateManager.update_task_messages
async
update_task_messages(
task_id: str, new_message: HistoryMultiModalMessage
) -> list[HistoryMultiModalMessage]
Updates the messages for a specific task.
Appends a new message to the task's message history and returns the complete list of messages.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task_id
|
str
|
The ID of the task |
required |
new_message
|
HistoryMultiModalMessage
|
The new message to add to the task's history |
required |
Returns:
Type | Description |
---|---|
list[HistoryMultiModalMessage]
|
The complete list of messages for the task |
Source code in src/sk_agents/state/redis_state_manager.py
sk_agents.state.redis_state_manager.RedisStateManager.set_canceled
async
Marks a task as canceled.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task_id
|
str
|
The ID of the task to mark as canceled |
required |
Source code in src/sk_agents/state/redis_state_manager.py
sk_agents.state.redis_state_manager.RedisStateManager.is_canceled
async
Checks if a task is marked as canceled.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task_id
|
str
|
The ID of the task to check |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the task is canceled, False otherwise |
Source code in src/sk_agents/state/redis_state_manager.py
sk_agents.tealagents
sk_agents.tealagents.v1alpha1
sk_agents.tealagents.v1alpha1.hitl_manager
sk_agents.tealagents.v1alpha1.hitl_manager.HitlInterventionRequired
Bases: Exception
Exception raised when a tool call requires human-in-the-loop intervention.
Source code in src/sk_agents/tealagents/v1alpha1/hitl_manager.py
sk_agents.tealagents.v1alpha1.hitl_manager.check_for_intervention
Checks if the tool call requires user consent based on predefined high-risk tools.
Returns True if the tool call matches a high-risk tool, otherwise False.