tessl install tessl/pypi-gcloud@0.7.0Python client library for Google Cloud Platform services including Datastore, Storage, and Pub/Sub
Agent Success
Agent success rate when using this tile
93%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.19x
Baseline
Agent success rate without this tile
78%
A bank account transfer system that uses Cloud Datastore transactions to safely transfer money between accounts with automatic rollback on failures.
@generates
def transfer_money(client, from_account_id, to_account_id, amount):
"""
Transfer money from one account to another using a transaction.
Args:
client: A gcloud datastore Client instance
from_account_id: String ID of the source account
to_account_id: String ID of the destination account
amount: Numeric amount to transfer (must be positive)
Returns:
dict: Contains 'success' boolean and 'message' string
Example: {'success': True, 'message': 'Transfer completed'}
Raises:
ValueError: If amount is not positive
Exception: If accounts don't exist or insufficient balance
"""
pass
def create_account(client, account_id, initial_balance):
"""
Create a new bank account in the datastore.
Args:
client: A gcloud datastore Client instance
account_id: String ID for the account
initial_balance: Numeric starting balance
Returns:
Key: The datastore Key of the created account
"""
pass
def get_balance(client, account_id):
"""
Get the current balance of an account.
Args:
client: A gcloud datastore Client instance
account_id: String ID of the account
Returns:
Numeric: Current account balance
Raises:
Exception: If account doesn't exist
"""
passProvides Cloud Datastore client for transactional data operations.
@satisfied-by