Open
Conversation
|
This PR is stale because it has been open 6 months with no activity. Either remove the stale label or comment below with a short update, otherwise this PR will be closed in 7 days. |
xphillyx
pushed a commit
that referenced
this pull request
Jul 10, 2025
…ern#4085) Previously, a tool that that registered itself as having an array parameter had each element of the array registered as a variable, but it did not register the array parameter itself. This meant that it was only really useful with fixed length arrays. This patch adds a variable for the array itself that lives alongside the existing args. I don't expect this to have any backward compatiblity concerns. Repro: ```stscript // this requires lalib to function | /let key=schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "string", "properties": { "example": { "type": "array", "contains": { "type": "string" } } }, "required": [ "example" ] } || /tools-register name=YourFunc description="filler" parameters={{var::schema}} {: /let ex {: /try {: /return {{var::arg.example}} :} :}() | /= ex.isException | /if rule=not left={{pipe}} else={: /console-log {{var::ex}} :} {: /console-log "arg.example: {{var::arg.example}}" | /foreach {{var::arg.example}} {: /console-log "#{{var::index}}: {{var::item}}" :} :} | /try {: /return {{var::arg.example.0}} :} | /console-log "arg.example.0: {{pipe}}" | /try {: /return {{var::arg.example.1}} :} | /console-log "arg.example.1: {{pipe}}" | /try {: /return {{var::arg.example.2}} :} | /console-log "arg.example.2: {{pipe}}" | /try {: /return {{var::arg.example.3}} :} | /console-log "arg.example.3: {{pipe}}" | :} || /let key=params { "example": [ "test1", "test2", "test3" ] } | /tools-invoke parameters={{var::params}} YourFunc ``` Currently produces: ``` [/console-log] arg.example: {"isException":true,"exception":"No such variable: \"arg.example\""} [/console-log] arg.example.0: {"isException":false,"result":"test1"} [/console-log] arg.example.1: {"isException":false,"result":"test2"} [/console-log] arg.example.2: {"isException":false,"result":"test3"} [/console-log] arg.example.3: {"isException":true,"exception":"No such variable: \"arg.example.3\""} ``` With this patch it produces: ``` [/console-log] arg.example: ["test1","test2","test3"] [/console-log] #0: test1 [/console-log] #1: test2 [/console-log] SillyTavern#2: test3 [/console-log] arg.example.0: {"isException":false,"result":"test1"} [/console-log] arg.example.1: {"isException":false,"result":"test2"} [/console-log] arg.example.2: {"isException":false,"result":"test3"} [/console-log] arg.example.3: {"isException":true,"exception":"No such variable: \"arg.example.3\""} ```
*Total -- 298.47kb -> 262.32kb (12.11%) /public/img/infermaticai.svg -- 1.42kb -> 0.52kb (63.64%) /public/img/xai.svg -- 1.59kb -> 0.60kb (62.65%) /public/img/01ai.svg -- 1.81kb -> 0.81kb (55.23%) /public/img/aphrodite.svg -- 2.80kb -> 1.34kb (52.18%) /public/img/groq.svg -- 1.89kb -> 0.97kb (48.63%) /public/img/No-Image-Placeholder.svg -- 15.45kb -> 8.29kb (46.33%) /public/img/custom.svg -- 2.28kb -> 1.30kb (43.11%) /public/img/togetherai.svg -- 2.42kb -> 1.46kb (39.58%) /public/img/featherless.svg -- 2.21kb -> 1.34kb (39.37%) /public/img/step-over.svg -- 6.34kb -> 3.90kb (38.57%) /public/img/step-into.svg -- 6.34kb -> 3.90kb (38.57%) /public/img/step-out.svg -- 6.34kb -> 3.90kb (38.56%) /public/img/cohere.svg -- 2.37kb -> 1.50kb (36.86%) /public/img/scale.svg -- 4.69kb -> 3.47kb (25.98%) /public/img/mistralai.svg -- 0.70kb -> 0.52kb (25.56%) /public/img/step-resume.svg -- 10.72kb -> 8.04kb (25.03%) /public/img/llamacpp.svg -- 3.67kb -> 2.77kb (24.71%) /public/img/ollama.svg -- 4.46kb -> 3.45kb (22.57%) /public/img/palm.svg -- 3.96kb -> 3.14kb (20.54%) /public/img/huggingface.svg -- 5.56kb -> 4.61kb (17.05%) /public/img/openrouter.svg -- 0.76kb -> 0.64kb (15.83%) /public/img/generic.svg -- 0.78kb -> 0.66kb (15.82%) /public/img/tabby.svg -- 1.34kb -> 1.16kb (13.31%) /public/img/koboldhorde.svg -- 7.44kb -> 6.45kb (13.27%) /public/img/siliconflow.svg -- 0.55kb -> 0.48kb (12.68%) /public/img/ai21.svg -- 2.42kb -> 2.18kb (9.95%) /public/img/manual.svg -- 0.50kb -> 0.45kb (9.92%) /public/img/down-arrow.svg -- 0.12kb -> 0.11kb (8.94%) /public/img/claude.svg -- 1.39kb -> 1.28kb (8.13%) /public/img/makersuite.svg -- 2.40kb -> 2.29kb (4.68%) /public/img/vertexai.svg -- 1.46kb -> 1.40kb (4.67%) /public/img/zai.svg -- 0.40kb -> 0.39kb (4.35%) /public/img/textgenerationwebui.svg -- 5.98kb -> 5.80kb (3.02%) /public/img/fireworks.svg -- 0.78kb -> 0.76kb (2.39%) /public/img/koboldcpp.svg -- 69.53kb -> 68.27kb (1.82%) /public/img/kobold.svg -- 69.53kb -> 68.27kb (1.82%) /public/img/dreamgen.svg -- 0.40kb -> 0.39kb (1.72%) /public/img/mancer.svg -- 0.55kb -> 0.54kb (1.25%) /public/img/blockentropy.svg -- 0.50kb -> 0.49kb (1.18%) /public/img/azure_openai.svg -- 0.46kb -> 0.45kb (1.07%) /public/img/deepseek.svg -- 4.56kb -> 4.51kb (1.05%) /public/img/aimlapi.svg -- 1.09kb -> 1.08kb (0.9%) /public/img/electronhub.svg -- 0.58kb -> 0.57kb (0.68%) /public/img/chutes.svg -- 0.88kb -> 0.88kb (0.67%) /public/img/perplexity.svg -- 0.77kb -> 0.76kb (0.51%) /public/img/novel.svg -- 1.40kb -> 1.40kb (0.28%) /public/img/nanogpt.svg -- 1.15kb -> 1.14kb (0.09%) /public/img/pollinations.svg -- 33.71kb -> 33.70kb (0.04%) Signed-off-by: ImgBotApp <[email protected]>
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Beep boop. Your images are optimized!
Your image file size has been reduced by 12% 🎉
Details
📝 docs |
repo | 🙋🏾 issues | 🏪 marketplace
~Imgbot - Part of Optimole family