-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
[Bug]: Incorrect API key provided: sk-samplekey. #1415
Comments
The console message above suggests you are using autogenstudio.
You can see what keys your agents have in the UI by going to Build -> Workflow -> sender/receiver ... models |
I had this problem. Delete all your "models" and re-add them with your correct keys. |
hi, I have the same issue. I tried deleting the models and re-added them, I tried new API keys. I also specify the key in env and within the model. But i still get the same error. |
Same problem here with MacOS. API-Key env variable (OPENAI_API_KEY) was set correctly before creating virtual environment (Conda) and installing autogen studio. |
same here. adding the models again or even having the env variable doesnt help. |
Thanks for noting this. If you are seeming
Go to playground ...
ags_apikey_addmodel.movCreate new session .. select your updated workflow ... Also ensure you are on the latest version of autogenstudio
the last command tells autogenstudio to use |
victordibia: That doesn't work for me. I did it EXACTLY like in your video.
|
victordibia: And as I already mentioned. OPENAI_API_KEY env variable is set correctly and available in the Conda environment. |
Thanks. Two things. I am investigating a possible bug where the api_key is not read from the env variable correctly in v 0.0.35a (it seems to be set to "" and not read). Can you do a pip install -U autogenstudio to upgrade to latest v0.0.37a. In my video, I do not put in the api key in the model, but I mention in the instructions that you need to put in both the model and api key. Let me know if you are still having issues. |
I do the same like mgredenberg, but nothing works with version v0.0.35a and v0.0.37a |
Getting the same issue.
|
Had the same issues but figured it out, not sure if it would work for you guys. Create a new model then delete it. Use the existing model gpt-4-1106-preview - with your api-key Then make sure to close everything down, reopen it using a new port and magically worked |
same here. Try what @Cantstop2023 describe but no magic happened. |
Hi, @suredream Here are a few things I would suggest. Update AutoGen StudioFirst, let us ensure you are on the latest version of autogenstudio
the last command tells autogenstudio to use Set Model and API Key in UIIf you are seeming
Go to playground ...
ags_apikey_addmodel.mov |
same here |
thanks. @victordibia . Not working. |
@victordibia |
I figured it out cause it stopped working for me again. Before proceeding with anything make sure you do the following in powershell type in n- Another thing i realised is that Group Chat does not work but Two Agents has no issue The in the powershell type in - This should then show your API KEY back to you. Once this is done run autogen - autogenstudio ui --port 8080 Go to Model and delete all of them except - Update - gpt-4-1106-preview - with your api key Will use one of the current workflows - Once you have clicked on - The go to Playground and select New and select one of the green option Stock Price / Sine Wave If the API KEY error comes again just open another powershell type - $env:OPENAI_API_KEY and see if it stuck as when i opened autogen studio it did dissapear and i just run it again it worked. |
I'm having the same problem. I decided to try Autogen Studio after I'd been playing around with a code sample for Semantic Kernel. I'd assumed the "sk" in "sk-samplekey" was something to do with Semantic Kernel, maybe some weird thing it did on install. Anyone else seeing this bug after also installing Semantic Kernel? |
What happens exactly when you run the following:
Note ... note the --appdir newdir . (specifying appdir ensures that autogenstudio creates a new dir to store files. This should cause autogenstudio to reinitialize a new db which has no default keys. ) autogenstudio ui --port 8081 --appdir newdir Do you still see the sk-samplekey error? |
Actually, I did the same thing you originally suggested (deleting the models and workflows) and that seems to have fixed it. |
I made these changes and now the error reads; Error occurred while processing message: 'AgentFlowSpec' object has no attribute 'name' I've checked everything is named, all of the elements are new and I am using the --appdir --newdir? Any ideas? |
The error suggests you might be on an older version and this bug has been fixed in recent versions. What is your autogen studio version? To upgrade |
@victordibia update to
|
…indows Testing ] (#1475) * support groupchat, other QOL fixes * remove gallery success toast * Fix #1328. Add CSVLoader component and related support for rendering CSV files. Add download link in the modal for appropriate file types including CSV, Code, and PDF. * add name and description field to session datamodel * Update website/blog/2023-12-01-AutoGenStudio/index.mdx Co-authored-by: Chi Wang <[email protected]> * sanitize llmconfig, remove additional fields * improve models UX, only modify models from model tab. * readme updates * improve db defaults * improve ui hover behavior and add note on models * general qol updats * add support for returning summary_method * use ant design tables * icon and layout updates * css and layout updates * readme updates and QOL updates * fix bug where empty string is used as apikey #1415 * add speaker selection to UI #1373 * Fixed a bug that localAgent updates were not synchronized between GroupChatFlowSpecView and AgentFlowSpecView. * Fixed a bug in Agent Specification Modal that caused localAgent updates to remain in state when closing a modal other than onOk. * Fixed a bug that the updated Agent Specification Modal was not saved when the content of FlowConfigViewer Modal was changed after the Agent Specification Modal was updated when an updatedFlowConfig was created using localFlowConfig. * add version to package * remove sample key * early support for versions table and testing models * Add support for testing model when created #1404 * remove unused imports, qol updates * fix bug on workflowmanager * make file_name optional in skills datamodel * update instructions on models * fix errors from merge conflict with main * santize workflow before download * add support for editing skills in full fledged editor (monaco) #1442 * fix merge artifacts * Fix build command for windows Replaced && to & to continue execution when the 'ui' folder doesn't exist and also suppressed error "The system cannot find the file specified." * Fix setup instructions The config file starts with a dot (according to gatsby-config.ts). * Throw error if env file doesn't exist Otherwise the app will not work (issue very hard to trace) * version bump * formattin gupdates * formatting updates * Show warning instead of error if env config file doesn't exist Fix: #1475 (comment) * add rel noopener to a tags * formating updates * remove double section in readme. * update dev readme * format update * add default autoreply to agent config datamodel * add check for empty messages list * improve groupchat behavior, add sender to list of agents * update system_message defaults to fit autogen default system message #1474 * simplify response from test_model to only return content, fix serialization issue in #1404 * readme and other formatting updates * add support for showing temp and default auto reply #1521 * formatting updates * formating and other updates --------- Co-authored-by: Paul Retherford <[email protected]> Co-authored-by: Chi Wang <[email protected]> Co-authored-by: junkei_okinawa <[email protected]> Co-authored-by: Christopher Pereira <[email protected]>
I hope this issue is resolved now. If not, please consider joining an office hour on discord. |
I am on version 0.0.44. I have just one model gpt-4-1106-preview. I accessed sqlite separately, it is saving the API keys properly for all agents and workflow.
I tried downloading the workflow, sharing a snippet:
|
@victordibia would you be able to help on this one? |
That error suggests that one or more of your agents have their key set to ******.
groupchat_.mp4 |
Solved! Thank you for help! |
This issue persists for me. Any solution? Tried the steps above mentioned but no luck.. |
Try following steps which worked for me:
Should work fine then. |
…indows Testing ] (microsoft#1475) * support groupchat, other QOL fixes * remove gallery success toast * Fix microsoft#1328. Add CSVLoader component and related support for rendering CSV files. Add download link in the modal for appropriate file types including CSV, Code, and PDF. * add name and description field to session datamodel * Update website/blog/2023-12-01-AutoGenStudio/index.mdx Co-authored-by: Chi Wang <[email protected]> * sanitize llmconfig, remove additional fields * improve models UX, only modify models from model tab. * readme updates * improve db defaults * improve ui hover behavior and add note on models * general qol updats * add support for returning summary_method * use ant design tables * icon and layout updates * css and layout updates * readme updates and QOL updates * fix bug where empty string is used as apikey microsoft#1415 * add speaker selection to UI microsoft#1373 * Fixed a bug that localAgent updates were not synchronized between GroupChatFlowSpecView and AgentFlowSpecView. * Fixed a bug in Agent Specification Modal that caused localAgent updates to remain in state when closing a modal other than onOk. * Fixed a bug that the updated Agent Specification Modal was not saved when the content of FlowConfigViewer Modal was changed after the Agent Specification Modal was updated when an updatedFlowConfig was created using localFlowConfig. * add version to package * remove sample key * early support for versions table and testing models * Add support for testing model when created microsoft#1404 * remove unused imports, qol updates * fix bug on workflowmanager * make file_name optional in skills datamodel * update instructions on models * fix errors from merge conflict with main * santize workflow before download * add support for editing skills in full fledged editor (monaco) microsoft#1442 * fix merge artifacts * Fix build command for windows Replaced && to & to continue execution when the 'ui' folder doesn't exist and also suppressed error "The system cannot find the file specified." * Fix setup instructions The config file starts with a dot (according to gatsby-config.ts). * Throw error if env file doesn't exist Otherwise the app will not work (issue very hard to trace) * version bump * formattin gupdates * formatting updates * Show warning instead of error if env config file doesn't exist Fix: microsoft#1475 (comment) * add rel noopener to a tags * formating updates * remove double section in readme. * update dev readme * format update * add default autoreply to agent config datamodel * add check for empty messages list * improve groupchat behavior, add sender to list of agents * update system_message defaults to fit autogen default system message microsoft#1474 * simplify response from test_model to only return content, fix serialization issue in microsoft#1404 * readme and other formatting updates * add support for showing temp and default auto reply microsoft#1521 * formatting updates * formating and other updates --------- Co-authored-by: Paul Retherford <[email protected]> Co-authored-by: Chi Wang <[email protected]> Co-authored-by: junkei_okinawa <[email protected]> Co-authored-by: Christopher Pereira <[email protected]>
Describe the bug
when i use windows condapowershell to set apikey
Report:Error occurred while processing message: Error code: 401 - {'error': {'message': 'Incorrect API key provided: sk-samplekey. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}}
how can i set
Steps to reproduce
No response
Expected Behavior
No response
Screenshots and logs
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: