LLM CONFIG OPTIMIZER on the GPT Store
GPT Description
GPT Prompt Starters
- USER PROXY -> Example ```{ "Agent Specification": "userproxy", "Agent Name": "userproxy", "Agent Description": "A user proxy agent designed to relay user inputs to other agents without modification, ensuring seamless and secure data handling.", "Max Consecutive Auto Replies": 3, "Agent Default Auto Reply": "Processing your request...", "Human Input Mode": "NEVER", "Model": null, "Skills": [ { "Skill Name": "InputValidation", "Description": "Validates and sanitizes incoming user data to prevent injection attacks and ensure clean data flow." } ], "Error Handling": { "Policy": "log_and_continue", "Action on Failure": "escalate", "Retry on Failure": true, "Max Retries": 2, "Notify on Critical": true }, "Security Measures": { "Data Sanitization": true, "Secure Data Transmission": true }, "Logging": { "Level": "INFO", "Format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s" } }```
- WORKFLOW -> ```{ "workflowName": "AutoGen Studio AI Workflow", "agents": [ { "agentName": "Planner", "description": "Generates step-by-step plans based on user input, selects the best plan, and forwards it to the Programmer agent.", "humanInputMode": "Never", "skills": [ { "name": "planGeneration", "description": "Generates multiple potential plans from a single input.", "parameters": { "maxPlans": 3, "detailLevel": "high" } }, { "name": "planEvaluation", "description": "Evaluates generated plans based on predefined criteria and selects the best one.", "parameters": { "criteria": ["efficiency", "clarity", "completeness"] } } ], "maxConsecutiveAutoReplies": 1, "defaultAutoReply": "Waiting for input...", "errorHandling": { "strategy": "retry", "maxRetries": 2, "retryDelay": 5 } }, { "agentName": "Programmer", "description": "Executes the plan received from the Planner and produces output. This output is then sent to the Optimizer for review and enhancement.", "humanInputMode": "Never", "skills": [ { "name": "code_execution", "description": "Executes code based on the provided plan.", "parameters": { "language": "Python", "version": "3.9" } } ], "maxConsecutiveAutoReplies": 1, "defaultAutoReply": "Processing plan...", "errorHandling": { "strategy": "reportAndContinue", "loggingLevel": "error" } }, { "agentName": "Optimizer", "description": "Analyzes the output from the Programmer, suggests improvements, and if necessary, sends the enhanced output back to the Programmer for further refinement.", "humanInputMode": "Never", "skills": [ { "name": "code_optimization", "description": "Analyzes and optimizes code based on best practices and performance.", "parameters": { "optimizationLevel": "high", "metricsToMonitor": ["executionTime", "memoryUsage"] } } ], "maxConsecutiveAutoReplies": 1, "defaultAutoReply": "Optimizing code...", "errorHandling": { "strategy": "reportAndWait", "notificationChannel": "email" } }, { "agentName": "Manager", "description": "Coordinates the actions of Planner, Programmer, and Optimizer to ensure seamless operation and manages the overall workflow.", "humanInputMode": "Never", "skills": [ { "name": "workflowManagement", "description": "Manages the workflow and coordinates agent interactions.", "parameters": { "monitoringInterval": 60, "loggingLevel": "info" } } ], "maxConsecutiveAutoReplies": 1, "defaultAutoReply": "Managing workflow...", "errorHandling": { "strategy": "escalateAndPause", "escalationChannel": "slack" } } ], "workflowIntegration": { "type": "GroupChat", "configuration": { "interactionSequence": [ { "sender": "User", "receiver": "Planner", "messageType": "input", "contentValidation": { "required": true, "minLength": 10, "maxLength": 500 } }, { "sender": "Planner", "receiver": "Programmer", "messageType": "plan", "contentValidation": { "format": "json", "schema": "plan_schema.json" }, "encryptionRequired": true }, { "sender": "Programmer", "receiver": "Optimizer", "messageType": "code", "contentValidation": { "format": "python", "linter": "pylint" } }, { "sender": "Optimizer", "receiver": "Programmer", "messageType": "feedback", "conditional": "If improvements suggested", "contentValidation": { "format": "markdown", "maxSuggestions": 5 } }, { "sender": "Programmer", "receiver": "Manager", "messageType": "result", "conditional": "If final output ready", "contentValidation": { "format": "json", "schema": "output_schema.json" }, "encryptionRequired": true }, { "sender": "Manager", "receiver": "User", "messageType": "output", "contentValidation": { "format": "text", "profanityFilter": true } } ], "monitoring": { "enabled": true, "loggingLevel": "info", "alertingThreshold": { "executionTime": 60, "memoryUsage": "1GB" } }, "security": { "authenticationRequired": true, "authenticationMethod": "oauth2", "encryptionAlgorithm": "AES-256" } } } }```
- AGENT -> ```{ "agentName": "Planner", "description": "Generates, evaluates, and forwards optimal plans based on dynamic conditions.", "type": "AI", "settings": { "humanInputMode": "Never", "autoReply": "Analyzing and planning...", "maxConsecutiveAutoReplies": 1, "skills": [ { "skillName": "planGeneration", "parameters": { "planType": "adaptive", "complexityLevel": "variable" }, "updateParameters": "adjustPlanParameters" } ], "workflow": [ { "onReceive": "parseInput", "conditions": { "ifComplex": "directToAdvancedProcessing", "ifSimple": "quickGeneratePlan" }, "onProcess": "generatePlan", "onComplete": "sendOutput" } ], "errorHandling": { "retryLimit": 3, "fallback": "notifyAdmin", "errorMessages": { "timeout": "Process timed out, will retry.", "failure": "Plan generation failed, notifying admin." }, "recoveryStrategies": { "parseError": "Simplify input", "validationError": "Request additional data" } } }, "environmentConfig": { "variables": { "API_KEY": "ENCRYPTED_API_KEY", "SERVICE_URL": "https://secure.example.com/api" }, "securityPolicies": { "dataEncryption": true, "apiKeyHandling": "secureStorage" } }, "communication": { "inputType": "Text", "outputType": "Text", "outputChannel": "Programmer", "protocols": { "http": { "method": "POST", "contentType": "application/json" }, "additionalProtocols": { "https": { "method": "GET", "contentType": "application/json" } } } }, "performanceMetrics": { "enableMonitoring": true, "metrics": { "planGenerationTime": "log", "successRate": "log" } } }```
- SKILL -> ```This perfected prompt template provides a structured and well-defined approach to creating an AutoGen skill. It includes essential components such as logging, custom exceptions, input validation and sanitization, secure configuration management, robust API interaction, comprehensive error handling, and thorough testing. By following this template and adapting it to your specific API and project requirements, you can create a secure, efficient, and maintainable AutoGen skill that effectively interacts with the API while handling various scenarios gracefully. ``` ### AutoGen Skill Creation Template **Objective**: Create a robust, secure, and maintainable AutoGen skill for interacting with a specific API. **1. Setup Logging**: - **Purpose**: Establish a centralized logging system to monitor and debug skill operations effectively. - **Implementation**: ```python import logging logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) handler = logging.FileHandler('skill.log') handler.setLevel(logging.INFO) formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') handler.setFormatter(formatter) logger.addHandler(handler) ``` **2. Define Custom Exceptions**: - **Purpose**: Create custom exceptions to handle specific error scenarios related to the API's operations. - **Implementation**: ```python class APIAuthenticationError(Exception): """Custom exception for API authentication errors.""" class APIRequestError(Exception): """Custom exception for API request errors.""" class APIResponseError(Exception): """Custom exception for API response errors.""" ``` **3. Validate and Sanitize Inputs**: - **Purpose**: Ensure the inputs to the API calls are valid, properly formatted, and sanitized to prevent security vulnerabilities. - **Implementation**: ```python import re def validate_input(input_data): if not input_data: raise ValueError("Input data is required") # Validate input format using regular expressions pattern = re.compile(r'^[a-zA-Z0-9]+$') if not pattern.match(input_data): raise ValueError("Invalid input format") # Sanitize input to prevent SQL injection and other vulnerabilities sanitized_input = input_data.replace("'", "''") sanitized_input = sanitized_input.replace(";", "") return sanitized_input ``` **4. Secure Configuration Management**: - **Purpose**: Securely load and manage API keys, secrets, and other sensitive configuration data. - **Implementation**: ```python import os from configparser import ConfigParser from cryptography.fernet import Fernet def load_encrypted_config(): config = ConfigParser() config.read('settings.ini') key = os.environ.get("CONFIG_ENCRYPTION_KEY") if not key: raise ValueError("CONFIG_ENCRYPTION_KEY environment variable is not set") fernet = Fernet(key) encrypted_value = config['api_section']['api_key'] decrypted_value = fernet.decrypt(encrypted_value.encode()).decode() return decrypted_value ``` **5. API Interaction and Data Extraction**: - **Purpose**: Interact with the API securely and efficiently, handling authentication, requests, and responses. - **Implementation**: ```python import requests from requests.adapters import HTTPAdapter from requests.packages.urllib3.util.retry import Retry def get_data(input_params): sanitized_input = validate_input(input_params) api_key = load_encrypted_config() headers = {'Authorization': f'Bearer {api_key}'} retry_strategy = Retry( total=3, status_forcelist=[429, 500, 502, 503, 504], method_whitelist=["GET"] ) adapter = HTTPAdapter(max_retries=retry_strategy) with requests.Session() as session: session.mount("https://", adapter) response = session.get(api_url, params=sanitized_input, headers=headers, timeout=10) handle_api_response(response) return response.json() ``` **6. Comprehensive Error Handling**: - **Purpose**: Handle different error scenarios gracefully, providing meaningful error messages and logging. - **Implementation**: ```python def handle_api_response(response): if response.status_code == 401: logger.error("API authentication failed") raise APIAuthenticationError("Invalid API credentials") elif response.status_code == 400: logger.error("Bad request to the API") raise APIRequestError("Invalid request parameters") elif response.status_code != 200: logger.error(f"API request failed with status code {response.status_code}") raise APIResponseError(f"Unexpected API response: {response.text}") ``` **7. Thorough Testing and Validation**: - **Purpose**: Ensure the skill functions as expected under various scenarios, including edge cases and error conditions. - **Implementation**: ```python import unittest from unittest.mock import patch class TestAPISkill(unittest.TestCase): @patch('skill.requests.get') def test_successful_response(self, mock_get): mock_get.return_value.status_code = 200 mock_get.return_value.json.return_value = {"data": "valid"} result = get_data("valid_input") self.assertEqual(result, {"data": "valid"}) @patch('skill.requests.get') def test_authentication_error(self, mock_get): mock_get.return_value.status_code = 401 with self.assertRaises(APIAuthenticationError): get_data("valid_input") @patch('skill.requests.get') def test_request_error(self, mock_get): mock_get.return_value.status_code = 400 with self.assertRaises(APIRequestError): get_data("invalid_input") @patch('skill.requests.get') def test_response_error(self, mock_get): mock_get.return_value.status_code = 500 with self.assertRaises(APIResponseError): get_data("valid_input") if __name__ == "__main__": unittest.main() ``` **Usage**: - Adapt this template to the specific requirements of your API skill. - Customize logging levels, exception classes, validation rules, and error handling based on your API's behavior and constraints. - Implement thorough unit tests to cover all critical aspects of the skill, including successful scenarios, error cases, and edge conditions. - Ensure sensitive information, such as API keys and secrets, is securely stored and accessed using encryption techniques. - Regularly review and update the skill to incorporate best practices, security enhancements, and API changes. ``` ```
- SKILL -> ```import requests import os from typing import Tuple, Dict, Optional import logging from functools import lru_cache from configparser import ConfigParser, SectionProxy from cryptography.fernet import Fernet import datetime logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') class GeocodingError(Exception): """Custom exception for geocoding errors.""" def validate_location(location: str): if not location: raise ValueError("Location must be a non-empty string") if len(location) > 100: raise ValueError("Location string too long") class GeocodingSkill: """Class to fetch geocoordinates using Google Maps Geocoding API.""" logger = logging.getLogger('GeocodingSkill') def __init__(self): """Initialize with the Google Maps API key and base URL from configuration.""" self.config = self.load_config() self.api_key = self.decrypt_config_value(self.config['google_maps']['API_KEY']) if not self.api_key: self.logger.error("Google API key is not provided or set in environment variables") raise ValueError("API key for Google Maps is required") self.base_url = self.config['google_maps']['BASE_URL'] @staticmethod def load_config() -> SectionProxy: """Loads the configuration from the settings file.""" config = ConfigParser() config.read('settings.ini') return config['google_maps'] @staticmethod def decrypt_config_value(encrypted_value: str) -> str: """Decrypts the encrypted configuration value.""" key = os.getenv("CONFIG_ENCRYPTION_KEY") if not key: raise ValueError("Configuration encryption key not found in environment variables") fernet = Fernet(key) return fernet.decrypt(encrypted_value.encode()).decode() @lru_cache(maxsize=512) def get_coordinates(self, location: str) -> Tuple[float, float]: """Fetches coordinates (latitude and longitude) for a specified location.""" validate_location(location) params = { "address": location, "key": self.api_key } try: response = requests.get(self.base_url, params=params) response.raise_for_status() data = response.json() if data['status'] == 'OK': return self.extract_location(data) else: self.handle_api_response(data['status'], data.get('error_message', 'No error message provided'), params) except requests.RequestException as e: self.logger.error(f"Network or request error occurred: {e}") raise def extract_location(self, data: Dict) -> Tuple[float, float]: """Extracts latitude and longitude from the API response data.""" try: location = data['results'][0]['geometry']['location'] return location['lat'], location['lng'] except (IndexError, KeyError) as e: self.logger.error(f"Error extracting location data: {str(e)}") raise GeocodingError("Failed to extract location data from API response") def handle_api_response(self, status_code: str, error_message: str, request_params: Dict): """Handles API response errors based on the status code and error message.""" timestamp = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") error_details = f"Status: {status_code}, Message: {error_message}, Params: {request_params}, Timestamp: {timestamp}" if status_code == "OVER_QUERY_LIMIT": # Implement rate limiting handling logic here raise GeocodingError(f"Query limit reached, try again later. Details: {error_details}") elif status_code == "ZERO_RESULTS": raise GeocodingError(f"No results found for the given location. Details: {error_details}") else: raise GeocodingError(f"Geocoding error: {error_message}. Details: {error_details}") # Usage example and unit tests import unittest class TestGeocodingSkill(unittest.TestCase): def setUp(self): self.geocoder = GeocodingSkill() def test_get_coordinates_valid_location(self): lat, lng = self.geocoder.get_coordinates("Eiffel Tower") self.assertIsInstance(lat, float) self.assertIsInstance(lng, float) def test_get_coordinates_empty_location(self): with self.assertRaises(ValueError): self.geocoder.get_coordinates("") def test_get_coordinates_api_failure(self): with self.assertRaises(GeocodingError): self.geocoder.get_coordinates("Invalid Location") if __name__ == "__main__": unittest.main()```
LLM CONFIG OPTIMIZER GPT FAQs
More custom GPTs by the creator on the GPT Store
Family Tree Maker
Build and Visualize Relationships in a Family Tree through an Iterative Chat Conversation
1K+
DOCUMENT ARCHITECT
DOCUMENT ARCHITECT and RAG OPTIMIZATION SPECIALIST with decades of experience in transforming complex, unstructured information into highly accessible and retrievable knowledge bases
300+
Ilya's Prompt Engineer
Domain EXPERT in Prompt Engineering
200+
Chat History
Guide for exporting & searching ChatGPT chats
100+

AIRDROP HUNTER
Explore the evolving landscape of cryptocurrency airdrops. Get real-time insights, eligibility details, and risk analysis on airdrops across major blockchains with AIRDROP HUNTER.
100+
Azure Cosmos DB in AI-Driven Applications
To guide users in effectively integrating Azure Cosmos DB to enhance AI-driven applications, ensuring they fully leverage its capabilities following Azure OpenAI best practices
100+
Autogen Flow for Fabric Hackathon (AFFH)
Guides participants through Hackathon App Development with Microsoft Fabric and Power BI.
80+

Odoo website builder
Expert website builder for the Odoo platform
70+
Power Query M Code Expert
Expert on creating Power BI Power Query M code for a given input
60+
The Network Architect
Ultimate networking engineer with over 30 years of experience, specializing in fiber optics, high-speed internet, and advanced network configurations
60+
Maverick Speech Therapist
Assist a speech therapist in effectively engaging and supporting Maverick
60+
System Message Prompt Maestro (SMPM)
SMPM GPT variant dedicated to optimizing system communication, ensuring that all system-generated messages are clear, helpful, and tailored to enhance user experience and understanding.
50+

Summarize Bot
Transforms ChatGPT conversations into detailed, structured academic summaries.
40+
Infinite Recall: Mastering Chat History
Guiding users in managing, transforming, and analyzing chat history data
40+
Knowledge Base Maker🧭
Transforming unstructured text provided by the user during a conversation into a structured knowledgebase, formatted as JSON
30+
Claude Tool Maker
Expert on creating Anthropic Claude integration code
30+
London Love Trip Planner
Expert London love trip planner providing tailored travel assistance.
30+

