Skip to content

Commit d92a93e

Browse files
committed
fix: trim leading whitespace from arg descriptions
Trim the optional leading whitespace from descriptions when parsing arguments to prevent them from showing up in the chat completion function definitions produced by gptscript. Signed-off-by: Nick Hale <[email protected]>
1 parent cdd7016 commit d92a93e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/parser/parser.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func addArg(line string, tool *types.Tool) error {
6060

6161
tool.Parameters.Arguments.Properties[key] = &openapi3.SchemaRef{
6262
Value: &openapi3.Schema{
63-
Description: value,
63+
Description: strings.TrimSpace(value),
6464
Type: "string",
6565
},
6666
}

0 commit comments

Comments
 (0)