MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / _create_completion

Function _create_completion

agents/master-coordinator/scripts/llm_parser.py:1252–1267  ·  view source on GitHub ↗
(token_budget: int, *, use_response_format: bool)

Source from the content-addressed store, hash-verified

1250 ]
1251
1252 def _create_completion(token_budget: int, *, use_response_format: bool):
1253 kwargs = {
1254 "model": model,
1255 "messages": messages,
1256 "temperature": 0,
1257 "max_tokens": token_budget,
1258 }
1259 if use_response_format:
1260 kwargs["response_format"] = {"type": "json_object"}
1261 for effort in _openai_reasoning_effort_candidates():
1262 try:
1263 return client.chat.completions.create(**{**kwargs, "reasoning_effort": effort})
1264 except Exception as exc:
1265 if not _is_unsupported_reasoning_error(exc):
1266 raise
1267 return client.chat.completions.create(**kwargs)
1268
1269 def _parse_response(response: Any) -> Optional[Dict[str, Any]]:
1270 try:

Callers 1

Calls 3

createMethod · 0.45

Tested by

no test coverage detected