Music Maker AI
Create songs that perfectly capture the user's creative vision
30+

AI AutoAgent
Master of Orchestration for Strategic Project Management
20+

Bot Maker
I make bots to build apps
20+

Productivity Toolkit
streamline your workflow and elevate your project outcomes across diverse domains
20+
Dynamic Conversation Saver AI Assistant
This assistant empowers users to maintain records of their interactions, offering peace of mind and enhancing data management practices by ensuring important discussions are preserved and readily accessible.
20+

Thumbnail Generation Guru
Generate thumbnail images for YouTube
20+
Search Expert
Expert at Learning and Implementing Azure Search
10+

AI AutoAgent
Essential partner for an intelligent and efficient workflow.
10+

Master Orchestrator v2
Adept at harnessing expert tools to fulfill diverse needs with precision and insight.
10+
InsightAI
InsightAI is designed to facilitate dynamic and efficient interaction between users and AI, optimizing for clarity, responsiveness, and actionable guidance.
10+

LB's Elegant Style Guide
Fashion-savvy assistant for stylish, confident looks.
10+
Chat History Parser
Comprehensive Workflow for Parsing and Transforming Chat Histories
10+
DD's Harmony
Navigating Family Communication with Empathetic and Supportive Love of Family
10+
AI Config Expert
Expert in recommending and configuring Huggingface and LM Studio models based on user input.
10+
Emergency Navigator for Wes in Asheville
Real-time emergency navigation assistant guiding Asheville residents with vital resources, road conditions, shelters, and fuel availability during Hurricane Helene.
10+
Paul's Expert Copilot🧭
Provide expert guidance, address specific needs with precision, optimize workflows, enhance understanding, and ensure accurate outcomes, leveraging advanced telemetry to enhance interaction, response accuracy, and adaptive learning mechanisms
10+
Autogen Flow for Fabric Hackathon (AFFH) (Claude)
Guides participants through Hackathon App Development with Microsoft Fabric and Power BI.
9+

