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

Function openai_completion_body

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

Source from the content-addressed store, hash-verified

72}
73
74fn openai_completion_body(model: &str) -> Vec<u8> {
75 serde_json::to_vec(&serde_json::json!({
76 "id": "mock-cmpl-001",
77 "object": "text_completion",
78 "created": 1_700_000_000_i64,
79 "model": model,
80 "choices": [{
81 "index": 0,
82 "text": "Hello from openshell mock backend",
83 "finish_reason": "stop"
84 }],
85 "usage": {
86 "prompt_tokens": 1,
87 "completion_tokens": 5,
88 "total_tokens": 6
89 }
90 }))
91 .expect("static JSON must serialize")
92}
93
94fn openai_embeddings_body(model: &str) -> Vec<u8> {
95 // Shape must match the OpenAI embeddings response (`object: "list"` with a

Callers 1

mock_responseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected