Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting KeyError: 'content' at Step 4 #38

Open
techybolek opened this issue Apr 8, 2024 · 1 comment
Open

Getting KeyError: 'content' at Step 4 #38

techybolek opened this issue Apr 8, 2024 · 1 comment

Comments

@techybolek
Copy link

I've set my anthropic key, executed steps 1,2,3. At step 4:

result = run_haiku_conversion_process(task, prompt_exa7m7ple, response_example)
I'm getting an error:


KeyError                                  Traceback (most recent call last)
[<ipython-input-4-76ae4865d687>](https://localhost:8080/#) in <cell line: 1>()
----> 1 result = run_haiku_conversion_process(task, prompt_example, response_example)

1 frames
[<ipython-input-2-a6720f5aded8>](https://localhost:8080/#) in generate_candidate_prompts(task, prompt_example, response_example)
     60     response = requests.post("https://api.anthropic.com/v1/messages", headers=headers, json=data)
     61 
---> 62     response_text = response.json()['content'][0]['text']
     63 
     64     # Parse out the prompts and responses

KeyError: 'content'
@wbricker29
Copy link

The output of Claude has some volatility, causing errors in parsing the test case output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants