-
Notifications
You must be signed in to change notification settings - Fork 2
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
Resizing window breaks the chat UI #7
Comments
This is expected because we have no means to repaint the entire UI with the increase or decrease of the rows and columns of the terminal(i.e change in dimensions of the terminal app). But yes. I will give it a thought and I think we will end up using Textual eventually. |
Update: I tried using Textual and it is a bit of a learning curve for me. Also it has CSS elements for styling. However I can't get it to work the "LLM token streaming generation" for some reason. For now I think we should remove the frame. In this way it won't break if the window is resized. |
Wow! It's like you read my mind! haha. I tried playing around with I found What I did learn is that we'll need to implement our own custom widgets and labels. So, for output we would use There are the The CSS seems to be a custom, watered down, implementation as well. So instead of referencing an HTML element, we would reference a class identifier instead. I also have been running into limitations with # Define a custom Box style with no visible characters
no_border_box = box.Box(
" \n" # top
" \n" # head
" \n" # head_row
" \n" # mid
" \n" # row
" \n" # foot_row
" \n" # foot
" \n", # bottom
ascii=True, # Setting ascii to True to emphasize the lack of box characters
) Then we would just instantiate any panels with our custom border. self.console.print(
Panel(
Markdown(message["content"]),
title=title.upper(),
title_align="left",
box=no_border_box,
)
) I really don't like this approach because it feels really hacky, but the following is a direct copy and paste from a test I just finished running. 11:39:26 | /mnt/valerie/rich-chat HUMAN ASSISTANT HUMAN ASSISTANT def is_prime(n):
if n <= 1:
return False
for i in range(2, int(n**0.5) + 1):
if n % i == 0:
return False
return True
primes = [n for n in range(2, 100) if is_prime(n)]
print(primes) In this solution, the is_prime function checks whether a given number is prime by iterating from 2 to the square root of the number and checking if Then, we iterate through numbers starting from 2 up to 100 (since you mentioned the smallest prime number as 2) using a list comprehension. For each Finally, when the script runs, it prints out this list containing all the prime numbers up to 100. Not completely ideal because we can't remove the padding, otherwise it just results in a I'm honestly considering just building a custom interface that places LLM's as first class citizens. All of the existing frameworks were not built with any of this tech in mind so it's all very convoluted and difficult to implement and manage. I'd prefer to not repeat the same mistakes I made with my Something else to keep in mind is that all of the above does nothing to resolve the resizing issue. We would need to clear the screen and render everything again, but I don't like that idea either. There's most likely a better way. |
I have got an idea. Will come back to you after trying. |
Update: Oh well! upload.webmUpdate 2: |
Not sure what level priority this should have, but this is pretty high for me. Resizing the window breaks the formatting and makes it impossible to read the output in the terminal.
We should prioritize fixing this sooner than later if we don't know how this will affect the overall structure of the code. This way, we still have some flexibility before going deeper into specific UI/UX details.
The text was updated successfully, but these errors were encountered: