|
chunk_embeddings = [r["embedding"] for r in response["data"]] |
What the current behavior is (response["data"] and response["usage"]["prompt_tokens"] are assumed to exist).
-Why this can fail (API changes, network issues, unexpected response).
-What the expected behavior should be (validate or handle missing keys gracefully).