sigoden / llm-functions

Easily create LLM tools and agents using Bash/JavaScript/Python, also a library of commonly used LLM tools and agents.
MIT License
166 stars 22 forks source link

coder agent: functions confused by `---` as content and getting `error: unexpected argument `---`` #94

Closed David-Else closed 2 months ago

David-Else commented 2 months ago

Describe the bug I don't know if my bug report title as accurate as I am not certain of the problem. _index.md is not written, Using the coder agent to convert a static website to hugo I quickly get the following error, even after telling it to quote strings:

please make sure you quote any strings when you call functions and try again
Call fs_mkdir {"path":"hugo"}
Call fs_mkdir {"path":"hugo/content"}
Call fs_mkdir {"path":"hugo/content/post"}
Call coder fs_create {"path":"hugo/content/_index.md","content":"---\ntitle: \"Home\"\ndescription: \"Welcome to my awesome blog post page powered by Hugo and styled with Tailwind CSS.\"\n---\n\n# Welcome to My Blog\n\nWelcome to my awesome blog post page powered by Hugo and styled with Tailwind CSS.\n\n## Latest Tutorials\n\n{{< content >}}"}
error: unexpected argument `---
title: "Home"
description: "Welcome to my awesome blog post page powered by Hugo and styled with Tailwind CSS."
---

# Welcome to My Blog

Welcome to my awesome blog post page powered by Hugo and styled with Tailwind CSS.

## Latest Tutorials

{{< content >}}` found
Tool call exit with 1

To Reproduce I am converting a static website to hugo, so it is not a good idea to upload all my source files.

Expected behavior

Screenshots/Logs

Environment

Linux debian 6.1.0-23-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.99-1 (2024-07-15) x86_64 GNU/Linux
aichat 0.20.0
argc 1.20.0
jq-1.6
/usr/bin/bash GNU bash, version 5.2.15(1)-release (x86_64-pc-linux-gnu)
/usr/bin/node v18.19.0
sigoden commented 2 months ago

argc v1.20.1 fixed this bug. please upgrade your argc.