MCPcopy Create free account
hub / github.com/FSoft-AI4Code/CodeWiki / get_backend

Function get_backend

codewiki/src/be/backend.py:60–67  ·  view source on GitHub ↗

Return the backend instance matching ``config.provider``.

(config)

Source from the content-addressed store, hash-verified

58 if isinstance(value, (int, float)) and not isinstance(value, bool):
59 out[key] = value
60 if not out and hasattr(usage, "model_dump"):
61 try:
62 return {k: v for k, v in usage.model_dump().items() if isinstance(v, (int, float))}
63 except Exception: # noqa: BLE001 — usage is optional telemetry
64 return None
65 return out or None
66
67
68CAW_PROVIDERS = frozenset({"claude-code", "codex"})
69
70

Callers 1

__init__Method · 0.90

Calls 3

CawBackendClass · 0.90
PydanticAIBackendClass · 0.90
is_caw_providerFunction · 0.85

Tested by

no test coverage detected