-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy path3-try-reka-agent-fwk.cs
More file actions
42 lines (31 loc) · 1.29 KB
/
3-try-reka-agent-fwk.cs
File metadata and controls
42 lines (31 loc) · 1.29 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
#:package DotNetEnv@3.1.1
#:package Microsoft.Agents.AI@1.0.0-preview.260209.1
#:package Microsoft.Extensions.AI.OpenAI@10.1.1-preview.1.25612.2
using DotNetEnv;
using OpenAI;
using OpenAI.Chat;
using System.ClientModel;
using Microsoft.Extensions.AI;
using Microsoft.Agents.AI;
Env.Load();
var API_KEY = Environment.GetEnvironmentVariable("REKA_API_KEY")!;
var baseUrl = "https://api.reka.ai/v1";
var modelName = "reka-flash-research";
// var API_KEY = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;
// var baseUrl = "https://api.openai.com/v1";
// var modelName = "gpt-5";
// var API_KEY = Environment.GetEnvironmentVariable("CLAUDE_API_KEY")!;
// var baseUrl = "https://api.anthropic.com/v1";
// var modelName = "claude-opus-4-6";
// var API_KEY = "ollama";
// var baseUrl = "http://127.0.0.1:11434/v1";
// var modelName = "llama3.1:8b";
IChatClient chatClient = new ChatClient(modelName, new ApiKeyCredential(API_KEY), new OpenAIClientOptions
{
Endpoint = new Uri(baseUrl)
}).AsIChatClient();
AIAgent agent = new ChatClientAgent(chatClient,
instructions: "You are a helpful assistant that recommends tech events.",
name: "RekaAgent");
string prompt = "Give me 3 major tech events happening in the USA between January and June 2026";
Console.WriteLine(await agent.RunAsync(prompt));