Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ NEXT_PUBLIC_COMPOSIO_USER_ID=user@example.com
# NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN=your_mapbox_public_token_here

# AI Provider API Keys
# Azure AI Foundry (Azure OpenAI)
AZURE_RESOURCE_NAME=your_azure_resource_name_here
# Azure AI Foundry (OpenAI-compatible endpoint)
AZURE_ENDPOINT=https://your-resource.services.ai.azure.com/openai/v1
AZURE_API_KEY=your_azure_api_key_here
AZURE_DEPLOYMENT_NAME=gpt-4o
AZURE_DEPLOYMENT_NAME=gpt-5.5

# Gemini 3.1 Pro (Google Generative AI)
GEMINI_3_PRO_API_KEY=your_gemini_3_pro_api_key_here
Expand Down
13 changes: 6 additions & 7 deletions lib/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { createOpenAI } from '@ai-sdk/openai'
import { createGoogleGenerativeAI } from '@ai-sdk/google'
import { createAmazonBedrock } from '@ai-sdk/amazon-bedrock'
import { createXai } from '@ai-sdk/xai';
import { createAzure } from '@ai-sdk/azure';
import { v4 as uuidv4 } from 'uuid';
import { LanguageModel } from 'ai'

Expand Down Expand Up @@ -33,9 +32,9 @@ export async function getModel(requireVision: boolean = false): Promise<Language
const awsRegion = process.env.AWS_REGION;
const bedrockModelId = process.env.BEDROCK_MODEL_ID || 'anthropic.claude-3-5-sonnet-20241022-v2:0';
const openaiApiKey = process.env.OPENAI_API_KEY;
const azureResourceName = process.env.AZURE_RESOURCE_NAME;
const azureEndpoint = process.env.AZURE_ENDPOINT;
const azureApiKey = process.env.AZURE_API_KEY;
const azureDeploymentName = process.env.AZURE_DEPLOYMENT_NAME || 'gpt-4o';
const azureDeploymentName = process.env.AZURE_DEPLOYMENT_NAME || 'gpt-5.5';

if (selectedModel) {
switch (selectedModel) {
Expand Down Expand Up @@ -82,13 +81,13 @@ export async function getModel(requireVision: boolean = false): Promise<Language
throw new Error('Selected model is not configured.');
}
case 'Azure GPT 5.5':
if (azureResourceName && azureApiKey) {
const azure = createAzure({
resourceName: azureResourceName,
if (azureEndpoint && azureApiKey) {
const azure = createOpenAI({
baseURL: azureEndpoint,
apiKey: azureApiKey,
});
try {
return azure(azureDeploymentName) as unknown as LanguageModel;
return azure(azureDeploymentName);
} catch (error) {
console.error('Selected model "Azure GPT 5.5" is configured but failed to initialize.', error);
throw new Error('Failed to initialize selected model.');
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@
"dependencies": {
"@ai-sdk/amazon-bedrock": "^1.1.6",
"@ai-sdk/anthropic": "^1.2.12",
"@ai-sdk/azure": "^3.0.64",
"@ai-sdk/google": "^1.2.22",
"@ai-sdk/openai": "^1.3.24",
"@ai-sdk/xai": "^1.2.18",
"@composio/core": "^0.3.3",

"@google-cloud/storage": "^7.18.0",
"@google/generative-ai": "^0.24.1",
"@heroicons/react": "^2.2.0",
Expand Down