diff --git a/VERSION b/VERSION index 7d5c540..216bf20 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.0+44 +0.1.0+45 diff --git a/apinex_client.py b/apinex_client.py index 60bdff6..0a9418c 100644 --- a/apinex_client.py +++ b/apinex_client.py @@ -443,7 +443,6 @@ async def chat_text( "model": model, "messages": [{"role": "user", "content": user_content}], "temperature": 0.3, - "max_tokens": 1800, } payload = { "model": model, @@ -452,7 +451,6 @@ async def chat_text( {"role": "user", "content": user_content}, ], "temperature": 0.3, - "max_tokens": 1800, } for attempt in range(3): attempt_payload = dict(payload) diff --git a/tests/test_writer_features.py b/tests/test_writer_features.py index 732d89d..0d3bdf5 100644 --- a/tests/test_writer_features.py +++ b/tests/test_writer_features.py @@ -124,6 +124,7 @@ class ApinexTests(unittest.IsolatedAsyncioTestCase): _, kwargs = fake_session.request self.assertEqual(kwargs["json"]["model"], "gemini-3.8-flash") self.assertEqual(kwargs["json"]["messages"][0]["role"], "system") + self.assertNotIn("max_tokens", kwargs["json"]) logs = user_store.list_api_call_logs(limit=1) self.assertEqual(len(logs), 1) log = user_store.get_api_call_log(logs[0]["id"] if isinstance(logs[0]["id"], int) else -1) @@ -273,10 +274,10 @@ class ApinexTests(unittest.IsolatedAsyncioTestCase): self.assertEqual(detail["status_code"], 200) self.assertIsInstance(detail["duration_ms"], int) - async def test_api_log_redacts_secrets_but_keeps_token_limits(self): + async def test_api_log_redacts_secrets_without_token_limit(self): await apinex_client._record_api_call( stage="test", model="model", prompt_name="test", system_prompt="", - request={"max_tokens": 1800, "api_key": "private-key"}, + request={"api_key": "private-key"}, response={"authorization": "Bearer private-token", "detail": "Bearer private-token"}, ) log = user_store.list_api_call_logs(limit=1)[0] @@ -286,7 +287,7 @@ class ApinexTests(unittest.IsolatedAsyncioTestCase): assert detail is not None request = json.loads(str(detail["request_json"])) response = json.loads(str(detail["response_json"])) - self.assertEqual(request["max_tokens"], 1800) + self.assertNotIn("max_tokens", request) self.assertEqual(request["api_key"], "[REDACTED]") self.assertEqual(response["authorization"], "[REDACTED]") self.assertEqual(response["detail"], "Bearer [REDACTED]")