MCPcopy Create free account
hub / github.com/InferCore/InferCore / TestSimpleEngine_Estimate

Function TestSimpleEngine_Estimate

internal/cost/simple_engine_test.go:9–21  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func TestSimpleEngine_Estimate(t *testing.T) {
10 e := NewSimpleEngine()
11 out := e.Estimate(
12 types.AIRequest{Options: types.RequestOptions{MaxTokens: 1000}},
13 types.BackendMetadata{CostUnit: 2.0},
14 )
15 if out.UnitCost != 2.0 {
16 t.Fatalf("UnitCost=%v", out.UnitCost)
17 }
18 if out.EstimatedTotal <= out.UnitCost {
19 t.Fatalf("EstimatedTotal=%v", out.EstimatedTotal)
20 }
21}
22
23func TestSimpleEngine_Estimate_DefaultMaxTokens(t *testing.T) {
24 e := NewSimpleEngine()

Callers

nothing calls this directly

Calls 2

EstimateMethod · 0.95
NewSimpleEngineFunction · 0.85

Tested by

no test coverage detected