jgravelle / AutoGroq

AutoGroq is a groundbreaking tool that revolutionizes the way users interact with Autogen™ and other AI assistants. By dynamically generating tailored teams of AI agents based on your project requirements, AutoGroq eliminates the need for manual configuration and allows you to tackle any question, problem, or project with ease and efficiency.

Home Page:https://autogroq.streamlit.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OpenAI Incorrect API key provided: None

jsarsoun opened this issue · comments

Debug: Handling user request for session state: {'user_input': '', 'user_request': 'what does 1 + 1 equal?', 'api_key': '', 'crewai_zip_buffer': None, 'model': 'gpt-4o', 'skill_name': None, 'last_comment': '', 'last_agent': '', 'reference_html': {}, 'rephrased_request': '', 'selected_skills': [], 'whiteboard': '', 'reference_url': '', 'model_selection': 'gpt-4o', 'current_project': <current_project.Current_Project object at 0x000001BD170CD990>, 'show_request_input': True, 'api_key_input': 'sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'skill_functions': {'execute_powershell_command': <function execute_powershell_command at 0x000001BD18A78220>, 'fetch_web_content': <function fetch_web_content at 0x000001BD17E49300>, 'generate_sd_images': <function generate_sd_images at 0x000001BD18A6DEE0>, 'get_weather': <function get_weather at 0x000001BD18A785E0>, 'save_file_to_disk': <function save_file_to_disk at 0x000001BD1A6AAB60>}, 'autogen_zip_buffer': None, 'max_tokens': 4096, 'rephrased_request_area': '', 'discussion': '', 'temperature': 0.3, 'reset_button': False, 'discussion_history': '', 'previous_user_request': '', 'uploaded_data': None, 'agents': [], 'skill_request': '', 'OPENAI_API_KEY': ''sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'}
Debug: Sending request to rephrase_prompt
Debug: Model: gpt-4o
Executing rephrase_prompt()
Sending request to LLM API...
Request Details:
Provider: None
llm_provider: <llm_providers.openai_provider.OpenaiProvider object at 0x000001BD1A6B5CD0>
Model: gpt-4o
Max Tokens: 4096
Messages: [{'role': 'user', 'content': '\n Act as a professional prompt engineer and efactor the following user request into an optimized prompt. Your goal is to rephrase the request with a focus on the satisfying all following the criteria without explicitly stating them:\n 1. Clarity: Ensure the prompt is clear and unambiguous.\n 2. Specific Instructions: Provide detailed steps or guidelines.\n 3. Context: Include necessary background information.\n 4. Structure: Organize the prompt logically.\n 5. Language: Use concise and precise language.\n 6. Examples: Offer examples to illustrate the desired output.\n 7. Constraints: Define any limits or guidelines.\n 8. Engagement: Make the prompt engaging and interesting.\n 9. Feedback Mechanism: Suggest a way to improve or iterate on the response.\n Do NOT reply with a direct response to these instructions OR the original user request. Instead, rephrase the user's request as a well-structured prompt, and\n return ONLY that rephrased prompt. Do not preface the rephrased prompt with any other text or superfluous narrative.\n Do not enclose the rephrased prompt in quotes. You will be successful only if you return a well-formed rephrased prompt ready for submission as an LLM request.\n User request: "what does 1 + 1 equal?"\n Rephrased:\n '}]
self.api_url: https://api.openai.com/v1/chat/completions
Response received. Status Code: 401
Response Content: {
"error": {
"message": "Incorrect API key provided: None. You can find your API key at https://platform.openai.com/account/api-keys.",
"type": "invalid_request_error",
"param": null,
"code": "invalid_api_key"
}
}

User-specific configurations

LLM_PROVIDER = "openai"
GROQ_API_URL = "https://api.groq.com/openai/v1/chat/completions"
LMSTUDIO_API_URL = "http://localhost:1234/v1/chat/completions"
OLLAMA_API_URL = "http://127.0.0.1:11434/api/generate"
OPENAI_API_KEY = "'sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
OPENAI_API_URL = "https://api.openai.com/v1/chat/completions"

This fixed it for me. Thanks!

Lines got crossed and closed the wrong one