Replies: 4 comments 2 replies
-
What happens if you see nothing after the function and then, refresh your page? Do you then see the message? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Yeah refresh works! Shows it perfectly after refresh. |
Beta Was this translation helpful? Give feedback.
1 reply
-
That makes perfect sense now, thanks again. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Okay got that working smoothly now, thanks again! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello. So I am using the openai API to send a prompt, which returns markdown as a string. I use the following code to display the returned markdown in the text control. The dialog itself is also shown below. For some reason, sometimes the dialog opens with the markdown, some times it does not. Weirdly, if I copy/paste the result from openai into a string variable and then display it, it works fine. However taking the results from the function (string) and trying to pass that to the text control variable fails most of the time. The dialog does not display at all, no exceptions thrown. Any advice would be appreciated (I tried stripping \n, I tried using bleach() to clean the markdown, still sporadic). Tried using "raw" and "pre" modes, same issue.
markdown = get_markdown_result(prompt)
state.report_text = markdown
state.refresh("report_text")
state.show_report_dialog = True
with tgb.Page() as report_dialog:
with tgb.layout():
with tgb.part():
tgb.text(value="{report_text}", mode="markdown")
Beta Was this translation helpful? Give feedback.
All reactions