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

Error: status code 404 message: Unrecognized request argument supplied: functions #89

Closed
vicperdana opened this issue Sep 11, 2023 · 8 comments

Comments

@vicperdana
Copy link

vicperdana commented Sep 11, 2023

Tried passing the --openai-endpoint --openai-deployment-name --openai-api-key as well as setting env vars resulted in the following error. Triple checked the values and still getting the same error.

⣯ Processing...Error: error, status code: 404, message: Unrecognized request argument supplied: functions

Happy to provide additional info, on a mac installed the package using brew.

Azure Open AI
GPT 35 turbo 0301

@farcorben
Copy link

farcorben commented Sep 18, 2023

same at my site.

MacOS 13.5.2
kubectl-ai v0.0.11 - installed by brew

➜  ~ brew info kubectl-ai                                                                                                                                                                                                                                              
==> sozercan/kubectl-ai/kubectl-ai: stable 0.0.11
kubectl-ai is a kubectl plugin to generate and apply Kubernetes manifests using OpenAI GPT.

/opt/homebrew/Cellar/kubectl-ai/0.0.11 (5 files, 36.2MB) *
  Built from source on 2023-09-15 at 12:16:42
From: https://github.com/sozercan/kubectl-ai/blob/HEAD/kubectl-ai.rb
==> Caveats
This plugin requires an OpenAI key.

OpenAI API Key was provided...

➜  ~ kubectl ai "create a foo namespace" --debug                                                                                                                                                                                                                       (colima/default)
DEBU[0000] openai-endpoint: https://api.openai.com/v1
DEBU[0000] openai-deployment-name: gpt-3.5-turbo-0301
DEBU[0000] azure-openai-map: map[]
DEBU[0000] temperature: 0.000000
DEBU[0000] use-k8s-api: false
DEBU[0000] k8s-openapi-url:
DEBU[0000] prompt: You are a Kubernetes YAML generator, only generate valid Kubernetes YAML manifests. Do not provide any explanations, only generate YAML. create a foo namespace
Error: error, status code: 404, message: Unrecognized request argument supplied: functions

@gadkins
Copy link

gadkins commented Sep 21, 2023

@vicperdana @farcorben

The issue is that you're using a the default model (gpt-3.5-turbo-0301), which does not include support for function calling. Set the model to use 0613 (or later) via export OPENAI_DEPLOYMENT_NAME=gpt-3.5-turbo-0613.

It's called out in the README here, but it is not very clear.

@vicperdana
Copy link
Author

vicperdana commented Sep 21, 2023 via email

@farcorben
Copy link

hi,
with export export OPENAI_DEPLOYMENT_NAME=gpt-3.5-turbo-0613 it works at my machine.
Thanks!

@0GiS0
Copy link

0GiS0 commented Sep 26, 2023

Hi all!

I'm using Azure Open AI and even using 0613 version of gpt-3.5 turbo It returns 404 :(

⚡➜  kubectl ai "create an nginx deployment with 3 replicas" --debug
DEBU[0000] openai-endpoint: https://francecentral.api.cognitive.microsoft.com/ 
DEBU[0000] openai-deployment-name: gpt-35-turbo-0613    
DEBU[0000] azure-openai-map: map[]                      
DEBU[0000] temperature: 0.000000                        
DEBU[0000] use-k8s-api: false                           
DEBU[0000] k8s-openapi-url:                             
DEBU[0000] prompt: You are a Kubernetes YAML generator, only generate valid Kubernetes YAML manifests. Do not provide any explanations, only generate YAML. create an nginx deployment with 3 replicas 
Error: error, status code: 404, message: Resource not found
image

Any other suggestion?

Thank you so much!!!

@sozercan
Copy link
Owner

sozercan commented Sep 26, 2023

@0GiS0 you are using a wrong endpoint, it must be openai, azure openai (https://resource-name.openai.azure.com), or localai.

for the rest of the issue, as @gadkins pointed out, functions needs a 0613 api version. Easiest solution is to just use a floating model or 0613 version for now. If anyone is interested in contributing, it makes sense to add a check to validate api version.

@sozercan sozercan changed the title Error: status code 404 Error: status code 404 message: Unrecognized request argument supplied: functions Sep 26, 2023
@0GiS0
Copy link

0GiS0 commented Sep 27, 2023

@0GiS0 you are using a wrong endpoint, it must be openai, azure openai (https://resource-name.openai.azure.com), or localai.

for the rest of the issue, as @gadkins pointed out, functions needs a 0613 api version. Easiest solution is to just use a floating model or 0613 version for now. If anyone is interested in contributing, it makes sense to add a check to validate api version.

Solved!

In the doc It doesn’t specify the --custom-domain parameter! That’s why the endpoints are different. If we want the same endpoint *.openai.azure.com we must specify the parameter like this:

# Create Azure Open AI resource
az cognitiveservices account create \
--kind OpenAI\
--name $AZ_OPEN_AI \
--custom-domain $AZ_OPEN_AI \
--sku S0 \
--resource-group $RESOURCE_GROUP \
--location $LOCATION

And that’s it 😊

@sozercan
Copy link
Owner

sozercan commented Mar 9, 2024

This should be fixed with #110

@sozercan sozercan closed this as completed Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants