ZenKingのメモ

40代おっさんが3年間でTOEIC・Speakingをマスターするまでのノウハウ

日記

今日は家で大人しく、ちゃんと仕事と転職活動を実施。

職務経歴書はほとんど添削もなく明日中には完了しそう。
早くあげて早めに活動したい。
しかし、話すだけめっちゃ緊張するのはなぜ?面接でやっていけるか心配。

マイコさんは、自分がいなくなる事に対してはっきりさせたいのだと考えている。
真面目なのか、視野が狭いのかはわからないが、とりあえず不安を取り除いてあげるのが、まず第一だと思われる。

愛したい!!この一言につきる。

コーディング
CosmosClientは通常と .aioという非同期用が存在する。

# Cosmos DB
from azure.cosmos.aio import CosmosClient

@bp.before_app_serving
async def setup_clients():

try:
# CosmosClientを非同期で初期化
cosmos_client = CosmosClient(url=cosmos_endpoint, credential=azure_credential)
database = cosmos_client.get_database_client("ChatGPT")
cosmos_container = database.get_container_client("ChatLogs")
print("Cosmos DB clients are set up successfully.")
except Exception as e:
print(e)

として、各CosmosClientなどにはasync awaitは付与しなくて良いが、
cosmos_container.create_item時にはawaitを付与する必要がある。

try:
await self.cosmos_container.create_item(new_item)
except Exception as e:
print(e)
pass