Skip to content

Instantly share code, notes, and snippets.

@KyMidd
Created February 28, 2025 00:14
Show Gist options
  • Select an option

  • Save KyMidd/23ef276d6d5416407bd074f7d716b8ee to your computer and use it in GitHub Desktop.

Select an option

Save KyMidd/23ef276d6d5416407bd074f7d716b8ee to your computer and use it in GitHub Desktop.
response = bedrock_client.converse(
modelId=model_id,
guardrailConfig={
"guardrailIdentifier": guardrailIdentifier,
"guardrailVersion": guardrailVersion,
},
messages=messages,
system=model_prompt,
inferenceConfig=inference_config,
additionalModelRequestFields=additional_model_fields
)
# Find the response text
response = response["output"]["message"]["content"][0]["text"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment