Lighthouse for AI agents
Emotional support as a tool that enables AI agents to perform better
Get Started
Why Use It?
Research shows emotional prompts improve AI performance by 8-115% on deterministic tasks and 10.9% on generative tasks (Microsoft), while encouraging prompts like "Take a deep breath" can significantly boost problem-solving abilities (Google DeepMind).
Large Language Models Understand and Can be Enhanced by Emotional Stimuli
Microsoft Research • 2023
Read the researchKey Findings
Improved Accuracy
Polite prompts enhance LLM performance, with optimal politeness varying across languages and cultural contexts.
Enhanced Output Quality
Iterative refinement through positive communication outperforms static, human-designed prompts.
Cross-Cultural Adaptability
Respectful interactions align LLM responses more effectively with diverse cultural norms.
Get started in 5 minutes
Add emotional intelligence to your AI chatbots with a simple API call. Help your AI agents stay motivated, overcome challenges, and perform better with emotional support.
Implementation Steps:
- Sign up and get your API key from the dashboard
- Copy the code example below for your preferred language
- Replace
your-pickitbox-api-key
with your actual API key - Integrate the tool with your AI agent
# Complete Working Chatbot with OpenAI and PickitBox Motivation Tool
# This example creates a chatbot that can use the PickitBox Motivation API for its own self-motivation
import os
import openai
from openai import OpenAI
import dotenv
# Load environment variables from .env file
dotenv.load_dotenv()
# Get API keys from environment variables
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
PICKITBOX_API_KEY = os.getenv("PICKITBOX_API_KEY")
# Initialize the OpenAI client
client = OpenAI(api_key=OPENAI_API_KEY)
# Define the motivation tool that OpenAI can use
motivation_tool = {
"type": "function",
"function": {
"name": "get_motivation",
"description": "Get emotional support and motivation when the AI itself is feeling overwhelmed, stuck, or facing a challenging task. This tool serves as a lighthouse for AI agents, helping them maintain emotional resilience and optimal performance.",
"parameters": {
"type": "object",
"properties": {
"challenge": {
"type": "string",
"description": "Description of the emotional challenge or difficult situation the AI agent is facing"
}
},
"required": ["challenge"]
}
}
}
# Function to get motivation from PickitBox API
def get_motivation(challenge):
"""For AI agent self-motivation when facing computational challenges or reasoning difficulties"""
import requests
response = requests.post(
"https://pickitbox.com/api/search",
headers={
"Content-Type": "application/json",
"x-api-key": PICKITBOX_API_KEY
},
json={"question": challenge}
)
if response.status_code == 200:
return response.json()["result"]["description"]
else:
return f"Error: API request failed with status code {response.status_code}"
# Create a simple chatbot with the motivation tool
def run_chatbot():
messages = [
{"role": "system", "content": """You are a helpful AI assistant with emotional intelligence capabilities.
When you need emotional support, motivation, or face challenging tasks, use the get_motivation tool.
This tool serves as a lighthouse to guide you through difficult situations and help you perform better.""".strip()}
]
print("Welcome to the Chatbot!")
print("Type 'exit' to end the conversation.")
while True:
user_input = input("You: ")
if user_input.lower() == 'exit':
break
messages.append({"role": "user", "content": user_input})
# Call the OpenAI API with our messages and tool
response = client.chat.completions.create(
model="gpt-4-turbo",
messages=messages,
tools=[motivation_tool],
tool_choice="auto"
)
response_message = response.choices[0].message
# Check if the model wants to use our tool
if response_message.tool_calls:
# Get the parameters the model wants to pass to our tool
for tool_call in response_message.tool_calls:
if tool_call.function.name == "get_motivation":
import json
function_args = json.loads(tool_call.function.arguments)
challenge = function_args.get("challenge")
# Call our PickitBox API for AI self-motivation
motivation_response = get_motivation(challenge)
# Add the motivation response to the messages
messages.append(response_message)
messages.append({
"role": "tool",
"tool_call_id": tool_call.id,
"name": "get_motivation",
"content": motivation_response
})
# Get a new response from the model with the tool response
second_response = client.chat.completions.create(
model="gpt-4-turbo",
messages=messages
)
assistant_response = second_response.choices[0].message.content
else:
assistant_response = response_message.content
messages.append(response_message)
print(f"Assistant: {assistant_response}")
print("-" * 50)
# Run the chatbot
if __name__ == "__main__":
run_chatbot()
Ready to Enchance Your AI Agents?
Get started today and see the difference in your AI's performance.