i get Error 400 Invalid shema function 'createProject': False is not of type array when i pass the tool that call a function to create a project in chatCompletions #893
Labels
bug
Something isn't working
Your issue may already be reported!
Please search on the issue tracker before creating one.
Describe the bug
A clear and concise description of what the bug is. If it's an API-related bug, please provide relevant endpoint(s).
To Reproduce
Steps to reproduce the behavior, including any relevant code snippets.
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots/Logs
If applicable, add screenshots to help explain your problem. For non-graphical issues, please provide any relevant logs or stack traces.
Environment (please complete the following information):
Additional context
Add any other context about the problem here.
function createProjectCreationTool() {
return {
type: "function",
function: {
name: "createProject",
description: "Creates a new project with specified details.",
function: createProject,
parameters: {
type: "object",
properties: {
projectName: { type: "string", description: "Name of the project" },
department: { type: "string", enum: ["marketing"], description: "Department responsible for the project" },
webOrMobile: { type: "array", items: { type: "string" }, description: "Project platforms (e.g., ['web', 'mobile'])" },
modules: { type: "array", items: { type: "string" }, description: "List of project modules" },
customerName: { type: "string", description: "Name of the customer" },
//leadId: { type: "string", description: "ID of the associated lead", required: false },
expected_start_date: { type: "string", description: "Expected start date in format YYYY-MM-DD", required: false },
expected_completion_date: { type: "string", description: "Expected completion date in format YYYY-MM-DD", required: false },
project_status: { type: "string", description: "Initial status of the project", required: false },
total_value: { type: "string", description: "Total value of the project", required: false },
amount_paid: { type: "string", description: "Amount paid so far", required: false },
amount_due: { type: "string", description: "Amount due for the project", required: false }
},
required: []
}
}
};
}
async function createProject(args) {
const {
projectName,
department = "marketing",
// webOrMobile = [],
// modules = [],
customerName,
// leadId,
expected_start_date,
expected_completion_date,
project_status = "Pending",
total_value,
amount_paid,
amount_due
} = JSON.parse(args);
await newProject.save();
}
The text was updated successfully, but these errors were encountered: