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

ai-proxy nil error with bedrock misconfiguration #13666

Open
1 task done
t-yuki opened this issue Sep 13, 2024 · 1 comment · May be fixed by #13676
Open
1 task done

ai-proxy nil error with bedrock misconfiguration #13666

t-yuki opened this issue Sep 13, 2024 · 1 comment · May be fixed by #13676
Labels
bug pending author feedback Waiting for the issue author to get back to a maintainer with findings, more details, etc... plugins/ai-proxy

Comments

@t-yuki
Copy link

t-yuki commented Sep 13, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Kong version ($ kong version)

Kong 3.8.0.0

Current Behavior

nil error happen when aws_region is missing.
[kong] init.lua:427 [ai-proxy] /usr/local/share/lua/5.1/kong/llm/proxy/handler.lua:471: attempt to call field 'set_response_transformer_skipped' (a nil value)

Expected Behavior

Error detail on AWS auth config such as error authenticating with cloud-provider, AWS region not specified anywhere

Steps To Reproduce

  1. in docker environment

  2. with config of a route like plugins:
    - name: ai-proxy
    config:
    route_type: llm/v1/chat
    auth:
    aws_access_key_id: MYKEY
    aws_secret_access_key: MYSECRET
    model:
    provider: bedrock
    name: anthropic.claude-3-haiku-20240307-v1:0
    #options: # NO AWS_REGION CONFIG
    # bedrock: {"aws_region": "ap-northeast-1"}

  3. call the route

Anything else?

I think

llm_state.set_response_transformer_skipped()
should use disable_ai_proxy_response_transform

@chobits
Copy link
Contributor

chobits commented Sep 13, 2024

hi @t-yuki thanks for report, it seems a function typo here. I think your advice might be right.

  • not find the function definition after searching the source code:
xc kong $ grep 'set_response_transformer_skipped' -R kong
kong/llm/proxy/handler.lua:    llm_state.set_response_transformer_skipped()

Could you open a pull request for this? We warmly welcome community users to submit PRs to us, and we are also happy to help with reviews.

@chobits chobits added bug pending author feedback Waiting for the issue author to get back to a maintainer with findings, more details, etc... labels Sep 13, 2024
@t-yuki t-yuki linked a pull request Sep 14, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug pending author feedback Waiting for the issue author to get back to a maintainer with findings, more details, etc... plugins/ai-proxy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants