Helicone Community Page

Updated 5 months ago

Hi @Justin , I'm having trouble enabling

Hi @Justin , I'm having trouble enabling caching for anthropic. It works for open ai but not anthropic for some reason.
Here is my code:
Plain Text
headers = {
    "Helicone-Auth": "Bearer xxxx",
    **({
        "Helicone-Cache-Enabled": "true",
        "Cache-Control": "max-age=2592000"} if not os.environ.get('HELICONE_CACHE_DISABLED') else {}),
}

my_anthropic_client = Anthropic(
    base_url="https://anthropic.helicone.ai/",
    default_headers=headers
)

completion = my_anthropic_client.messages.create(
    max_tokens=4096,
    temperature=temperature,
    messages=conversation_state
    model=model_name
)

response = completion.content[0].text
J
P
9 comments
Hi @Pierre - not sure why this is happening.
it seem to work now. Do you have some kind of a fail safe mechanism that sends the request if cache it too busy or something ?
I am guessing that is what is happening in this case.
Right now we are using Cloudflare for our cache and they have been a bit flakey the past month. We are talking with them to get timelines on making this more reliable
ok, that's prob what I'm seeing. Thx. Love the product BTW
Thanks Pierre! πŸ˜„ what are you building?
www.dioptra.ai
contract review
awesome! Just sent you a slack message
Add a reply
Sign up and join the conversation on Discord