| 92 | } |
| 93 | |
| 94 | fn openai_embeddings_body(model: &str) -> Vec<u8> { |
| 95 | // Shape must match the OpenAI embeddings response (`object: "list"` with a |
| 96 | // `data` array of `{object, index, embedding}`) so callers that deserialize |
| 97 | // into an embeddings type get a structurally valid — if canned — vector. |
| 98 | serde_json::to_vec(&serde_json::json!({ |
| 99 | "object": "list", |
| 100 | "data": [{ |
| 101 | "object": "embedding", |
| 102 | "index": 0, |
| 103 | "embedding": [0.0_f32, 0.0_f32, 0.0_f32] |
| 104 | }], |
| 105 | "model": model, |
| 106 | "usage": { |
| 107 | "prompt_tokens": 1, |
| 108 | "total_tokens": 1 |
| 109 | } |
| 110 | })) |
| 111 | .expect("static JSON must serialize") |
| 112 | } |
| 113 | |
| 114 | fn anthropic_messages_body(model: &str) -> Vec<u8> { |
| 115 | serde_json::to_vec(&serde_json::json!({ |