MCPcopy Create free account
hub / github.com/ForestHubAI/edge-agents / newAgentNode

Function newAgentNode

go/engine/node/agent_test.go:26–45  ·  view source on GitHub ↗

newAgentNode builds an Agent node with a no-provider llmproxy client. The returned agent never invokes the runner during the tests below — only pure helpers (Setup / Outputs / applyStructuredOutputs / next) are exercised.

(
	id string,
	answer workflow.OutputBinding,
	decls []workflow.OutputDeclaration,
)

Source from the content-addressed store, hash-verified

24// The returned agent never invokes the runner during the tests below — only
25// pure helpers (Setup / Outputs / applyStructuredOutputs / next) are exercised.
26func newAgentNode(
27 id string,
28 answer workflowapi.OutputBinding,
29 decls []workflowapi.OutputDeclaration,
30) *Agent {
31 client, _ := llmproxy.NewClient(nil)
32 return NewAgent(
33 id,
34 "agent-"+id,
35 "test-model",
36 nil, // instructions
37 answer,
38 decls,
39 nil, // memoryRefs
40 nil, // maxTurns
41 "", // toolDescription
42 client,
43 nil, // memory manager
44 )
45}
46
47func TestChoiceToken(t *testing.T) {
48 assert.Equal(t, "choice_0", choiceToken(0))

Callers 5

TestAgent_OutputsFunction · 0.85
TestAgent_SetupFunction · 0.85
TestAgent_NextFunction · 0.85

Calls 1

NewAgentFunction · 0.70

Tested by

no test coverage detected