docs: add cookbook for tool calling and LLM patterns#49
docs: add cookbook for tool calling and LLM patterns#49obrutjack wants to merge 1 commit intoopenclaw:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3396dca6a0
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| Q: "$LOBSTER_ARG_QUESTION" | ||
| run: > | ||
| openclaw.invoke --tool llm-task --action json | ||
| --args-json "{\"prompt\":\"$Q\"}" |
There was a problem hiding this comment.
Build args JSON safely from env variables
This example is labeled as shell-safe for quotes/special characters, but --args-json "{\"prompt\":\"$Q\"}" still inlines $Q into a JSON string without escaping. If question contains a double quote (e.g. He said "hi"), the resulting JSON becomes invalid and openclaw.invoke fails with --args-json must be valid JSON, so the documented “safe” pattern breaks on common inputs. Use a JSON encoder (for example via jq --arg) instead of manual string interpolation.
Useful? React with 👍 / 👎.
Closes #26
Adds a Cookbook section to the README with common workflow patterns:
llm.invokevsllm_task.invokevsopenclaw.invokeThis directly addresses the confusion in #26 where the user couldn't figure out the correct syntax for calling LLMs mid-workflow.