Skip to content

Commit d148a09

Browse files
committed
Add mutation injection test example
1 parent 1f78447 commit d148a09

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

examples/test_mutate.jl

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using OpenRouter
2+
using OpenRouterCLIProxyAPI
3+
4+
println("=" ^ 60)
5+
println("TEST 1: BEFORE MUTATE INJECT")
6+
println("anthropic:anthropic/claude-sonnet-4.5 -> direct Anthropic API")
7+
println("=" ^ 60)
8+
9+
response1 = aigen("Say 'Hello from before mutate' in exactly those words.",
10+
"anthropic:anthropic/claude-sonnet-4.5";
11+
streamcallback=HttpStreamCallback(; out=stdout, verbose=true))
12+
13+
println("\n\nResponse: ", response1.content)
14+
15+
println("\n" * "=" ^ 60)
16+
println("APPLYING MUTATE INJECT...")
17+
println("=" ^ 60)
18+
19+
setup_cli_proxy!(; mutate=true)
20+
21+
println("\n" * "=" ^ 60)
22+
println("TEST 2: AFTER MUTATE INJECT (anthropic: prefix)")
23+
println("anthropic:anthropic/claude-sonnet-4.5 -> now routes to cli_proxy_api")
24+
println("=" ^ 60)
25+
26+
response2 = aigen("Say 'Hello from after mutate' in exactly those words.",
27+
"anthropic:anthropic/claude-sonnet-4.5";
28+
streamcallback=HttpStreamCallback(; out=stdout, verbose=true))
29+
30+
println("\n\nResponse: ", response2.content)

0 commit comments

Comments
 (0)