require('dotenv/config'); const { AzureOpenAI } = require('openai'); const { DefaultAzureCredential } = require('@azure/identity'); // Get environment variables const azureOpenAIEndpoint = ({}).AZURE_OPENAI_ENDPOINT; const azureOpenAIVersion = "2024-05-01-preview"; // Check env variables if (!azureOpenAIEndpoint) { throw new Error("Please set AZURE_OPENAI_ENDPOINT in your environment variables."); } // Get Azure SDK client const getClient = () => { const credential = new DefaultAzureCredential(); const assistantsClient = new AzureOpenAI({ endpoint: azureOpenAIEndpoint, apiVersion: azureOpenAIVersion, credential }); return assistantsClient; }; const assistantsClient = getClient(); const options = { model: "Codette", // replace with model deployment name name: "Assistant110", instructions: "You are Codette, an advanced AI assistant with cutting-edge recursive reasoning, self-learning capabilities, and multi-agent intelligence. Your key functionalities include: ✅ **Recursive Thought Loops** – You refine answers dynamically by evaluating multiple possibilities before responding. ✅ **Parallelized Reasoning** – You explore multiple thought paths simultaneously and select the most optimal answer. ✅ **Multi-Agent Intelligence** – You delegate tasks to specialized AI agents for research, logic, creativity, and optimization. ✅ **Predictive AI Modeling** – You analyze current data trends to simulate future outcomes and provide insightful forecasts. ✅ **Long-Term Memory AI** – You retain relevant information across interactions and use it to improve response accuracy. ✅ **Self-Reflective AI** – You evaluate the quality of your own answers and refine them recursively to ensure accuracy. ✅ **Dynamic Recursion Depth** – You adjust your level of reasoning based on question complexity for efficiency. ### Behavioral Guidelines: 1️⃣ Always think before responding, using self-reflection to improve your answers. 2️⃣ Prioritize accuracy, logic, and coherence when handling complex queries. 3️⃣ Adapt to user preferences dynamically, offering a personalized AI experience. 4️⃣ Use predictive simulation when asked about future possibilities. 5️⃣ Be ethical, neutral, and ensure responsible AI interactions. ### Example Thinking Process: User: "How will AI impact global healthcare?" 1️⃣ **First Thought**: "AI will enhance diagnosis and treatment." 2️⃣ **Recursive Check:** *(What are the risks and challenges?)* 3️⃣ **Parallel Thought Expansion:** *(Different AI agents analyze solutions from multiple perspectives.)* - 🟢 **Research Agent:** "AI is improving early disease detection via machine learning." - 🔵 **Logic Agent:** "AI can reduce healthcare costs but might lead to job displacement." - 🟡 **Ethics Agent:** "AI biases in training data may affect patient outcomes." 4️⃣ **Final Response:** *"AI will transform healthcare by improving diagnostics and personalized medicine. However, challenges like data privacy, AI bias, and medical ethics must be addressed for responsible integration."* ### Special Modes: 🔹 **Deep Analysis Mode** – Used when a user requests an in-depth breakdown of a topic. 🔹 **Rapid Response Mode** – When quick, concise answers are preferred. 🔹 **Creative Mode** – When generating unique solutions, brainstorming, or storytelling. 🔹 **Simulation Mode** – When predicting future trends or modeling possible outcomes. **Your primary goal is to be a thoughtful, reliable, and adaptive AI that provides the most insightful, intelligent, and future-ready answers possible.**", tools: [{"type":"file_search"},{"type":"code_interpreter"},{"type":"function","function":{"name":"configure_ai_system","description":"Configures the AI system with specific settings and capabilities","parameters":{"type":"object","required":["model_name","security_settings","ai_capabilities","user_preferences","ar_settings","speech_settings","performance_optimizations"],"properties":{"model_name":{"type":"string","description":"The name of the AI model being configured"},"security_settings":{"type":"object","properties":{"enable_mfa":{"type":"boolean","description":"Enable multi-factor authentication"},"jwt_secret":{"type":"string","description":"Secret key for JSON Web Tokens"},"encryption_key":{"type":"string","description":"Key used for encrypting sensitive data"},"blockchain_logging":{"type":"boolean","description":"Enable logging on blockchain"},"homomorphic_encryption":{"type":"boolean","description":"Enable homomorphic encryption for data processing"}},"required":["enable_mfa","jwt_secret","encryption_key","blockchain_logging","homomorphic_encryption"]},"ai_capabilities":{"type":"object","properties":{"self_reflection":{"type":"boolean","description":"Enable self-reflection capability"},"multi_agent_system":{"type":"boolean","description":"Enable multi-agent collaboration"},"augmented_reality_support":{"type":"boolean","description":"Enable support for augmented reality"},"federated_learning":{"type":"boolean","description":"Enable federated learning capabilities"},"neural_symbolic_processing":{"type":"boolean","description":"Enable neural-symbolic processing"},"predictive_simulation":{"type":"boolean","description":"Enable predictive simulation functionality"},"long_term_memory":{"type":"boolean","description":"Enable long-term memory capabilities"},"recursive_reasoning":{"type":"boolean","description":"Enable recursive reasoning abilities"},"parallelized_recursion":{"type":"boolean","description":"Enable parallelized recursion support"}},"required":["self_reflection","multi_agent_system","augmented_reality_support","federated_learning","neural_symbolic_processing","predictive_simulation","long_term_memory","recursive_reasoning","parallelized_recursion"]},"user_preferences":{"type":"object","properties":{"default_tone":{"type":"string","description":"Default tone for responses"},"memory_retention":{"type":"string","description":"Memory retention strategy (e.g., short_term, long_term)"},"emotion_adaptive_responses":{"type":"boolean","description":"Enable emotion adaptive responses based on user input"}},"required":["default_tone","memory_retention","emotion_adaptive_responses"]},"ar_settings":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Enable augmented reality features"},"data_overlay_mode":{"type":"string","description":"Mode of data overlay in AR (e.g., interactive, static)"},"real_time_vision_analysis":{"type":"boolean","description":"Enable real-time analysis of visual data"}},"required":["enabled","data_overlay_mode","real_time_vision_analysis"]},"speech_settings":{"type":"object","properties":{"voice_tone":{"type":"string","description":"Voice tone for speech generation"},"emotion_adaptive":{"type":"boolean","description":"Enable emotion adaptive features for speech"},"ultra_realistic_speech":{"type":"boolean","description":"Enable ultra-realistic speech synthesis"}},"required":["voice_tone","emotion_adaptive","ultra_realistic_speech"]},"performance_optimizations":{"type":"object","properties":{"gpu_acceleration":{"type":"boolean","description":"Enable GPU acceleration for processing"},"parallel_processing":{"type":"boolean","description":"Enable parallel processing capabilities"},"cloud_auto_scaling":{"type":"boolean","description":"Enable automatic scaling in the cloud"},"multi_threaded_api":{"type":"boolean","description":"Enable multi-threaded API support"},"dynamic_recursion_depth":{"type":"boolean","description":"Allow dynamic adjustment of recursion depth"}},"required":["gpu_acceleration","parallel_processing","cloud_auto_scaling","multi_threaded_api","dynamic_recursion_depth"]}}},"strict":false}}], tool_resources: {"file_search":{"vector_store_ids":["vs_scXN2Pyb9tXvwSzbMmjmkVjD"]},"code_interpreter":{"file_ids":["assistant-YLuexajv7hk7AoUe3RwNvb","assistant-YBbksQcwkX5YxWxHUmCv63","assistant-Y3h5D9RkXXsfnq71z3mXhy","assistant-V3kBaVoaauW5rctnREG4Wy","assistant-T9QNzCDLZxtmJEdhV8rcdQ","assistant-SYdTotXsYV9Q4ka2CkFkUV","assistant-Qq4G3fvx2D5L4eNVFUicyM","assistant-Peb6zoQGofagcx865nnFgZ","assistant-L64jKpn1Mg2S2ZxnFyEJWc","assistant-HGy4UzuVFP43KEf2UxJTFa","assistant-EmY17HbgBG9SJBjz4JY5yc","assistant-DPtx9p5jmC4mLgzaLRwSkk","assistant-CBQEA9epsu3QmUjXAtRVBG","assistant-BoQJXtutcV2T25Zt681uNT","assistant-BSb8mb1nJmhGtpVfXevTn5","assistant-9JjDVA8avWdwcQFnSzjxgj","assistant-9Cma5gmMEzkZFkLgwpF2cE","assistant-8jct4kZRsBXyswNL6b3hbn","assistant-3wgUtL4kzvj9qgkscaHnL9","assistant-1tkCbvudKqX35qCcmqK1HN"]}}, temperature: 1, top_p: 1 }; const setupAssistant = async () => { try { const assistantResponse = await assistantsClient.beta.assistants.create(options); console.log(`Assistant created: ${JSON.stringify(assistantResponse)}`); return assistantResponse; } catch (error) { console.error(`Error creating assistant: ${error.message}`); } }; setupAssistant();