Skip to content

Script content ends with "```", which gives a syntax error when executing the script #1

@jsribeiro

Description

@jsribeiro

When performing any query using "llm", the presented script always includes a last line with just "```":

$ llm list files
⠹ Querying GPT-3200
───────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: temp.sh
───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ 
   2   │ #!/bin/bash
   3   │ 
   4   │ # list all files in the current directory
   5   │ ls
   6   │ ```
───────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
>> Do you want to run this program? [Y/n] 

Running...

temp.sh
temp.sh: line 6: unexpected EOF while looking for matching ``'

The problem is not in the Python code, but on the response being sent (to any query) by the scale.com endpoint to where queries are sent:

$ curl --json "{\"input\": \"list files\"}" -H "Authorization: Basic clb76yfe1056trk1al1zq2h0w" https://dashboard.scale.com/spellbook/api/app/8r493dlh
{"text":"\n#!/bin/bash\n\n# list all files in the current directory\nls\n```","tokenProbs":{"token_probs":[0.9956690328057338,0.9970640930288881,0.9995904427314845,0.9999405
609865681,0.9999802587338613,0.9995131954278139,0.9917787091856278,0.9857387247843125,0.871412814291589,0.5523837693161734,0.8233424625271832,0.8669347886213419,0.8761240399
...

Maybe a problem on the remote API?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions