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

Shorter tracebacks (bad solution maybe?) #295

Closed
wants to merge 5 commits into from

Conversation

ProducerMatt
Copy link
Member

@ProducerMatt ProducerMatt commented Jun 21, 2023

I'm trying to change the way that tracebacks work so that callbacks don't reprint the original prompt. This involves giving arguments to the callbacks in such a way that the traceback collector will know to remove them (I decided to try to leave the message ID if there is one, otherwise just leaving <prompt>).

This is my attempted solution, which makes the keyword argument prompt something that the traceback module removes. However it doesn't work. Every module gets asked the question but no responses are ever returned, not even the initial once's inviting a traceback. (I notice that the Sentience module prints "Confused response sent") I'd love it if someone could point out what I'm doing wrong, because I even tried redoing this from scratch and got the same result. Also if anyone knows how to make Python print a stack trace for all threads on demand I'd like to know.

would help #294

@ProducerMatt ProducerMatt added the enhancement New feature or request label Jun 21, 2023
@ProducerMatt ProducerMatt self-assigned this Jun 21, 2023
"""Search for relevant items for the query.

First we load all items from the Alignment Newsletter database.
Then we sort the items by relevance to the query.
Finally we return the most relevant items, if any.
"""
query = prompt
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll factor out these redundant lines once I know whether I'm on the right track at all.

@ProducerMatt
Copy link
Member Author

Rob made a good suggestion, make the traceback generator have a duplicate object detector and only print the first occurrence.

@ProducerMatt ProducerMatt deleted the shorter-traceback branch August 13, 2023 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant