fix: remove invalid debug argument from OpenAI and OpenRouter providers

The debug argument is used internally by devgen but is not accepted by the OpenAI API client. This change filters it out from kwargs before the API call to prevent TypeError.
This commit is contained in:
sankalp committed 2025-12-14 07:57:16 +05:45
1 parent e9a45cf140
commit 407458149b
2 files changed
+6

No files matched your search

+3
View File
@@ -39,6 +39,9 @@ class OpenaiProvider:
# Add error handling if the client fails to initialize
raise RuntimeError(f"Failed to initialize OpenAI client: {e}")
# Remove debug from kwargs if present
kwargs.pop("debug", None)
# 2. Use the modern API syntax: client.chat.completions.create
response = client.chat.completions.create(
model=model or self.DEFAULT_MODEL,
+3
View File
@@ -19,6 +19,9 @@ class OpenrouterProvider:
api_key=api_key,
)
# Remove debug from kwargs if present
kwargs.pop("debug", None)
response = client.chat.completions.create(
model=model,
messages=[{"role": "user", "content": prompt}],