-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProgram.cs
More file actions
32 lines (26 loc) · 995 Bytes
/
Copy pathProgram.cs
File metadata and controls
32 lines (26 loc) · 995 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System;
using System.IO;
using System.Threading.Tasks;
using MasteringDotNetRAGandAgents;
using Microsoft.Extensions.Configuration;
class Program
{
static async Task Main(string[] args)
{
var configuration = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json")
.Build();
string apiKey = configuration["OPENAI_API_KEY"].ToString();
string model = configuration["OPENAI_MODEL"].ToString();
string orgId = configuration["OPENAI_ORG_ID"].ToString();
if (string.IsNullOrEmpty(apiKey) || string.IsNullOrEmpty(model))
{
Console.WriteLine("Please set the OPENAI_API_KEY, OPENAI_MODEL, and BING_API_KEY in appsettings.json.");
return;
}
await RAG.RunAsync(apiKey, model, orgId);
await AgentPersona.RunAsync(apiKey, model, orgId);
await ToolCalling.RunAsync(apiKey, model, orgId);
}
}