[3.2][3.3][RC] AI Labs with Midjourney, FaceSwap, PixVerse, Pika, Claude, ChatGPT, Gemini, DALL-E, Stable Diffusion

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Suggested Hosts
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
privet.fun
Registered User
Posts: 100
Joined: Sun May 07, 2023 8:46 pm
Location: https://privet.fun

Re: [3.2][3.3][RC] AI Labs with ChatGPT, DALL-E (OpenAI) and Stable Diffusion (Stability AI) support

Post by privet.fun »

Miri4ever wrote: Thu Jun 01, 2023 1:45 pm This SQL give me the correct result. Typing the username says the user already exists. But the system has trouble with upper and lowercase. PHPBB has no issue with upper / lowercase usernames being typed in. But if I open the search user tab, and it displays me the member list. I selected the name from the memberlist, and it's the same, but it did not type in manually. Then this error user does not exist coming up.

The name the same and upper lower case totally the same, but it was not pick up for some reason from select from the member list if some extensions running.
Interesting, I honestly have no idea what's going on there.
Perhaps something to do with uft encoding?
What's your language?
Try to create Bot with plain English name eg ABC and see it that works?
Also what's your php/phpBB/SQL versions?
User avatar
Miri4ever
Registered User
Posts: 608
Joined: Sat Mar 07, 2015 11:18 am

Re: [3.2][3.3][RC] AI Labs with ChatGPT, DALL-E (OpenAI) and Stable Diffusion (Stability AI) support

Post by Miri4ever »

I least I got finally today that the Bots reply to the message and not stop at only thinking. Linking AI Username also working well. But now there appears an error if you search own posts or posts by author:

And in the second image it seems to AI did not use the smention BBCode for the outputs.

I am not sure about the user mane to pick up 10% of my usernames and 90% did not by pick over ACP. This is really weird, and I need to check if there is a difference between those names inside my database. The oldest and newest names seem not to work, but those in middle age do.
You do not have the required permissions to view the files attached to this post.
Homepage: Terra Oceanica

Extension Developments:
PHPBB Games Solitaire, MChat Poker, MChat Black Jack, MChat Cards, MChat Trivia
PHPBB Special Effects, Mousepointers, X-Mas Themes and Designs for PBWoW Style.
Supported work: (**New Updated** UCP Sidebar), Tables, Hide, PBWow3 Style
User avatar
Miri4ever
Registered User
Posts: 608
Joined: Sat Mar 07, 2015 11:18 am

Re: [3.2][3.3][RC] AI Labs with ChatGPT, DALL-E (OpenAI) and Stable Diffusion (Stability AI) support

Post by Miri4ever »

I have some hints for those want to use this extension and running those 2 possible extensions:

NO QUOTE ON LAST POST: This extension interferes with the current design of using a quoted message for the AI Bot. Because the QUOTE not getting parsed inside the AI Reply. But I think this is a permission thing to check and allow it. For my AI System this was never a problem before, but the possible last update broke this extension.

LOGIN REQUIRED: This extension complete stops this AI from replying to anything. It just displays thinking about nothing happens after. Maybe some users can test this and what is needed to be put onto the whitelist to get it working.

I hope this helps a bit if some running into the same issue with this system. I still need to find out why I can pick 10% of my members names for the AI and 90% does not work, if there is a difference inside the created user table. Typ in the name by letters did work, but you still need the 100% correct upper and lowercase letters for typing, it will not work with only lower or uppercase letters while typing in username.
Homepage: Terra Oceanica

Extension Developments:
PHPBB Games Solitaire, MChat Poker, MChat Black Jack, MChat Cards, MChat Trivia
PHPBB Special Effects, Mousepointers, X-Mas Themes and Designs for PBWoW Style.
Supported work: (**New Updated** UCP Sidebar), Tables, Hide, PBWow3 Style
User avatar
privet.fun
Registered User
Posts: 100
Joined: Sun May 07, 2023 8:46 pm
Location: https://privet.fun

