Skip to content

Commit 980649e

Browse files
committed
fix(ai): ignore default values for required fields in CollectionField
1 parent d8dd026 commit 980649e

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

‎apps/python-service/routers/ai.py‎

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,17 @@ def validate_field(self):
5858

5959
if self.default is not None:
6060
if self.required:
61-
raise ValueError("default is not allowed on required fields")
62-
if self.type not in ["String", "Number", "Boolean"]:
63-
raise ValueError(f"default is not allowed on {self.type} fields")
64-
65-
if self.type == "Boolean" and not isinstance(self.default, bool):
66-
raise ValueError("default must be boolean for Boolean fields")
67-
elif self.type == "Number" and not (isinstance(self.default, (int, float)) and not isinstance(self.default, bool)):
68-
raise ValueError("default must be numeric for Number fields")
69-
elif self.type == "String" and not isinstance(self.default, str):
70-
raise ValueError("default must be string for String fields")
61+
self.default = None
62+
else:
63+
if self.type not in ["String", "Number", "Boolean"]:
64+
raise ValueError(f"default is not allowed on {self.type} fields")
65+
66+
if self.type == "Boolean" and not isinstance(self.default, bool):
67+
raise ValueError("default must be boolean for Boolean fields")
68+
elif self.type == "Number" and not (isinstance(self.default, (int, float)) and not isinstance(self.default, bool)):
69+
raise ValueError("default must be numeric for Number fields")
70+
elif self.type == "String" and not isinstance(self.default, str):
71+
raise ValueError("default must be string for String fields")
7172

7273
return self
7374

‎apps/web-dashboard/src/components/CollectionCreatorAgent.jsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ export default function CollectionCreatorAgent({ projectId, onInsertAll }) {
262262
</div>
263263
</div>
264264
<span className="text-[10px] text-[var(--color-text-muted)] italic mr-1">
265-
Tip: use llama-3.3-70b for best results
265+
Tip: use qwen/qwen3.6-27b or openai/gpt-oss-120b for best results
266266
</span>
267267
</div>
268268
</div>

0 commit comments

Comments
 (0)