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

Function _build_model_settings

codewiki/src/be/llm_services.py:41–51  ·  view source on GitHub ↗

Build model settings with the correct token parameter.

(config: Config, model_name: str)

Source from the content-addressed store, hash-verified

39 part-level marker would land on a nested block, which Anthropic rejects.
40 Other roles get it on the last content part (string content is converted to
41 a single text part).
42 """
43 if message.get("role") == "tool":
44 message.setdefault("cache_control", dict(_EPHEMERAL_CACHE))
45 return
46 content = message.get("content")
47 if isinstance(content, str) and content:
48 message["content"] = [
49 {"type": "text", "text": content, "cache_control": dict(_EPHEMERAL_CACHE)}
50 ]
51 elif isinstance(content, list) and content:
52 last_part = content[-1]
53 if isinstance(last_part, dict):
54 last_part.setdefault("cache_control", dict(_EPHEMERAL_CACHE))

Callers 2

create_main_modelFunction · 0.85
create_fallback_modelFunction · 0.85

Calls 1

Tested by

no test coverage detected