Re: [3.2][3.3][RC] AI Labs with ChatGPT, DALL-E (OpenAI) and Stable Diffusion (Stability AI) support

Post by privet.fun »

Miri4ever wrote: Fri Jun 02, 2023 5:55 pm I have some hints for those want to use this extension and running those 2 possible extensions:
Miri4ever, really appreciate your input!
I tested both and found ways to make both work with AI Labs extension, please see below.
Miri4ever wrote: Fri Jun 02, 2023 5:55 pm NO QUOTE ON LAST POST: This extension interferes with the current design of using a quoted message for the AI Bot. Because the QUOTE not getting parsed inside the AI Reply. But I think this is a permission thing to check and allow it. For my AI System this was never a problem before, but the possible last update broke this extension.
Assuming this is the extension No quote last post here's very easy fix, just edit ext/tojag/nqlp/event/main_listener.php as shown below:

Code: Select all


	// Added to support AI Labs bots
	// List your bots ids in $exclude_user_ids array
	private function user_enabled($poster_id) {
		$exclude_user_ids = [<bot_id1>, <bot_id1>]; // eg [123, 456]
		return ! in_array( $poster_id, $exclude_user_ids);
	}

	/**
	 * Don't display quote button, if a post is the last post in a topic.
	 */
	public function viewtopic_modify_post_row($event)
	{
		$row = $event['row'];
		$topic_data = $event['topic_data'];
		$post_row = $event['post_row'];
		// Added to support AI Labs bots
		$user_enabled = $this->user_enabled((int)$event['poster_id']);
		if ($row['post_id'] == $topic_data['topic_last_post_id'] && $user_enabled) // Added to support AI Labs bots
		{
			$post_row['U_QUOTE'] = '';
		}
		$event['post_row'] = $post_row;
	}

	/**
	 * Don't allow quoting of last post, users can be tricky little buggers
	 */
	public function modify_posting_auth($event)
	{
		$post_id = (int) $event['post_id'];
		$topic_last_post_id = !empty($event['post_data']['topic_last_post_id']) ? (int) $event['post_data']['topic_last_post_id'] : 0;
		// Added to support AI Labs bots
		$user_enabled = $this->user_enabled((int) $event['post_data']['poster_id']);
		if ($post_id == $topic_last_post_id && $event['mode'] == 'quote' && $user_enabled) // Added to support AI Labs bots
		{
			$this->language->add_lang('common', 'tojag/nqlp');
			trigger_error($this->language->lang('CANNOT_QUOTE_LAST_POST'));
		}
	}
	
