#Anyone have experience formating
1 messages · Page 1 of 1 (latest)
You haven't given us any context so I'll assume you're trying to do this in AmigaBASIC. Assuming your input string is MessageContentText(text=Text(annotations=[], value='I need to solve the equation 3x + 11 = 14. Can you help me?'), type='text') then GPT suggests that you could use the following code:
[snip - a long joke answer with amigabasic code]
big enough to be in its own thread perhaps
Although AmigaBASIC is a joke, my point is:
- To get good answers you need to ask good questions
- You can ask GPT to write programs for you
Yeah ive been through the wringer on GPT.. my code is broken. Faaaaakkk, sorry, stressed out.
Sorry I don't use python myself, best I could make is educated guesses, or general rhetorical advice about using gpt to troubleshoot
roger that
So your code being broken, I assume you get some sort of error message that you can use to figure out how it's broken? You haven't described a very complex program - is it so broken that you need to scrap it and start again?
nah, the code works fine it just outputs the content all messy, I then have to 'manually' paste it into ChatGPT 3.5 (free) to clean it up. I'm not in the business of doing things manually. HAHA. I tried using the python markdown module, add a function to convert markdown to html, and it 'tries' but still outputs a mess.
I fully understand that asking a programatic question without details is near impossible to answer... just grasping at straws at this point.
I'm also talking about 30+ outputs per run. Thus why manually is inneficient.
So your two options
- Automatically make another call to gpt3.5 api to extract the text from the response of the assistant (ugh)
- Function that extracts the text, assuming that it is always in the same format
#2 will of course be what almost everyone does. So is your problem with actually extracting the text from the outputted object, or converting that extracted text to markdown?
problem is converting it to non-messy. It outputs to CSV in the correct column, and everything else is fine. The column (content) in question has markdown html h1, h2, h3, lists, tables etc. (for blog posts) .. if I strip all of it down to raw plaintext doesn't help me either because its unformatted. You see the predicement?
One thing may be an option is a Google Sheet script that converts the cell???? I dont know how to do that though.. F...
markdown and html are different things
How do you actually want the content to be formatted? You should ask GPT to output in that format, minimal postprocessing for you that way
tried that, still trash output. Content is all there, just formating is absolutely POOCHED. I'll keep picking away at it. Thanks for your help.
if I discover anything I'll follow up here.
I'd be interested to see a sanitized example of the pooched output
sure, let create a psuedo topic, ill attach a txt file
3min to gen, gimme a sec.
this is how I need it to output (in html formating, without opening <html> </html> tags (for a blog post)
I see that it is outputting a combination of html and markdown
its a mess LOL
earlier you used the phrase "html markdown", which is meaningless, but I wonder if your prompt to gpt actually does contain the words "html markdown" which might result in this frankenstein's monster
i'll double check. sec
there was a couple instances of the term 'html' I have removed, and re-running. 2 min. i'll provide a new txt
If you want it in html, unless your program is doing the markdown->html conversion, you should remove the word markdown from everything, and make it clear that you only want pure HTML
I'm lost, do you want markdown or html?
i WANT html. But markdown is easier for gpt to understand in my experience. Thus gen in markdown, format markdown-2-html afterwords.
markdown only, no reference to HTML in any of the instructions.
desired output from the second txt i sent.
actual output if you replace /n with actual newlines
actually I did that wrong, one sec
this is using Assistants API too, not sure if I mentioned that. It's not completions api
yeah that looks great.. WTF
The HTML that was in there, shouldn't have had any effect because it was just an anchor
ok... maybe it was the rogue HTML terms in my instructions. I will play with it and get back to you.
so whatever problem you're having might actually be in your markdown2html process
sincerely appreciate your feedback. Sometimes just have to bounce ideas of people to troubleshoot. Appreciated !!!
I suggest replacing the \n with newlines before markdown2html
because markdown cares about lines and html does not
the \n is default output... thats what the API is throwing back at me.
that's fine and sensible for storage
ok i'll fiddle around some more, i'll keep you posted. Cheers for the help bud.
PS I was using https://markdownlivepreview.com/ to check the markdown results
This is the online markdown editor with live preview.
thats the output from the site you provided.
same with the other site I use.
so.. yeah.
you have to do some massaging.. only give it the content of "value", and I did a find/replace to replace the \n with actual new lines
^^^^^^^^^^^^^
yeah, ok ... so this is the question then. HOW TO remove the \n automaticaly with python. and make it a carriage return.
lol
sorry, ive been banging my head on the wall with this for days.... no sleep till bedtime!
I'm sure you can figure that part out
https://stackoverflow.com/a/42965750 to start
ill dig in and keep you posted. thanks again
you see what i'm trying to do though right? .. need to cleanse the output, then use markdown2html or whatever. all in one clean run. Trying to avoid the manual interaction.
but yeah, thanks!! much appreciated.
there are only two more things you need it to do:
- extract just the "value" part of the output
- replace \n with newlines before running markdown2html
what is "new lines" .. like an ascii   (not non-breaking space obviously) .. whats the term for new line
I've told you what you need to figure out, I have my own job to be doing