Spaces:
Configuration error
Configuration error
Download init.py from yonkasoft/chat: direct link, hf CLI and curl.
- Browser
- Download file 598 Bytes
-
https://huggingface.co/spaces/yonkasoft/chat/resolve/main/init.py
- Command line
-
hf download hf://spaces/yonkasoft/chat/init.py
-
curl -L -o init.py https://huggingface.co/spaces/yonkasoft/chat/resolve/main/init.py
598 Bytes
| import boto3 | |
| class DynamoDBService: | |
| def __init__(self, table_name): | |
| self.dynamodb = boto3.resource('dynamodb') | |
| self.table = self.dynamodb.Table(table_name) | |
| return table_name | |
| def put_item(self, item): | |
| response = self.table.put_item(Item=item) | |
| return response | |
| def get_item(self, key): | |
| response = self.table.get_item(Key=key) | |
| return response | |
| # Singleton olarak bir tabloya bağlanmak için aşağıdaki gibi tanımlayabilirsiniz | |
| dynamodb_service = DynamoDBService('new_table') | |