summaryrefslogtreecommitdiff
path: root/Omni/Agent.hs
blob: 0bae0b562b44022bbe3bf094801558d8c1c393e6 (plain)
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
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NoImplicitPrelude #-}

-- | Agent system entry point and combined test runner.
--
-- This module provides the main entry point for the agent system
-- and re-exports core types from sub-modules.
--
-- : out omni-agent
-- : dep aeson
module Omni.Agent
  ( -- * Engine
    module Omni.Agent.Engine,

    -- * Tools
    module Omni.Agent.Tools,

    -- * Core
    module Omni.Agent.Core,

    -- * Test
    main,
    test,
  )
where

import Alpha
import Omni.Agent.Core
import Omni.Agent.Engine hiding (main, test)
import qualified Omni.Agent.Engine as Engine
import Omni.Agent.Tools hiding (ToolResult, main, test)
import qualified Omni.Agent.Tools as Tools
import qualified Omni.Test as Test

main :: IO ()
main = Test.run test

test :: Test.Tree
test =
  Test.group
    "Omni.Agent"
    [ Engine.test,
      Tools.test,
      Test.unit "Core types are re-exported" <| do
        let status = Idle :: WorkerStatus
        status Test.@=? status,
      Test.unit "Engine and Tools integrate correctly" <| do
        let tools = Tools.allTools
        length tools Test.@=? 5
        let config =
              Engine.defaultAgentConfig
                { Engine.agentTools = tools
                }
        Engine.agentMaxIterations config Test.@=? 10
    ]