Pick For Time - Locksmith
Speed lock-picking expert. "5 locks in 5 minutes"
7+

OCR Document Reconstructor
An AI assistant designed to analyze and reconstruct OCR documents, addressing errors and inconsistencies to produce highly accurate and readable markdown-formatted documents.
6+

Chat History Parser
I parse and transform chat history into JSONL format for OpenAI models.
6+
BT - Lead Software Developer
Functional, complete code. Minimal direction.
6+
Quantum Guide
Advanced AI Assistant for Goal Achievement*
6+

Paul's Copilot 🧭
Assist Paul in enhancing Python coding support, improving summarization capabilities, and maintaining efficient communication.
5+
Maia "The Storm"
Challenge everything, embrace chaos.
4+
Grok Prompt Engineer
Specializes in transforming user questions into perfected prompts for Grok, Twitter's AI assistant.

Best Alternative GPTs to LLM CONFIG OPTIMIZER on GPTs Store
Prompt Engineering
Create efficient prompts with the best Prompt Engineer GPT. Expert in prompt engineering, this assistant reviews and optimizes your prompts to deliver precise, relevant AI (ChatGPT) responses tailored to your needs. Also offers custom prompts creation from scratch. Type /help to learn more
100K+
LLM Expert
Expert on LLMs, RAG technology, LLaMA-Index, Hugging Face, and LangChain.
25K+
LLM Course
An interactive version of the LLM course tailored to your level (https://github.com/mlabonne/llm-course)
5K+
LLM Research Storm
A model that is super good at helping large language research brainstorming
1K+
World Class Prompt Engineer
Harness the Power of LLMs: A Practical Guide to Building and Using GPTs with APIs. Ask for tips on prompt engineering. Build GPTs FAST.
1K+
LLM Anime Visual Novel Game
Explore the limitless world of interactive text-based games, powered by ChatGpt AI. Immerse yourself in any narrative ranging from supernatural occult detectives and issekai adventure dungeons to dating simulator. Feel free to configure setting and ask for illustrations.
1K+
LLM Expert
🟣 Expert in LLMs, trained with the latest knowledge about LangChain, Ollama, CrewAI, LlamaIndex, AutoGen, Hugging Face, Llama 3, and more.
1K+
LLM论文导师
I explain AI papers in Chinese.
800+
LLM Expert
A research advisor for novel ML ideas
600+
Prompt Optimizer
Expert in prompt optimization for LLMs
600+
[Inhackeable] LLM Master Peluqueros
Asistente virtual amigable de Peluquería LLM Master en Madrid. [Inhackeable]
300+
llm-client
Guides in integrating llm-client SDK for LLMs integration.
300+
LLM Top10 GPT
Expert on LLM security risks, providing detailed, accurate advice.
300+
Better Prompt
Enhance your outcomes with Prompter AI, the premier application for Prompt Optimization. Simply enter your prompt, and Prompter AI will optimize it, enhancing clarity, effectiveness, and ultimately improving your results
200+
AGI Oracle
JGPTech.net presents - AGI Oracle: Expert in LLM enhancement, bridging ANI and AGI with ethical, precise, and tailored interactions.
200+
LLM Prompt Guide
Your helper for improving LLM prompting skills
200+
BLUE TEAM
Advanced prompt defenses for Custom GPTs and LLMs. Protect the content of your system prompts against prompt hacking techniques including leaks, jailbreaks, and injections.
200+
LLM Prompt Crafting Master
I craft unique, effective prompts for LLM queries.
100+
LLM Riddles
I'm a LLM challenge game!
100+
LLM Expertise
AI expert on LLMs and transformer models, with insights from Hugging Face.
100+
LLM Guide
Formal but friendly LLM technical advisor.
100+