-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProgram.fs
More file actions
72 lines (58 loc) · 2.19 KB
/
Program.fs
File metadata and controls
72 lines (58 loc) · 2.19 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
open System
open AgentNet
open DotNetEnv
// ============================================================================
// STOCK ADVISOR - MAIN MENU
// ============================================================================
let showMenu () =
printfn ""
printfn "Stock Advisor - Demo Scenarios"
printfn "=============================="
printfn "1. Agent Chat (interactive - requires Claude API)"
printfn "2. Workflow: Compare AAPL vs MSFT"
printfn "3. Workflow: Compare GOOGL vs AMZN"
printfn "4. Single Stock Analysis (TSLA)"
printfn "5. Custom Workflow Comparison"
printfn "6. Exit"
printfn ""
printf "Select option: "
let rec mainLoop (agentOpt: ChatAgent option) = task {
showMenu ()
match Console.ReadLine() with
| "1" ->
let! newAgentOpt = StockAdvisorFS.AgentChatSample.run agentOpt
return! mainLoop newAgentOpt
| "2" ->
do! StockAdvisorFS.WorkflowSample.run "AAPL" "MSFT"
return! mainLoop agentOpt
| "3" ->
do! StockAdvisorFS.WorkflowSample.run "GOOGL" "AMZN"
return! mainLoop agentOpt
| "4" ->
do! StockAdvisorFS.SingleAnalysisSample.run "TSLA"
return! mainLoop agentOpt
| "5" ->
printf "\nEnter first stock symbol: "
let sym1 = Console.ReadLine().Trim().ToUpper()
printf "Enter second stock symbol: "
let sym2 = Console.ReadLine().Trim().ToUpper()
if not (String.IsNullOrWhiteSpace sym1) && not (String.IsNullOrWhiteSpace sym2) then
do! StockAdvisorFS.WorkflowSample.run sym1 sym2
else
printfn "Invalid symbols."
return! mainLoop agentOpt
| "6" | "exit" ->
printfn "\nGoodbye!"
return ()
| _ ->
printfn "\nInvalid option. Please try again."
return! mainLoop agentOpt
}
// ============================================================================
// ENTRY POINT
// ============================================================================
// Load .env from current dir or any parent directory
Env.TraversePath().Load() |> ignore
printfn "Stock Advisor Agent (F# Edition)"
printfn "================================="
mainLoop None |> fun t -> t.Wait()