Skip to content

Instantly share code, notes, and snippets.

@madhurprash
madhurprash / asyncio_bedrock_RESTapi.py
Last active November 1, 2024 05:29
Call multiple Amazon Bedrock model offerings using Python asyncio and the Bedrock REST API
## Note: This is for titan-express, but for any model you use, you will bring your own payloads and simply run this code.
import json
import time
import asyncio
import requests as req
import botocore.session
from itertools import groupby
from operator import itemgetter
from botocore.auth import SigV4Auth
@svrist
svrist / cf_create_or_update.py
Created February 7, 2017 21:34
Update or create a CloudFormation stack given a name and template + params'
'Update or create a stack given a name and template + params'
from __future__ import division, print_function, unicode_literals
from datetime import datetime
import logging
import json
import sys
import boto3
import botocore