Skip to content

Your lightweight open-source personal agent.

fix(providers): add max_completion_tokens for openai o1 compatibility

flobo3ef10df9acb27
diff --git a/nanobot/providers/openai_compat_provider.py b/nanobot/providers/openai_compat_provider.py
index ffb221e50..07dd811e4 100644
--- a/nanobot/providers/openai_compat_provider.py
+++ b/nanobot/providers/openai_compat_provider.py
@@ -230,6 +230,7 @@ class OpenAICompatProvider(LLMProvider):
"model": model_name,
"messages": self._sanitize_messages(self._sanitize_empty_content(messages)),
"max_tokens": max(1, max_tokens),
+ "max_completion_tokens": max(1, max_tokens),
"temperature": temperature,
}