Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TUI - Chat exits when tool execution encounters errors. #573

Open
sangee2004 opened this issue Jun 27, 2024 · 1 comment
Open

TUI - Chat exits when tool execution encounters errors. #573

sangee2004 opened this issue Jun 27, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@sangee2004
Copy link
Contributor

gptscript version v0.0.0-dev-53f7fbde-dirty

Steps to reproduce the problem:

  1. Chat with the local-files-demo with claude-3-5-sonnet-20240620 provider using the example prompts given in docs - https://docs.gptscript.ai/examples/local-files - gptscript --default-model 'claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider' --workspace . github.com/gptscript-ai/local-files-demo

2. It tries to use structuredDataQuerier tool for Can you make a cleaned up csv of it?` and fails since ".txt" file is not supported.


> Yes. Can you make a cleaned up csv of it?

    ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
    │ Call Arguments:                                                                                                                                                                    
    │                                                                                                                                                                                    
    │ structuredDataQuerier {"file": "/Users/sangeethahariharan/local-files-demo/sample-data/key_contacts.txt", "prompt": "Clean and structure the key contacts data. Create a table wit.
    └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
                                                                                                                                                                                         
    ┌──────────────────────────────────────────────────────────────────────────────────────────────┐
    │ Call Arguments:                                                                              │
    │                                                                                              │
    │ loadData {"file": "/Users/sangeethahariharan/local-files-demo/sample-data/key_contacts.txt"} │
    └──────────────────────────────────────────────────────────────────────────────────────────────┘
                                                                                                    
    ┌──────────────────────────────────────────────────────┐
    │ Call Arguments:                                      │
    │                                                      │
    │ createDatabaseFile {"dbFile": "key_contacts.duckdb"} │
    └──────────────────────────────────────────────────────┘
                                                            
  Running create-database-file from github.com/gptscript-ai/structured-data-querier                                                                                              

    ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
    │ Success, The database already exists at /Users/sangeethahariharan/local-files-demo/sample-data/key_contacts.duckdb. │
    └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
                                                                                                                           
    ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
    │ Call Arguments:                                                                                                                 │
    │                                                                                                                                 │
    │ readSchema {"dbFile": "key_contacts.duckdb", "file": "/Users/sangeethahariharan/local-files-demo/sample-data/key_contacts.txt"} │
    └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
                                                                                                                                       
  Running read-schema from github.com/gptscript-ai/structured-data-querier                                                                                                       

    ┌─────────────────────────────────────────────────────────────────────────────────────────────┐
    │ Error, Unsupported file type. Please provide a .json, .ndjson, .jsonl, .csv, or .xlsx file. │
    └─────────────────────────────────────────────────────────────────────────────────────────────┘
                                                                                                   2024/06/26 16:19:27 ERROR: Error, Unsupported file type. Please provide a .json, .ndjson, .jsonl, .csv, or .xlsx file.
: exit status 1
>

In this case , if I instruct the LLM to use read tool specifically it would succeed like Can you make a cleaned up csv of it? Use read tool for this. .

Expected Behavior:
Error should be presented to the user and he should still be present in the context of chat so that they are able to alter the chat messages and move forward.

@sangee2004 sangee2004 added the bug Something isn't working label Jun 27, 2024
@njhale njhale self-assigned this Jul 2, 2024
@njhale
Copy link
Member

njhale commented Jul 2, 2024

Reproduced this on v0.9.1 and have some notes:

  • Looks like the error is being generated by a sub call of a context tool here, which in turn, causes gptscript to exit
  • This issue is not specific to the TUI, it also occurs when the TUI is disabled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants