From 68a936eb2c23cd18266f871a1ef78b83230edd19 Mon Sep 17 00:00:00 2001 From: Liang Jiaqing Date: Sat, 14 Mar 2026 20:34:57 +0800 Subject: [PATCH] debug print result; kimi temp=1.0 compat --- agentmain.py | 1 + llmcore.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/agentmain.py b/agentmain.py index 4151ad5..ffd8205 100644 --- a/agentmain.py +++ b/agentmain.py @@ -189,6 +189,7 @@ if __name__ == '__main__': try: while 'done' not in (item := dq.get(timeout=120)): pass result = item['done'] + print(result) except Exception as e: if once: raise print(f'[Reflect] drain error: {e}'); result = f'[ERROR] {e}' diff --git a/llmcore.py b/llmcore.py index c7ac438..108a876 100644 --- a/llmcore.py +++ b/llmcore.py @@ -84,6 +84,7 @@ class ClaudeSession: return result[::-1] or messages[-2:] def raw_ask(self, messages, model=None, temperature=0.5, max_tokens=6144): model = model or self.default_model + if 'kimi' in model.lower(): temperature = 1.0 # kimi only accepts temp 1.0 headers = {"x-api-key": self.api_key, "Content-Type": "application/json", "anthropic-version": "2023-06-01"} payload = {"model": model, "messages": messages, "temperature": temperature, "max_tokens": max_tokens, "stream": True} try: @@ -168,6 +169,7 @@ class LLMSession: def raw_ask(self, messages, model=None, temperature=0.5): if model is None: model = self.default_model + if 'kimi' in model.lower(): temperature = 1.0 # kimi only accepts temp 1.0 headers = {"Authorization": f"Bearer {self.api_key}", "Content-Type": "application/json", "Accept": "text/event-stream"} if self.api_mode == "responses": url = auto_make_url(self.api_base, "responses")