MCPcopy Create free account
hub / github.com/NVIDIA-NeMo/Switchyard / _make_completion

Function _make_completion

tests/test_response_translation_engine.py:34–48  ·  view source on GitHub ↗
(content: str = "Hello!", model: str = "gpt-4o")

Source from the content-addressed store, hash-verified

32
33
34def _make_completion(content: str = "Hello!", model: str = "gpt-4o") -> ChatCompletion:
35 return ChatCompletion(
36 id="chatcmpl-test",
37 object="chat.completion",
38 created=1700000000,
39 model=model,
40 choices=[
41 Choice(
42 index=0,
43 message=ChatCompletionMessage(role="assistant", content=content),
44 finish_reason="stop",
45 )
46 ],
47 usage=CompletionUsage(prompt_tokens=10, completion_tokens=5, total_tokens=15),
48 )
49
50
51def _make_anthropic_message(content: str = "Hi there", model: str = "claude-sonnet-4-20250514"):

Calls

no outgoing calls

Tested by

no test coverage detected