Skip to content

Latest commit

 

History

History
160 lines (121 loc) · 4.51 KB

File metadata and controls

160 lines (121 loc) · 4.51 KB

Multi-Provider AI Integration Setup Guide

🚀 Quick Setup Instructions

Step 1: Add Your API Keys

Open the .env file and add your API keys for the providers you want to use:

# Azure OpenAI (GPT-5)
AZURE_OPENAI_API_KEY=your-actual-32-character-api-key-here

# DeepSeek
DEEPSEEK_API_KEY=your-deepseek-api-key-here

# Grok (xAI)
GROK_API_KEY=your-grok-api-key-here

Step 2: Verify Configuration

Visit: http://localhost:3000/api/config-check

This endpoint will show you which providers are properly configured and which models are available.

Step 3: Test the Models

  1. Go to http://localhost:3000
  2. Try different AI models:
    • GPT-5 Chat (Azure OpenAI)
    • DeepSeek Chat (DeepSeek AI)
    • Grok-3 (xAI)
  3. Send test messages to each configured model

🔧 Provider Configurations

Azure OpenAI (GPT-5)

  • Endpoint: https://asim-me5ucjnb-eastus2.openai.azure.com
  • Deployment Name: gpt-5-chat
  • API Version: 2025-01-01-preview
  • Status: ✅ Already configured (add API key)

DeepSeek

  • Endpoint: https://api.deepseek.com
  • Model: deepseek-chat
  • Status: ⏳ Ready for API key

Grok (xAI)

  • Endpoint: https://api.x.ai/v1
  • Model: grok-3
  • Status: ⏳ Ready for API key

🤖 Available AI Models

1. GPT-5 Chat (Azure OpenAI)

  • Provider: Azure OpenAI
  • Strengths: Advanced reasoning, creative writing, general knowledge
  • Features: Natural Language Processing, Code Generation, Creative Writing, Problem Solving
  • Color Theme: Teal/Green

2. DeepSeek Chat (DeepSeek AI)

  • Provider: DeepSeek
  • Strengths: Strong reasoning, mathematics, coding tasks
  • Features: Advanced Reasoning, Code Generation, Mathematical Problem Solving, Research Assistance
  • Color Theme: Red/Orange

3. Grok-3 (xAI)

  • Provider: xAI
  • Strengths: Real-time information, witty responses, current events
  • Features: Real-time Information, Witty Responses, Current Events, Creative Thinking
  • Color Theme: Purple/Violet

4. Image Generation (Azure OpenAI)

  • Provider: Azure OpenAI
  • Strengths: Text-to-image generation
  • Features: Text-to-Image, Style Transfer, Image Editing, Concept Art
  • Color Theme: Blue/Purple

5. Code Assistant (Azure OpenAI)

  • Provider: Azure OpenAI
  • Strengths: Programming assistance, debugging
  • Features: Code Generation, Bug Detection, Code Optimization, Documentation
  • Color Theme: Dark Gray/Black

📋 What's Been Implemented

✅ Multi-Provider Support

  • Support for 3 different AI providers
  • Automatic routing based on model selection
  • Provider-specific error handling
  • Independent configuration for each provider

✅ Enhanced Features

  • Provider-specific system prompts
  • Color-coded model cards and chat interfaces
  • Comprehensive configuration validation
  • Real-time provider status checking

✅ Error Handling

  • 401: Invalid API key
  • 429: Rate limit exceeded
  • 404: Model deployment not found
  • 408: Request timeout
  • 500: General server errors

🎯 Testing Checklist

  1. Configuration Check

    GET http://localhost:3000/api/config-check
    
  2. Basic Chat Test

    • Go to the chat interface
    • Send: "Hello, can you introduce yourself?"
    • Verify you get a real GPT-5 response
  3. Settings Test

    • Open chat settings
    • Adjust temperature and max tokens
    • Test different configurations

🔒 Security Notes

  • Your .env file is now in .gitignore to protect your API key
  • Never commit your actual API key to version control
  • The API key is only used server-side, never exposed to the browser

🐛 Troubleshooting

If you get authentication errors:

  1. Double-check your API key in .env
  2. Ensure no extra spaces or quotes around the key
  3. Verify the key is active in Azure portal

If you get deployment not found:

  1. Verify the deployment name is exactly gpt-5-chat
  2. Check if the deployment is active in Azure

If you get rate limit errors:

  1. You may need to increase your quota in Azure
  2. Try reducing the frequency of requests

📊 Monitoring

The application now logs:

  • Token usage for each request
  • API errors with details
  • Configuration status

Check the browser console and server logs for detailed information.

🚀 Next Steps

Once basic chat is working:

  1. Test different conversation lengths
  2. Try the settings panel
  3. Test the export functionality
  4. Experiment with different system prompts

Your FusionAI platform is now ready for real Azure OpenAI integration! 🎉