brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
messaging-botsDevelops integration patterns for messaging bots across platforms, focusing on automated interactions.
Independent GitHub snapshot · Automated classification · Original documentation governs
name: messaging-bots
description: Develops integration patterns for messaging bots across platforms, focusing on automated interactions.
license: MIT compatibility: opencode metadata: version: "1.0.0" domain: communications role: implementation output-format: code triggers: messaging bots, chatbot integration, automated responses, conversational agents archetypes: conversational automation, messaging anti_triggers: human customer service, manual interactions response_profile: verbosity: low directive_strength: high scope: infrastructure related-skills: communications/messaging-channels, communications/messaging-microsoft-teams
Implements patterns for developing messaging bots, focusing on automated interactions using various APIs.
Use this skill for:
import requests
def intent_recognition_with_external_api(user_message: str, api_endpoint: str):
headers = {'Authorization': 'Bearer YOUR_API_KEY'}
response = requests.post(api_endpoint, json={'message': user_message}, headers=headers)
if response.status_code == 200:
return response.json().get('intent')
else:
raise Exception('Failed to connect to external API')
class Bot:
def __init__(self):
self.context = {"user_id": None, "previous_interaction": None}
def update_context(self, user_id: str, interaction: str):
self.context["user_id"] = user_id
self.context["previous_interaction"] = interaction
def respond_to_user(self, message: str):
# Respond based on user context
intent = recognize_intent(message)
return f'Responding with intent: {intent} based on context: {self.context}'
from flask import Flask, request
import json
app = Flask(__name__)
@app.route('/webhook', methods=['POST'])
def handle_message():
data = request.get_json()
user_message = data['message']
response = generate_response(user_message)
return json.dumps({'response': response}), 200
def generate_response(message):
# Simple logic to generate a response
return "Thanks for your message!"
import requests
def fetch_weather_info(location):
api_key = 'your_api_key'
url = f'http://api.openweathermap.org/data/2.5/weather?q={location}&appid={api_key}'
response = requests.get(url)
response.raise_for_status()
return response.json()
def recognize_intent(message: str):
# Use NLP to determine user intent
# Here we would integrate with a NLP API or library to classify intents
intents = ['greeting', 'query', 'command'] # Example intents
# Logic to determine the intent from the message
return intents[0] # Placeholder return
# Function to fetch data from an external API and utilize in responses
def fetch_external_data(endpoint: str):
response = requests.get(endpoint)
response.raise_for_status() # Handle error for bad responses
return response.json()
Authoritative documentation links for this skill's domain. The model follows markdown links at load time to resolve external references and inline content.