Helicone Community Page

Updated last year

AWS Claude

Like you call it within the same VPC?
h
J
4 comments
This is an example code for request (with AWS Key)
Plain Text
import json

import boto3

bedrock_runtime = boto3.client("bedrock-runtime", region_name="us-east-1")

prompt = """
Human: Tell me today's weather

Assistant:
"""

body = json.dumps(
 {
 "prompt": prompt,
 "max_tokens_to_sample": 500,
 }
)

resp = bedrock_runtime.invoke_model(
 modelId="anthropic.claude-instant-v1",
 body=body,
 contentType="application/json",
 accept="*/*",
)
#print(resp)
answer = resp["body"].read().decode()
#print(answer)
print(json.loads(answer)["completion"])
I can reverse-engineering the API endpoint πŸ™‚
Haha no need to reverse engineer πŸ™‚

Since it’s not a 1:1 for Claude I think we should wait for @Cole to merge in his auto mapper feature. Are you okay waiting another week to get support for this?
Sure! We can ofc wait πŸ™‚
Add a reply
Sign up and join the conversation on Discord