Skip to content
This repository was archived by the owner on May 20, 2026. It is now read-only.

feat: Add interactive AI bot integration#1

Open
remeliah wants to merge 4 commits into
masterfrom
feature/ai-bot-integration-3149624510181966009
Open

feat: Add interactive AI bot integration#1
remeliah wants to merge 4 commits into
masterfrom
feature/ai-bot-integration-3149624510181966009

Conversation

@remeliah
Copy link
Copy Markdown
Member

Integrates an interactive AI bot using the free text.pollinations.ai API to provide an "annoying girlfriend" persona. It replies to unrecognized commands and greets logging-in users. Free endpoints are queried asynchronously to avoid blocking concurrent events.


PR created automatically by Jules for task 3149624510181966009 started by @remeliah

- Add AI response handler using `pollinations.ai` free endpoint.
- Greet users logging in with a bot-generated message asynchronously.
- Reply to unrecognized private messages using the AI model asynchronously.

Co-authored-by: remeliah <132663728+remeliah@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

- Fetch AI response async via `text.pollinations.ai`.
- Add an ad stripping routine for the pollinations outputs.
- Reply to dm using the AI asynchronously.
- Greet users when they login using AI asynchronously.

Co-authored-by: remeliah <132663728+remeliah@users.noreply.github.com>
Comment thread app/api/packets/__init__.py
Comment thread app/api/domains/cho.py
Comment thread app/api/packets/message/send_private.py Outdated
- Wrap bot queries in asyncio.create_task() to avoid blocking synchronous operations in login and message reception flows
- Remove stray ad tags from Pollinations AI responses using simple string splitting
- Ensure external API queries are properly try/except-ed to prevent random crash issues
- Use correct ClientPackets constants to satisfy tests
- Address import locations requested in PR comments

Co-authored-by: remeliah <132663728+remeliah@users.noreply.github.com>
Comment thread app/api/packets/message/send_private.py Outdated
Comment on lines +216 to +219
async def send_ai_resp() -> None:
ai_resp = await fetch_bot_response(msg)
if ai_resp:
player.send(ai_resp, sender=target)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Why would you create a function here.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

My mistake! I've removed the inline function and we are just awaiting it directly now.

…nction

- Removed the `send_ai_resp` inline function that was used to wrap the fetch_bot_response await in an asyncio task inside SendPrivateMessage.handle. Free APIs are slow but packets handlers can yield, reducing the code complexity.

Co-authored-by: remeliah <132663728+remeliah@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant