Skip to content

Instantly share code, notes, and snippets.

View kpx-dev's full-sized avatar
🔥
FIRE!

Kien Pham kpx-dev

🔥
FIRE!
View GitHub Profile
"""
Verify Claude Opus 4.7 structured outputs on Bedrock + show the workaround.
Calls to us.anthropic.claude-opus-4-7 fail with
ValidationException: output_config.format: Extra inputs are not permitted
on the Bedrock Converse API.
The error path is snake_case (output_config.format), which means it's
raised by the Anthropic model layer AFTER Bedrock's
outputConfig.textFormat -> output_config.format translation. It is not a
<script>
// Include the UserVoice JavaScript SDK (only needed once on a page)
UserVoice=window.UserVoice||[];(function(){var uv=document.createElement('script');uv.type='text/javascript';uv.async=true;uv.src='//widget.uservoice.com/T1twXffk8kRFxQHuFsXBqA.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(uv,s)})();
//
// UserVoice Javascript SDK developer documentation:
// https://www.uservoice.com/o/javascript-sdk
//
// Set colors
@kpx-dev
kpx-dev / multiple_credentials.py
Created November 21, 2014 06:05
SendGrid Multiple Credentials
"""
This Python code snippet will show you how to work with SendGrid Multiple
Credentials
install the amazing requests library
$ pip install requests==2.4.3
export your SendGrid credential from command line
$ export SG_USERNAME=your_sg_username
$ export SG_PASSWORD=your_sg_password
"""
This Python code snippet will show you how to get all SendGrid invalid
emails records.
install the amazing requests library
$ pip install requests==2.4.3
export your SendGrid credential from command line
$ export SG_USERNAME=your_sg_username
$ export SG_PASSWORD=your_sg_password
"""
This Python code snippet will show you how to get work with SendGrid filter
settings
install the amazing requests library
$ pip install requests==2.4.3
export your SendGrid credential from command line
$ export SG_USERNAME=your_sg_username
$ export SG_PASSWORD=your_sg_password
@kpx-dev
kpx-dev / filter_commands.py
Created November 21, 2014 04:10
SendGrid filters commands
"""
This Python code snippet will show you how to get work with SendGrid filter
commands
install the amazing requests library
$ pip install requests==2.4.3
export your SendGrid credential from command line
$ export SG_USERNAME=your_sg_username
$ export SG_PASSWORD=your_sg_password
@kpx-dev
kpx-dev / bounces.py
Created November 20, 2014 20:11
SendGrid bounces example
"""
This Python code snippet will show you how to get all SendGrid bounces
records.
install the amazing requests library
$ pip install requests==2.4.3
export your SendGrid credential from command line
$ export SG_USERNAME=your_sg_username
$ export SG_PASSWORD=your_sg_password
@kpx-dev
kpx-dev / sendgrid_block.py
Created November 20, 2014 19:55
SendGrid block example with requests library
"""
This Python code snippet will show you how to get all SendGrid block records
Please change SG_USERNAME and SG_PASSWORD to match your credentials
install the amazing requests library
$ pip install requests==2.4.3
save this file as python block.py and run it
$ python block.py
"""
import base64
import hashlib
import random
# generate random string length of 43
base64.b64encode(hashlib.sha256( str(random.getrandbits(256)) ).digest(), random.choice(['rA','aZ','gQ','hH','hG','aR','DD'])).rstrip('==')