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

Implemented tool capabilities #232

Merged
merged 10 commits into from
Jun 7, 2024
Merged

Implemented tool capabilities #232

merged 10 commits into from
Jun 7, 2024

Conversation

Whitelisted1
Copy link
Contributor

General Changes

  • Implemented tool.py and file.py classes
  • Implemented ability to download file in file.py

Refactoring Changes

  • Refactored RESPONSE_TYPE_* to class ResponseTypes.*
  • Refactored MSGSTATUS_* to class MessageStatus.*
  • Renamed some internal variables in next function to be clearer
  • Add some short inline comments

Incomplete Features

  • With the current setup, the user is unable to get live information about tools that are running, such as when they start and end

Downloading image file example:

out = chatbot.query("Make an image of a computer")
print(out)

file = out.get_files_created()[0]

f = open(f"out.{file.mime.split('/')[1]}", "bw")
f.write(file.download_file(chatbot))
f.close()

Still not completely finished, currently a work in progress
Example usage:
```python
f = open(f"out.{file.mime.split('/')[1]}", "bw")
f.write(file.download_file(chatbot))
f.close()
```
* Refactored RESPONSE_TYPE_* to class ResponseTypes.*
* Refactored MSGSTATUS_* to class MessageStatus.*
* Renamed some internal variables in __next__ function to be clearer
* Add some short inline comments
More of a temporary solution, as we do not know what is causing this
@Whitelisted1
Copy link
Contributor Author

When streaming the content, we now remove the repeated '\u0000' characters that were at the end of each token. This is more of a temporary solution, as we do not know what is causing this, but it should work for now

Solution for #230

@Soulter Soulter merged commit 3191bee into Soulter:master Jun 7, 2024
7 of 12 checks passed
@Soulter Soulter mentioned this pull request Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants