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

Improve readibility of list results #240

Merged
merged 1 commit into from
Dec 29, 2023
Merged

Conversation

pankajkoti
Copy link
Contributor

The UI renders the response from ask-astro pipeline as a markdown.
For list items, the UI is able to render the list properly when the
list items are separated by \n\n in the backend response, however
when the list items are separated by a single \n, it fails to render
them correctly. It's weird how OpenAI completion response at times
adds a double new line chars and at times adds a single new line
char to separate list items. However, I am adding a transform to
convert single new line chars to double and when the response
already contains two new line chars, not adding any extra new line char.

closes: #215

Copy link

cloudflare-pages bot commented Dec 29, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4b42453
Status: ✅  Deploy successful!
Preview URL: https://a3384d00.ask-astro.pages.dev
Branch Preview URL: https://215-list-results-readibility.ask-astro.pages.dev

View logs

@pankajkoti
Copy link
Contributor Author

Before
Screenshot 2023-12-29 at 3 24 37 PM

After
Screenshot 2023-12-29 at 3 24 48 PM

The UI renders the response from ask-astro pipeline as a markdown.
For list items, the UI is able to render the list properly when the
list items are separated by `\n\n` in the backend response, however
when the list items are separated by a single `\n`, it fails to
render them correctly. It's weird how OpenAI completion response at
times adds a double new line chars and at times adds a single new
line char to separate list items. However, I am adding a transform
to convert single new line chars to double and when the response
already contains two new line chars, not adding any extra new line
char.

closes: #215
Copy link
Collaborator

@pankajastro pankajastro left a comment

Choose a reason for hiding this comment

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

LGTM

@pankajkoti pankajkoti merged commit b9482fd into main Dec 29, 2023
7 checks passed
@pankajkoti pankajkoti deleted the 215-list-results-readibility branch December 29, 2023 10:36
sunank200 added a commit that referenced this pull request Jan 16, 2024
After asking questions in ask.astronomer.io the UI broke after this
[PR](#240) as there is no
check for `"response"` key in the returned dictionary
[here](https://github.com/astronomer/ask-astro/blob/main/api/ask_astro/rest/controllers/get_request.py#L46)

Added the check for the "response" key in the dictionary in the API.

Tested with the following screenshot:

<img width="1719" alt="Screenshot 2024-01-16 at 4 24 58 PM"
src="https://github.com/astronomer/ask-astro/assets/8670962/3a06a613-2ff4-4d3a-a63d-c1ef2627fb03">

close: #266
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.

Improve readability of list results
2 participants