Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/prompts/tools/native-tools/browser_action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default {
function: {
name: "browser_action",
description: BROWSER_ACTION_DESCRIPTION,
strict: true,
strict: false,
parameters: {
type: "object",
properties: {
Expand Down
6 changes: 5 additions & 1 deletion src/core/prompts/tools/native-tools/read_file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ export function createReadFileTool(partialReadsEnabled: boolean = true): OpenAI.
}
}

// When using strict mode, ALL properties must be in the required array
// Optional properties are handled by having type: ["...", "null"]
const fileRequiredProperties = partialReadsEnabled ? ["path", "line_ranges"] : ["path"]

return {
type: "function",
function: {
Expand All @@ -70,7 +74,7 @@ export function createReadFileTool(partialReadsEnabled: boolean = true): OpenAI.
items: {
type: "object",
properties: fileProperties,
required: ["path"],
required: fileRequiredProperties,
additionalProperties: false,
},
minItems: 1,
Expand Down
Loading