Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(plugins/ai-proxy): simplify code with early return #12804

Merged
merged 3 commits into from
Apr 1, 2024

Conversation

chronolaw
Copy link
Contributor

@chronolaw chronolaw commented Mar 28, 2024

Summary

  • code style clean
  • reduce if ... indents by using early return
  • reuse table ERROR_MSG

KAG-4150

Checklist

  • The Pull Request has tests
  • A changelog file has been created under changelog/unreleased/kong or skip-changelog label added on PR if changelog is unnecessary. README.md
  • There is a user-facing docs PR against https://github.com/Kong/docs.konghq.com - PUT DOCS PR HERE

Issue reference

Fix #[issue number]

@github-actions github-actions bot added cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee plugins/ai-proxy labels Mar 28, 2024
@chronolaw chronolaw marked this pull request as ready for review March 28, 2024 12:16
@ttyS0e
Copy link
Contributor

ttyS0e commented Apr 1, 2024

This may might maybe conflict with #12792 where I've added streaming support.

I can pick these commits and test later today.

@chronolaw
Copy link
Contributor Author

This may might maybe conflict with #12792 where I've added streaming support.

I can pick these commits and test later today.

If you cherry-pick this PR successfully we can close it safely.

@ADD-SP
Copy link
Contributor

ADD-SP commented Apr 1, 2024

@ttyS0e Thanks, please let us know once you finish the cherry-pick. I'll convert this PR as a draft to avoid unintended merge.

@ADD-SP ADD-SP marked this pull request as draft April 1, 2024 03:15
@ttyS0e
Copy link
Contributor

ttyS0e commented Apr 1, 2024

It seems to work fine on both yes!

stream-non-stream-test.log

Copy link
Contributor

@tysoekong tysoekong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See log attachment from @ttyS0e, this works fine for future feature requests also.

@ADD-SP ADD-SP marked this pull request as ready for review April 1, 2024 03:34
@ADD-SP
Copy link
Contributor

ADD-SP commented Apr 1, 2024

@ttyS0e Thanks for your tests, I will merge this PR, which might introduce conflicts to #12792, please let us know if you have issues when resolving conflicts.

@ADD-SP ADD-SP merged commit 6d3e3ab into master Apr 1, 2024
26 checks passed
@ADD-SP ADD-SP deleted the style/clean_ai_proxy_plugin branch April 1, 2024 03:40
@team-gateway-bot
Copy link
Collaborator

Successfully created cherry-pick PR for master:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee plugins/ai-proxy size/L skip-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants