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

Dynamically adding tools does not properly handle Share Context #259

Closed
cjellick opened this issue Aug 22, 2024 · 7 comments
Closed

Dynamically adding tools does not properly handle Share Context #259

cjellick opened this issue Aug 22, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@cjellick
Copy link
Contributor

Best example of this is the knowledge tool, which has this line:

Share Context: github.com/gptscript-ai/context/workspace

Grant put together tests here:
'https://github.com/g-linville/context-testing

Follow up question: does Share Tools work? seems like it does, but we should verify

@cjellick cjellick added the bug Something isn't working label Aug 22, 2024
@sangee2004
Copy link

This is one of the workflows were we see the Share Context not working when knowledge tool is added using Add Knowledge option.

  1. Create an assistant with no tools.
  2. Chat with the assistant and use Add Knowledge to add a knowledge file.
  3. Try to ask any question relating to knowledge file like say `How to raise money to start a Business "
  4. Notice that knowledge tool will not get called unless we explicitly ask it to use knowledge like - How to raise money to start a Business . Use knowledge."

This behavior of needing to ask it to explicitly use knowledge tool is not needed if I have workspace tool added to the assistant.
This should not needed since we already have Share Context: github.com/gptscript-ai/context/workspace included in knowledge tool.

@cjellick
Copy link
Contributor Author

I'm assigning to myself because I guess the best way forward with this is, as @thedadams mentioned, to support dynamic tool adding in core gptscript. So, I'll talk to @ibuildthecloud about this on monday and see where he wants to go with it.

@cjellick cjellick self-assigned this Aug 23, 2024
@cjellick
Copy link
Contributor Author

fixed in core gptscript here: gptscript-ai/gptscript#827

@cjellick cjellick removed their assignment Aug 27, 2024
@sangee2004
Copy link

sangee2004 commented Aug 27, 2024

Testing desktop app with gptscript version - v0.0.0-dev+f2bfa9f3

I am still able to reproduce the issue with having to ask Knowledge tool to used explicitly when testing the scenario outlined in #259 (comment) . This might be relating to issue - #272.

When I tried again with another knowledge file, I was able to get the Knowledge tool to get invoked without having to ask it to use knowledge explicitly. Also I see the workspace context being used in the stack trace view.

Image

I will also test cases mentioned in https://github.com/g-linville/context-testing

@sangee2004
Copy link

When testing scenarios by adding the tools dynamically to a thread using "Add Tool" from https://github.com/g-linville/context-testing , following are the observations made:

  1. github.com/g-linville/context-testing/direct - Fail - Not able to see the context tool
  2. github.com/g-linville/context-testing/indirect - Fail - Not able to see the context tool
  3. github.com/g-linville/context-testing/sharedirect - Pass
  4. github.com/g-linville/context-testing/sharedirect - Pass

When adding tool - github.com/g-linville/context-testing/direct
Image

When adding tool - github.com/g-linville/context-testing/indirect
Image

@thedadams
Copy link
Contributor

In the case of github.com/g-linville/context-testing/direct, the assistant doesn't have "direct" access to the context. Only the tool blue does because the context is not shared. Therefore, the context is only run when the blue tool is run.

For example:
Screenshot 2024-08-30 at 00 32 27

Similarly for the https://github.com/g-linville/context-testing/indirect tool:
Screenshot 2024-08-30 at 00 33 56

Let me know what you think about these results.

@sangee2004
Copy link

Closing this issue as per testing based on #259 (comment).

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

3 participants