|
1 | 1 | import fs from 'fs';
|
| 2 | +import readline from 'readline'; |
2 | 3 | import { AIProjectsClient, DoneEvent, ErrorEvent, isOutputOfType, MessageStreamEvent, RunStreamEvent, ToolUtility } from '@azure/ai-projects';
|
3 | 4 | import type { AgentOutput, AgentThreadOutput, MessageDeltaChunk, MessageDeltaTextContent, MessageImageFileContentOutput, MessageTextContentOutput, OpenAIPageableListOfThreadMessageOutput, ThreadRunOutput } from '@azure/ai-projects';
|
4 | 5 | import { DefaultAzureCredential } from '@azure/identity';
|
5 |
| -import readline from 'readline'; |
6 |
| -import { config } from 'dotenv'; |
| 6 | +import { aiFoundryConnectionString, aiSearchConnectionString, model } from './env.js'; |
7 | 7 | import { PromptConfig } from './types';
|
8 |
| -config(); |
9 |
| - |
10 |
| -// Environment variables with proper validation |
11 |
| -const aiFoundryConnectionString = process.env.AI_FOUNDRY_PROJECT_CONNECTION_STRING || ''; |
12 |
| -const aiSearchConnectionString = process.env.AI_SEARCH_CONNECTION_STRING || ''; |
13 |
| -const model = process.env.AI_MODEL || ''; |
14 |
| - |
15 |
| -if (!aiFoundryConnectionString) { |
16 |
| - throw new Error('Please set the AI_FOUNDRY_PROJECT_CONNECTION_STRING environment variable.'); |
17 |
| -} |
18 |
| - |
19 |
| -if (!aiSearchConnectionString) { |
20 |
| - throw new Error('Please set the AI_SEARCH_CONNECTION_STRING environment variable.'); |
21 |
| -} |
22 |
| - |
23 |
| -if (!model) { |
24 |
| - throw new Error('Please set the AI_MODEL environment variable.'); |
25 |
| -} |
26 | 8 |
|
27 | 9 | // Define prompt configurations
|
28 | 10 | const promptConfig: Record<string, PromptConfig> = {
|
@@ -94,7 +76,7 @@ async function main() {
|
94 | 76 | }
|
95 | 77 | } catch (err) {
|
96 | 78 | console.error('The application encountered an error:', err);
|
97 |
| - process.exit(1); |
| 79 | + // process.exit(1); |
98 | 80 | }
|
99 | 81 | }
|
100 | 82 |
|
|
0 commit comments