150 Commits

Author SHA1 Message Date
Slipstreamm
28d0c11e48 refactor(image-description): Increase max output tokens to 1024
Previously, the maximum output tokens for image descriptions was set to 256.
This was often too restrictive, leading to truncated or incomplete descriptions.
Increasing the limit to 1024 allows for more comprehensive and detailed image
descriptions while still encouraging conciseness.
2025-06-12 19:27:59 -06:00
ba6cf65a3c
Resolve merge conflicts 2025-06-07 06:08:46 +00:00
3b024e132b
Refactor genai client logic to avoid circular imports 2025-06-07 06:06:35 +00:00
f1d08908c3
Applying previous commit. 2025-06-07 06:04:39 +00:00
998d0a3b15
Use global region for gemini 2.5 pro 2025-06-07 05:55:13 +00:00
d1ec42fa51
big ass formatting 2025-06-05 21:31:06 -06:00
28960c4c0c
fix: Enhance author identification logic to utilize cached author strings for improved efficiency 2025-05-30 17:52:30 -06:00
c7e15f5581
fix: Update user identification logic to default to "Unknown User" when no identifiers are found 2025-05-30 17:49:09 -06:00
e6f03abf6d
feat: Add dynamic AI model switching commands and update model configuration 2025-05-30 13:08:23 -06:00
e08d78d44a
fix: Correct MIME type assignment in image description generation 2025-05-29 11:57:12 -06:00
d7e64fdf4b
feat: Enhance image MIME type detection for improved compatibility 2025-05-29 11:56:10 -06:00
850e933b51
fix: Improve AI filtering message for emoji and sticker descriptions 2025-05-29 11:53:01 -06:00
fd13c35afd
feat: Use specific model for emoji/sticker descriptions
Introduces `EMOJI_STICKER_DESCRIPTION_MODEL` to `config.py` and uses it in `generate_image_description` for "emoji" and "sticker" item types. This ensures a dedicated model is used for these specific image description tasks, improving accuracy or efficiency.
2025-05-29 11:41:36 -06:00
aadfac5045
fix: Update image description prompt to allow explicit content descriptions 2025-05-29 11:17:34 -06:00
19d03a204d
feat: Implement image description generation for emojis and stickers, add listeners for guild asset updates 2025-05-29 11:08:16 -06:00
1b022baf61
fix: Update regex to capture custom emoji/sticker names with spaces and special characters 2025-05-28 18:00:53 -06:00
52e982518c
fix: Add debug logging for sticker guild ID handling in AI response 2025-05-28 17:38:24 -06:00
f45cdbc0c6
fix: Update sticker ID handling to prevent duplicates and improve logging 2025-05-28 16:55:45 -06:00
682cceaa43
fix: Improve sticker handling with detailed logging and guild ID validation 2025-05-28 16:53:00 -06:00
c2b10eae42
fix: Update emoji and sticker handling to download data as inline_data instead of FileData 2025-05-28 16:49:01 -06:00
7b4a3e8abc
feat: Enhance proactive AI response to support custom emoji and sticker handling with guild ID validation 2025-05-28 16:46:11 -06:00
2821f43454
fix: Refactor emoji and sticker handling to use FileData for improved MIME type management 2025-05-28 16:22:39 -06:00
df267d7db6
fix: Update image part creation to use inline_data for emoji and sticker handling 2025-05-28 16:13:38 -06:00
9b82460bbf
feat: Enhance emoji and sticker management with guild ID support 2025-05-28 15:47:48 -06:00
282a80f79b
fix: Enhance emoji and sticker data validation in get_ai_response function 2025-05-28 15:24:54 -06:00
bb1c34f0c5
feat: Implement Tenor GIF search functionality and integrate with tool mapping 2025-05-28 14:51:30 -06:00
f0de735d13
feat: Improve custom emoji and sticker handling in AI responses
Refactor AI response processing to correctly handle custom emojis and stickers.
Custom emojis are now converted to Discord's `<:name:id>` format for proper display.
Custom stickers are identified and their IDs are extracted to be sent as separate attachments, removing them from the main content.
This ensures Gurt can properly utilize learned custom emojis and stickers in its responses.
2025-05-28 14:48:58 -06:00
0c4df8d94d
feat: Implement Tenor GIF search tool and remove deprecated request handling 2025-05-28 14:40:56 -06:00
6868b2e95e
Feat: Integrate Tenor GIF search and custom emoji/sticker support
This commit introduces two main enhancements to Gurt's capabilities:

1.  **Tenor GIF Integration:**
    *   The AI can now request Tenor GIFs via a `request_tenor_gif_query` field in its response schema.
    *   `api.py` handles these requests by searching Tenor (using the new `TENOR_API_KEY` from config) and appending the GIF URL to the AI's message content.
    *   System prompts have been updated to instruct the AI on how to request GIFs.

2.  **Custom Emoji & Sticker Learning and Usage:**
    *   Introduces an `EmojiManager` (in the new `gurt/emojis.py`) to store and manage mappings of custom emoji/sticker names to their URLs. This data is persisted to `EMOJI_STORAGE_FILE`.
    *   Gurt now automatically learns custom emojis and stickers (and their URLs) from user messages via the `on_message` listener in `listeners.py`.
    *   The AI can be prompted to use these learned emojis/stickers by referencing their `:name:`.
    *   `api.py` processes AI responses to identify known custom emojis/stickers. For stickers, their URL is appended to the content if mentioned.
    *   A `learnemoji` command has been added for manually teaching Gurt emojis/stickers, although automatic learning is the primary mechanism.
    *   System prompts are updated to guide the AI on using custom emojis/stickers.
2025-05-28 14:30:26 -06:00
2a4d097c2e
fix: Update image part handling to use inline_data for raw bytes in process_requested_tools 2025-05-28 08:48:33 -06:00
cde506052f
feat: Add tools for user avatar data and role color
Introduces `get_user_avatar_data` to retrieve a user's avatar as base64 encoded image data, allowing the AI to "see" the profile picture directly. This includes special handling in `process_requested_tools` to attach the image as a `types.Part` in the prompt.

Also adds `get_user_highest_role_color` to fetch the color and details of a user's highest-positioned role.
2025-05-28 08:44:35 -06:00
bb745160ac
fix: Improve handling of multimodal message content in get_ai_response function 2025-05-27 23:07:31 -06:00
f02c2f865c
feat: Enhance historical message processing with custom emoji and sticker image support 2025-05-27 23:04:25 -06:00
87e0fe0340
fix: Ensure formatted message is defined for processing attachments, emojis, and stickers 2025-05-27 22:53:57 -06:00
6881dd4737
feat: Add support for custom emojis and stickers in message formatting 2025-05-27 22:51:43 -06:00
e8eaff4b9a
Refactor: Clarify User ID usage and enhance author attribution
This commit improves user identification in two key areas:

1.  **AI Response Context:**
    In `gurt/api.py`, messages processed by the AI now include a more informative author string, combining the user's display name and username (e.g., "DisplayName (Username: actual_username)"). This provides richer context about message authors.

2.  **Tool Definitions:**
    Descriptions for tools in `gurt/config.py` and `gurt/prompt.py` (e.g., `search_user_messages`, `get_user_facts`) and their parameters have been updated to explicitly state that user identification relies on "User ID". This enhances clarity for the AI model and developers.
2025-05-27 22:48:15 -06:00
3290b50fbd
fix: Update attachment handling to use types.FileData for URI parts 2025-05-27 22:13:51 -06:00
8f578cfe03
fix: Update attachment handling to use types.Part constructor for URI parts 2025-05-27 22:10:44 -06:00
145c91c5c2
fix: Explicitly mark attachment descriptions in AI response 2025-05-27 22:02:22 -06:00
dcfa619aa3
dnjehe 2025-05-01 10:31:45 -06:00
66609e5dae
hdhdh 2025-05-01 10:15:56 -06:00
f311d9a81a
jjj 2025-05-01 10:09:06 -06:00
5d2656591a
s 2025-05-01 10:07:30 -06:00
ee12360541
hs 2025-05-01 10:01:29 -06:00
4c4970bcfb
iijrj 2025-05-01 09:58:58 -06:00
73a44aa265
kk 2025-05-01 09:52:10 -06:00
aa7672787a
jjjj 2025-05-01 09:47:27 -06:00
2ffafb4508
kjj 2025-05-01 09:44:35 -06:00
ff4b399794
hhhh 2025-05-01 09:29:06 -06:00
e02998b84d
djjj 2025-04-30 21:51:16 -06:00