Miri4ever wrote: Fri Jun 02, 2023 5:55 pm LOGIN REQUIRED: This extension complete stops this AI from replying to anything. It just displays thinking about nothing happens after. Maybe some users can test this and what is needed to be put onto the whitelist to get it working.
Login Required extension allowing you to whitelist /ailabs/* routes
login_required_fix.png
Miri4ever wrote: Fri Jun 02, 2023 5:55 pm I hope this helps a bit if some running into the same issue with this system.
I'll definitely update readme to reflect above (once you confirm they worked for you, just to be safe).
Miri4ever wrote: Fri Jun 02, 2023 5:55 pm I still need to find out why I can pick 10% of my members names for the AI and 90% does not work, if there is a difference inside the created user table. Typ in the name by letters did work, but you still need the 100% correct upper and lowercase letters for typing, it will not work with only lower or uppercase letters while typing in username.
I suspect it is due to your database locale but unfortunately not sure how to test that.
You do not have the required permissions to view the files attached to this post.
User avatar
privet.fun
Registered User
Posts: 100
Joined: Sun May 07, 2023 8:46 pm
Location: https://privet.fun

Re: [3.2][3.3][RC] AI Labs with ChatGPT, DALL-E (OpenAI) and Stable Diffusion (Stability AI) support

Post by privet.fun »

Miri4ever wrote: Fri Jun 02, 2023 5:41 pm I least I got finally today that the Bots reply to the message and not stop at only thinking. Linking AI Username also working well. But now there appears an error if you search own posts or posts by author:
I can't quite explain SQL "SELECT username from PHP33_ailabs_user WHERE user_id=4" on your screenshot, perhaps you have some extension which somehow pick table PHP33_ailabs_users instead of PHP33_users (latter actually has that username filed)?
I'd suggest trying to turn them off one by one and see at which point this error will disappear.
Miri4ever wrote: Fri Jun 02, 2023 5:41 pm And in the second image it seems to AI did not use the smention BBCode for the outputs.
I'm not sure I follow this one - why do you thing bout should "use the smention BBCode for the outputs"?
User avatar
Miri4ever
Registered User
Posts: 608
Joined: Sat Mar 07, 2015 11:18 am

Re: [3.2][3.3][RC] AI Labs with ChatGPT, DALL-E (OpenAI) and Stable Diffusion (Stability AI) support

Post by Miri4ever »

Thank you so much and this LOGIN Required working now like a charm. Yes, it's one of those troublemakers' extension in many ways, until anything is inside the whitelist. Yes, you were right and LOG SEARCH Extension from as AGE Required to be put out your user table instead of the correct one. It might only search for users and your table with letter was coming before the main users table. I deleted one extension and found I was able to fix at the second one, with put in the users' table of phpbb instead.

For this QUOTE thing, I was not successful and needed after long testing on my and a fresh test board, that this extension was faulty, and I needed to roll back to Version 0.8.0. Even the QUOTE inside MChat has been broken and as long as this AI not working with Chat it had nothing to do with you. But I hope I can adjust your way to fix there. I got this one from here: https://www.phpbb.de/community/viewtopic.php?t=243222

But even if all permissions set, the QUOTE did not work anymore correctly parsed by PHP. Although I can handle that older version until I find a way to fix. Or I'm testing your version you posted here.

I hope this kind of fix will work for the Mention Extension as well to parse AI Bot Reply a different way. I call those bots always with that mention thing, and then inside the quoted message it will display again. However, I might need to try your fix, for the changes that maybe broke it. I could reproduce working and non-working tests on my board.

Due to my discoveries I found those errors messages coming up, but they are very rare.

Invalid prompts detected

CONTENT_FILTERED

The last one seems not translated yet, or coming directly from the BOT Servers itself ?

Anybody having the same problems with this username thing, I might, can assist. All coming from the same author, and he seemed to made this error inside all his extensions.
Homepage: Terra Oceanica

Extension Developments:
PHPBB Games Solitaire, MChat Poker, MChat Black Jack, MChat Cards, MChat Trivia
PHPBB Special Effects, Mousepointers, X-Mas Themes and Designs for PBWoW Style.
Supported work: (**New Updated** UCP Sidebar), Tables, Hide, PBWow3 Style
User avatar
privet.fun
Registered User
Posts: 100
Joined: Sun May 07, 2023 8:46 pm
Location: https://privet.fun

Re: [3.2][3.3][RC] AI Labs with ChatGPT, DALL-E (OpenAI) and Stable Diffusion (Stability AI) support

Post by privet.fun »

Miri4ever wrote: Sat Jun 03, 2023 3:47 pm...
Miri4ever, I released 1.0.4 RC with following changes:
1.0.4 June 4, 2023
- Troubleshooting section added
- Added configuration for reply in topics
- Fixed links generation for cases where cookies disabled
- AI Labs internal controlles (/ailabs/*) will attempt to establish session to deal with phpBB extensions like Login Required
- Better descriptions added to help with setup
- Minor bugfixes

You should be able to configure reply to post option to get around some of those extensions your are using, not ideal solution but better than nothing.
I also added workaround Login Required extension.
Please give it a try.

Note that you will need to disable and enable extension to apply new version changes.
Last edited by privet.fun on Sun Jun 04, 2023 9:24 pm, edited 1 time in total.
User avatar
privet.fun
Registered User
Posts: 100
Joined: Sun May 07, 2023 8:46 pm
Location: https://privet.fun

Re: [3.2][3.3][RC] AI Labs with ChatGPT, DALL-E (OpenAI) and Stable Diffusion (Stability AI) support

Post by privet.fun »

Miri4ever wrote: Sat Jun 03, 2023 3:47 pm Due to my discoveries I found those errors messages coming up, but they are very rare.

Invalid prompts detected

CONTENT_FILTERED

The last one seems not translated yet, or coming directly from the BOT Servers itself ?

Anybody having the same problems with this username thing, I might, can assist. All coming from the same author, and he seemed to made this error inside all his extensions.
You're correct those coming from Open AI or Stability AI API, see https://github.com/privet-fun/phpbb_ail ... leshooting for details how to troubleshooting things.
Those are moderation messages, they vary by API, I found Open AI Chat and Midjourney moderation messages most useful while Stable Diffusion does not really provide much other than that Invalid prompts detected / CONTENT_FILTERED response.
CPTOM
Registered User
Posts: 136
Joined: Fri Jul 02, 2021 1:05 am

Re: [3.2][3.3][RC] AI Labs with ChatGPT, DALL-E (OpenAI) and Stable Diffusion (Stability AI) support

Post by CPTOM »

I was asking about the delay after hitting submit in another topic (which was closed for some reason). I'm running this extension on a test site, and when I post something where a ChatGPT response it expected, the board just freezes for 5 to 30 seconds. After that, my post and the ChatGPT post appear at the same time. Is there a way to have my post appear normally after I hit submit, and then have the ChatGPT response once its response is ready? If I went live with it as is, I'm sure my users will start clicking sun,it multiple time and/or leave the page before the board comes back to life....

I also saw they offer ChatGPT Plus for $20, which claims faster response times. Would this significantly reduce that dead time after hitting submit on a question?

Love the extension -- not griping about it, just hoping to implement it!
User avatar
privet.fun
Registered User
Posts: 100
Joined: Sun May 07, 2023 8:46 pm
Location: https://privet.fun

Re: [3.2][3.3][RC] AI Labs with ChatGPT, DALL-E (OpenAI) and Stable Diffusion (Stability AI) support

Post by privet.fun »

CPTOM wrote: Mon Jun 26, 2023 2:58 pm I was asking about the delay after hitting submit in another topic (which was closed for some reason). I'm running this extension on a test site, and when I post something where a ChatGPT response it expected, the board just freezes for 5 to 30 seconds. After that, my post and the ChatGPT post appear at the same time. Is there a way to have my post appear normally after I hit submit, and then have the ChatGPT response once its response is ready? If I went live with it as is, I'm sure my users will start clicking sun,it multiple time and/or leave the page before the board comes back to life....

I also saw they offer ChatGPT Plus for $20, which claims faster response times. Would this significantly reduce that dead time after hitting submit on a question?

Love the extension -- not griping about it, just hoping to implement it!
CPTOM, I'm glad you like it, your server configuration must be the reason with the delay (I'm sure you see my original answer at viewtopic.php?p=15962071#p15962071).
If you can post details on you board and web-server config I can try to help.
User avatar
amorino
Registered User
Posts: 55
Joined: Sat Jun 05, 2010 10:25 pm

Re: [3.2][3.3][RC] AI Labs with ChatGPT, DALL-E (OpenAI) and Stable Diffusion (Stability AI) support

Post by amorino »

Hello @privet.fun,
many thanks for this wonderful extension

Is there a way to oblige users to quote only the head ?
They are quoting the entire answer of gpt and this make costs higher as it increase the number of tokens
Thanks
User avatar
privet.fun
Registered User
Posts: 100
Joined: Sun May 07, 2023 8:46 pm
Location: https://privet.fun

Re: [3.2][3.3][RC] AI Labs with ChatGPT, DALL-E (OpenAI) and Stable Diffusion (Stability AI) support

Post by privet.fun »

amorino wrote: Sat Jul 01, 2023 5:14 am Hello @privet.fun,
many thanks for this wonderful extension

Is there a way to oblige users to quote only the head ?
They are quoting the entire answer of gpt and this make costs higher as it increase the number of tokens
Thanks
amorino, thank you for suggestion, I'll add option to trim quoited text and leave only reference link.
After all reference it all that needed.
User avatar
amorino
Registered User
Posts: 55
Joined: Sat Jun 05, 2010 10:25 pm

Re: [3.2][3.3][RC] AI Labs with ChatGPT, DALL-E (OpenAI) and Stable Diffusion (Stability AI) support

Post by amorino »

privet.fun wrote: Mon Jul 03, 2023 12:35 am
amorino wrote: Sat Jul 01, 2023 5:14 am Hello @privet.fun,
many thanks for this wonderful extension

Is there a way to oblige users to quote only the head ?
They are quoting the entire answer of gpt and this make costs higher as it increase the number of tokens
Thanks
amorino, thank you for suggestion, I'll add option to trim quoited text and leave only reference link.
After all reference it all that needed.
Many thanks
Maybe add a button "Continue discussion" or change the behaviour of the quote btn if it's a bot answer
Or both
Many thanks again this extension is just wonderful 👏
User avatar
Miri4ever
Registered User
Posts: 608
Joined: Sat Mar 07, 2015 11:18 am

Re: [3.2][3.3][RC] AI Labs with ChatGPT, DALL-E (OpenAI) and Stable Diffusion (Stability AI) support

Post by Miri4ever »

I have had some questions and some things I don't like for a long time. First of all, I think it's a shame that the other chat system is not being continued, because this was a direct live chat with the bot and could certainly have been implemented well for the MChat. Whereas this system was designed for the forum. I think 2 such ingenious systems should not stand in each other's way and both would be something where the users could enrich themselves in it. AI Chat for all chat systems and AI Labs for the forum and the pictures.

But now to my questions about AI Labs:


AI answers to itself ?

Does AI Labs answer to itself, even if users are registered as AI. Since I also use an AI system, but also use this account for the programme here, can it happen that when my AI answers, it is triggered again by AI Labs? Or are all users registered there treated in such a way that they are not automatically responded to? Or is there some kind of stop code that prevents the response? Turning the system off and on all the time is a bit annoying, but I also don't want to use countless different bot. It only goes into the automatic reply here, so that not KI1 replies can happen to KI1 itself.

I fixed the quote problem with an older version of NO LAST QUOTE 0.8, because the new version 1.0 does not output the quote coming from KI System correctly. Unfortunately, the problem still exists that SMENTION is not parsed correctly in the output. So only the version with the current automatic response works best.

What happens when a user uses BB codes in their question? Are these first removed so that the AI understands the question and does not start looking for an answer to the BB code commands? Of course, the codes entered must then be correctly processed again in the output. Sometimes it seems as if the AI just copies the user text in a different form and plays it back. Especially with long texts.

AI replied:

What bothers me the most are these AI has answered. Let's say there is a picture to be posted. Then an error happens or the picture limits (DALL-E) are exhausted and the system gives an error message. Now, of course, I delete this erroneous AI post and try again. However, this announcement with reference to the AI contribution, which I had just deleted, remains. This now leads nowhere. I would now have to delete the user contribution so that this link disappears, but that is certainly not in the member's interest, especially if it was a long question. So now this no longer existing link remains anchored in the post.

There is no way to delete these links except by direct database manipulation, and since they are unfortunately stored within the user contribution, there is a risk that the user's entire contribution will be deleted, since no separate table is used for this purpose. Also, over time, I'm sure many hundreds of these links accumulate, as many dead ones as well, and there is no way directly through AI Labs ACP to purge or delete this data. So there is data generated but no way to remove it from user posts anymore. That's what bothers me the most right now and I've had user posts lost because of it, yet the AI posts that are deleted remained.


Add Bot Names:

Adding BOTs also still has the problem if I don't enter the name correctly it won't be found. With PHPBB it doesn't matter if I enter User1, user1 or USER1. The name is always found. However, AI Labs does not find User1 if I only type user1, so I have to take the member search every time.

Watermarking:

Among other things, there is this extension Insert watermark in files. Again, this works for all users, but AI Labs more or less runs into this routine when generating images / attachments. Especially these high quality and also not always free images should have the possibility, if a user uses this watermark extension, that the system also runs through this correctly when uploading the image.



Last but not least. Of course I always take a look at the test page. When will we finally be allowed to test the Leonardo AI ourselves?
Homepage: Terra Oceanica

Extension Developments:
PHPBB Games Solitaire, MChat Poker, MChat Black Jack, MChat Cards, MChat Trivia
PHPBB Special Effects, Mousepointers, X-Mas Themes and Designs for PBWoW Style.
Supported work: (**New Updated** UCP Sidebar), Tables, Hide, PBWow3 Style
User avatar
privet.fun
Registered User
Posts: 100
Joined: Sun May 07, 2023 8:46 pm
Location: https://privet.fun

Re: [3.2][3.3][RC] AI Labs with ChatGPT, DALL-E (OpenAI) and Stable Diffusion (Stability AI) support

Post by privet.fun »

Miri4ever, let me try to answer your questions and concerns.

Q: AI answers to itself ?
A: No, due to internal implementation bots will not be able to talk to each other.

Q: SMENTION is not parsed correctly in the output.
A: I'm not familiar with SMENTION so can't comment on this.

Q: What happens when a user uses BB codes in their question?
A: BB markup removed/cleansed from user question/post, you can look at log to see what actually being posted to OpenAI to verify there's no markup.

Q: What bothers me the most are these AI has answered. Let's say there is a picture to be posted. Then an error happens or the picture limits (DALL-E) are exhausted and the system gives an error message. Now, of course, I delete this erroneous AI post and try again. However, this announcement with reference to the AI contribution, which I had just deleted, remains. This now leads nowhere. I would now have to delete the user contribution so that this link disappears, but that is certainly not in the member's interest, especially if it was a long question. So now this no longer existing link remains anchored in the post.
A: You will have to delete both original post and reply post (one with error). Naturally this is not normal flow (errors are not normal generally speaking).

Q: Adding BOTs also still has the problem if I don't enter the name correctly it won't be found. With PHPBB it doesn't matter if I enter User1, user1 or USER1. The name is always found. However, AI Labs does not find User1 if I only type user1, so I have to take the member search every time.
A: Correct, you have to enter correct user name or pick one using dialog. This is just a setup routine, not something you have to do more than once.

Q: Among other things, there is this extension Insert watermark in files. Again, this works for all users, but AI Labs more or less runs into this routine when generating images / attachments. Especially these high quality and also not always free images should have the possibility, if a user uses this watermark extension, that the system also runs through this correctly when uploading the image.
A: I'm not sure I follow. What is exactly happening here and why is this an issue?

Q: When will we finally be allowed to test the Leonardo AI ourselves?
A: Leonardo AI is ready to go, the only issue is that I can't offer this service for free.
API hosted on AWS and I'm paying roughly $5/m for approximately 1000...1500 API calls per day (3 generation/images per each call), roughly 40K API calls/month. All that traffic coming from my Telegram bot which you can try at https://t.me/stable_diffusion_superbot
I'm using same API on my https://privet.fun BB forum.
I'd have to charge about $10/month for ~500 calls (3 generations/images each) /day using pool of 21 free Leonardo AI accounts.
You (users of this API) would have to create & setup those free Leonardo AI accounts themselves (takes about 1-2min to setup one account).
One free Leonardo AI account gives you 150 credits a day, good to generate 75 images of highest quality, so pool of 21 free accounts lead about 1,500 images/day.
Please let me know if you're interested, I'm in a process of setting up subscription service to get this going.

Return to “Extensions in Development”