MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / openai_embeddings_body

Function openai_embeddings_body

crates/openshell-router/src/mock.rs:94–112  ·  view source on GitHub ↗
(model: &str)

Source from the content-addressed store, hash-verified

92}
93
94fn 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
114fn anthropic_messages_body(model: &str) -> Vec<u8> {
115 serde_json::to_vec(&serde_json::json!({

Callers 1

mock_responseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected