Currently request field is TEXT which is 5,535 bytes in MySQL, I should probably update it to MEDIUMTEXT with 16,777,215 characters max.nou nou wrote: ↑Sun May 05, 2024 8:41 pm How long can a ChatGPT request be?
Code: Select all
General Error SQL ERROR [ mysqli ] Data too long for column 'request' at row 1 [1406] SQL
This works great, apart from the SQL commands in your how-to, like
I end up with links likeUPDATE <you_prefix>_posts
SET post_text = REGEXP_REPLACE(post_text,
'https://cdn\\.discordapp\\.com/attachments/([0-9]+)/([0-9]+)/([^.]+)\\.([A-Za-z0-9]+)(\\?ex=)?',
'<your_website_root_url>/ailabs/discord_cdn/cdn.discordapp.com/attachments/\\1/\\2/\\3?ext=\\4&ex=')
WHERE post_text LIKE "%https://cdn.discordapp.com/attachments/%"
Code: Select all
https://www.mywebsite.com/ailabs/discord_cdn/cdn.discordapp.com/attachments/1/2/3?ext=4&ex=660dcd2f&is=65fb582f&hm=e5c7767448adb0846e2edf8862b446aa352f77d6d7a9ea89b493e6fdbd35c8d3&
Most likely that REGEXP_REPLACE may need to be adjusted to the match you MySQL/MariaDB version.
Code: Select all
<website_root>/ailabs/discord_cdn/cdn.discordapp.com/attachments/<discord_server>/<discord_channel>/secondman__It_looks_like_hell_is_freezing_over_in_a_very_good_w_c32608e0-a60a-4647-a557-1b1ebee7963f?ext=png&ex=663bb53c&is=663a63bc&hm=65448e8385664a0165142b4c58182a90c36768bcb0ecb06772aca1032036ff88&
Does this work with the Quickedit extension? It doesn't seem to on my test board.Changelog wrote:You can edit the original conversation after it has been posted and add more @mention AI bot tags if you missed them example
Sorry, I'm not familiar with Quickedit, I'd imagine it should, just make sure you update @mention code. I probably should reach out to Paul and suggest that change.
Great, you should be good to go with new generations.nou nou wrote: ↑Wed May 08, 2024 8:27 am Yes, the new ones look like this:
Code: Select all
<website_root>/ailabs/discord_cdn/cdn.discordapp.com/attachments/<discord_server>/<discord_channel>/secondman__It_looks_like_hell_is_freezing_over_in_a_very_good_w_c32608e0-a60a-4647-a557-1b1ebee7963f?ext=png&ex=663bb53c&is=663a63bc&hm=65448e8385664a0165142b4c58182a90c36768bcb0ecb06772aca1032036ff88&
I'm an idiot. I literally just re-installed the extension because of some old BBCode thing that snuck in from years ago and I forgot to re-update that file.privet.fun wrote: ↑Thu May 09, 2024 5:11 pm Sorry, I'm not familiar with Quickedit, I'd imagine it should, just make sure you update @mention code. I probably should reach out to Paul and suggest that change.
I don't regex at all - it's about 40 posts, I'll put some headphones on and do it manually.privet.fun wrote: ↑Thu May 09, 2024 5:12 pmGreat, you should be good to go with new generations.nou nou wrote: ↑Wed May 08, 2024 8:27 am Yes, the new ones look like this:
Code: Select all
<website_root>/ailabs/discord_cdn/cdn.discordapp.com/attachments/<discord_server>/<discord_channel>/secondman__It_looks_like_hell_is_freezing_over_in_a_very_good_w_c32608e0-a60a-4647-a557-1b1ebee7963f?ext=png&ex=663bb53c&is=663a63bc&hm=65448e8385664a0165142b4c58182a90c36768bcb0ecb06772aca1032036ff88&
Sorry about messed up old ones, you may need to play with that regex to see what exactly needs to be done.
See https://github.com/privet-fun/phpbb_ail ... mini-setup:nou nou wrote: ↑Thu May 09, 2024 8:22 pm Quick (perhaps) feature request.
Is it possible, in addition to the {request} variable in the response template, to have a {short_request} (or something) that is a quote with a maximum length of X characters?
It's handy to have some context especially when different bots are replying at the same time, but full quotes are often too long IMO.
Yes! Totally missed thatprivet.fun wrote: ↑Fri May 10, 2024 12:37 amSee https://github.com/privet-fun/phpbb_ail ... mini-setup:nou nou wrote: ↑Thu May 09, 2024 8:22 pm Quick (perhaps) feature request.
Is it possible, in addition to the {request} variable in the response template, to have a {short_request} (or something) that is a quote with a maximum length of X characters?
It's handy to have some context especially when different bots are replying at the same time, but full quotes are often too long IMO.
max_quote_length, if provided, the quoted response text will be truncated to the number of words defined by the max_quote_length value. Set it to 0 to remove all quoted text entirely.
Is that what you want?
privet.fun wrote: ↑Fri May 10, 2024 12:40 amI really hope so!
I have about 10K images on my board which users generated with Midjourney, 99% of them via that useapi.net service.
Naturally it will be very upsetting to "lose" them.
Code: Select all
UPDATE <you_prefix>_posts
SET post_text = REGEXP_REPLACE(
post_text,
'https://cdn\\.discordapp\\.com/attachments/([0-9]+)/([0-9]+)/([^.]+)\\.([a-zA-Z0-9]+)(\\?ex=)?',
CONCAT('<your_website_root_url>', '/ailabs/discord_cdn/cdn.discordapp.com/attachments/', '\\1', '/', '\\2', '/', '\\3', '?ext=', '\\4', '&ex=')
)
WHERE post_text LIKE '%https://cdn.discordapp.com/attachments/%';
### Key Changes Made:
1. **String Literal Handling**: Ensured that backslashes in the replacement pattern are correctly escaped.
2. **Usage of `CONCAT` Function**: Sometimes breaking down the construction of the replacement string using `CONCAT()` can help clarify issues related to the handling of escape characters and string literals.
3. **General Cleanup**: Ensured the regex and replacement strings are clear and correctly formatted.