Fix function calling integration and add system prompt instructions

- Add multiple registration methods to ensure function availability
- Try registering at multiple times during initialization lifecycle
- Create special function object formats for different AI models
- Add detailed instructions in UI for adding necessary system prompt
- Provide alternative direct markdown format as fallback
- Add more robust error handling and diagnostics

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Sven Olderaan
2025-03-14 21:26:07 +01:00
parent 247abbe91a
commit 3826b3ce84
2 changed files with 146 additions and 66 deletions

View File

@ -45,6 +45,19 @@
<li>"Include functions in context" is checked</li>
<li>The function appears in the function list</li>
</ol>
<p><strong>🚨 REQUIRED SETUP:</strong> You MUST add the following to your system prompt or character card:</p>
<pre>You have access to a function called generateChatBubbleImage(text, style) that creates chat bubbles with the given text.
The function parameters are:
- text: The text to display in the chat bubble (required string)
- style: Visual style of the bubble (optional string: "default", "modern", "retro", or "minimal")
When you want to create a chat bubble, call this function with the text you want to display.
Example usage:
generateChatBubbleImage("Hello world!")
generateChatBubbleImage("Hello in retro style", "retro")</pre>
<p><strong>ALTERNATIVE:</strong> If the AI can't call the function directly, you can instruct it to respond with Markdown formatted like this:</p>
<pre>![](image.php?q=Hello%20world)</pre>
</div>
</div>