Skip to content

Commit

Permalink
noop tool instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
jessedrelick committed Aug 16, 2024
1 parent 9233c3e commit 12cfebe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions test/agens/agent_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ defmodule Agens.AgentTest do
use Test.Support.AgentCase, async: true

alias Agens.{Agent, Job, Message}
alias Test.Support.Tools.NoopTool

describe "agents" do
test "start agents" do
Expand Down Expand Up @@ -176,7 +177,8 @@ defmodule Agens.AgentTest do
%Agent.Config{
name: agent_name,
serving: :text_generation,
prompt: prompt
prompt: prompt,
tool: NoopTool
}
|> Agent.start()

Expand All @@ -200,7 +202,10 @@ defmodule Agens.AgentTest do
assert_receive {:job_started, ^job_name}

assert_receive {:step_started, {^job_name, 0}, "test input"}
assert_receive {:step_result, {^job_name, 0}, "STUB RUN"}
assert_receive {:tool_started, {^job_name, 0}, "STUB RUN"}
assert_receive {:tool_raw, {^job_name, 0}, %{}}
assert_receive {:tool_result, {^job_name, 0}, "TRUE"}
assert_receive {:step_result, {^job_name, 0}, "TRUE"}
assert_receive {:job_ended, :test_prompt_job, :complete}
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/support/tools/noop_tool.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule Test.Support.Tools.NoopTool do
def pre(input), do: input

@impl true
def instructions(), do: ""
def instructions(), do: "noop tool instructions"

@impl true
def to_args(_input), do: []
Expand Down

0 comments on commit 12cfebe

Please sign in to comment.