Skip to content

Commit 9d3ad05

Browse files
feat: add proxyLLMCall and deprecate executeQuery (#57)
* feat: add proxyLLMCall and deprecate executeQuery Add proxyLLMCall() as the primary method for Proxy Mode with improved documentation explaining when to use Proxy Mode vs Gateway Mode. executeQuery() remains as a @deprecated wrapper that logs a warning in debug mode. It will be removed in v3.0.0. This is part of the Gateway Phase 3 work to clarify SDK semantics: - proxyLLMCall(): Proxy Mode - AxonFlow makes the LLM call - getPolicyApprovedContext() + auditLLMCall(): Gateway Mode - you make the LLM call * docs: add v2.7.0 changelog entry
1 parent 432d6a1 commit 9d3ad05

2 files changed

Lines changed: 66 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,25 @@ All notable changes to the AxonFlow Java SDK will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.7.0] - 2026-01-23
9+
10+
### Added
11+
12+
- **proxyLLMCall()**: New primary method for Proxy Mode with improved documentation
13+
- Clearly describes Proxy Mode behavior (AxonFlow makes the LLM call on your behalf)
14+
- Documents when to use Proxy Mode vs Gateway Mode
15+
- Both sync (`proxyLLMCall`) and async (`proxyLLMCallAsync`) variants
16+
17+
### Deprecated
18+
19+
- **executeQuery()**: Deprecated in favor of proxyLLMCall()
20+
- Marked with `@Deprecated` annotation
21+
- Will be removed in v3.0.0
22+
- Logs deprecation warning in debug mode
23+
- Remains functional as a wrapper around proxyLLMCall()
24+
25+
---
26+
827
## [2.6.0] - 2026-01-18
928

1029
### Added

src/main/java/com/getaxonflow/sdk/AxonFlow.java

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -490,17 +490,30 @@ public CompletableFuture<AuditSearchResponse> getAuditLogsByTenantAsync(String t
490490
// ========================================================================
491491

492492
/**
493-
* Executes a query through AxonFlow (Proxy Mode).
493+
* Sends a query through AxonFlow with full policy enforcement (Proxy Mode).
494+
*
495+
* <p>This is Proxy Mode - AxonFlow acts as an intermediary, making the LLM call on your behalf.
494496
*
495-
* <p>In Proxy Mode, AxonFlow handles both policy enforcement and LLM routing.
496-
* This is the simplest integration pattern but adds latency.
497+
* <p>Use this when you want AxonFlow to:
498+
* <ul>
499+
* <li>Evaluate policies before the LLM call</li>
500+
* <li>Make the LLM call to the configured provider</li>
501+
* <li>Filter/redact sensitive data from responses</li>
502+
* <li>Automatically track costs and audit the interaction</li>
503+
* </ul>
504+
*
505+
* <p>For Gateway Mode (lower latency, you make the LLM call), use:
506+
* <ul>
507+
* <li>{@link #getPolicyApprovedContext} before your LLM call</li>
508+
* <li>{@link #auditLLMCall} after your LLM call</li>
509+
* </ul>
497510
*
498511
* @param request the client request
499512
* @return the response from AxonFlow
500513
* @throws PolicyViolationException if the request is blocked by policy
501514
* @throws AuthenticationException if authentication fails
502515
*/
503-
public ClientResponse executeQuery(ClientRequest request) {
516+
public ClientResponse proxyLLMCall(ClientRequest request) {
504517
Objects.requireNonNull(request, "request cannot be null");
505518

506519
// Check cache first
@@ -528,7 +541,7 @@ public ClientResponse executeQuery(ClientRequest request) {
528541

529542
return result;
530543
}
531-
}, "executeQuery");
544+
}, "proxyLLMCall");
532545

533546
// Cache successful responses
534547
if (response.isSuccess() && !response.isBlocked()) {
@@ -539,14 +552,42 @@ public ClientResponse executeQuery(ClientRequest request) {
539552
});
540553
}
541554

555+
/**
556+
* Asynchronously sends a query through AxonFlow with full policy enforcement (Proxy Mode).
557+
*
558+
* @param request the client request
559+
* @return a future containing the response
560+
* @see #proxyLLMCall(ClientRequest)
561+
*/
562+
public CompletableFuture<ClientResponse> proxyLLMCallAsync(ClientRequest request) {
563+
return CompletableFuture.supplyAsync(() -> proxyLLMCall(request), asyncExecutor);
564+
}
565+
566+
/**
567+
* Executes a query through AxonFlow (Proxy Mode).
568+
*
569+
* @param request the client request
570+
* @return the response from AxonFlow
571+
* @deprecated Use {@link #proxyLLMCall(ClientRequest)} instead. This method will be removed in v3.0.0.
572+
*/
573+
@Deprecated
574+
public ClientResponse executeQuery(ClientRequest request) {
575+
if (config.isDebug()) {
576+
logger.warn("DEPRECATION WARNING: executeQuery() is deprecated. Use proxyLLMCall() instead. This method will be removed in v3.0.0.");
577+
}
578+
return proxyLLMCall(request);
579+
}
580+
542581
/**
543582
* Asynchronously executes a query through AxonFlow.
544583
*
545584
* @param request the client request
546585
* @return a future containing the response
586+
* @deprecated Use {@link #proxyLLMCallAsync(ClientRequest)} instead. This method will be removed in v3.0.0.
547587
*/
588+
@Deprecated
548589
public CompletableFuture<ClientResponse> executeQueryAsync(ClientRequest request) {
549-
return CompletableFuture.supplyAsync(() -> executeQuery(request), asyncExecutor);
590+
return proxyLLMCallAsync(request);
550591
}
551592

552593
// ========================================================================

0 commit comments

Comments
 (0)