Skip to content

fix(ai-proxy): set llm variables default value to 0#12549

Merged
Baoyuantop merged 4 commits into
apache:masterfrom
Revolyssup:revolyssup/ai-proxy-bug-empty-var
Aug 29, 2025
Merged

fix(ai-proxy): set llm variables default value to 0#12549
Baoyuantop merged 4 commits into
apache:masterfrom
Revolyssup:revolyssup/ai-proxy-bug-empty-var

Conversation

@Revolyssup

@Revolyssup Revolyssup commented Aug 27, 2025

Copy link
Copy Markdown
Contributor

Description

When user use access log in json format and specify $llm_prompt_tokens without the ai plugin enabled. It is replaced by empty causing json invalidation.

Access log before fix

{"@timestamp": "2025-04-08T16:21:05+05:30", "client_ip": "127.0.0.1", "status": "404", "llm_prompt_tokens": }

After fix

{"@timestamp": "2025-04-08T16:21:52+05:30", "client_ip": "127.0.0.1", "status": "404", "llm_prompt_tokens": 0}

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Aug 27, 2025
nic-6443
nic-6443 previously approved these changes Aug 28, 2025
Signed-off-by: Ashish Tiwari <[email protected]>
@Baoyuantop
Baoyuantop merged commit 6dd7664 into apache:master Aug 29, 2025
30 of 31 checks passed
jizhuozhi pushed a commit to jizhuozhi/apisix that referenced this pull request Oct 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants