MCPcopy Create free account
hub / github.com/Luce-Org/lucebox-hub / turn

Function turn

server/scripts/test_multi_turn_prefix_cache.py:107–120  ·  view source on GitHub ↗
(history: list[dict], user: str)

Source from the content-addressed store, hash-verified

105 return data["choices"][0]["message"]["content"]
106
107 def turn(history: list[dict], user: str) -> tuple[float, str]:
108 history.append({"role": "user", "content": user})
109 msgs = [{"role": "system", "content": system}, *history]
110 payload = {
111 "model": "luce-dflash",
112 "messages": msgs,
113 "max_tokens": 8,
114 "stream": False,
115 }
116 t0 = time.time()
117 reply = chat_post(payload)
118 dt = time.time() - t0
119 history.append({"role": "assistant", "content": reply})
120 return dt, reply
121
122 history: list[dict] = []
123

Callers 1

mainFunction · 0.85

Calls 1

chat_postFunction · 0.70

Tested by

no test coverage detected