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

Reply for Response not working #2579

Open
heshanthenura opened this issue Jan 17, 2025 · 1 comment
Open

Reply for Response not working #2579

heshanthenura opened this issue Jan 17, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@heshanthenura
Copy link

This is the error im having

Airforce: KeyError: 'content'
DDG: KeyError: 'content'
OpenaiChat: KeyError: 'content'
Copilot: MissingRequirementsError: Install or update "curl_cffi" package | pip install -U curl_cffi
ChatGptEs: KeyError: 'content'
CablyAI: ResponseStatusError: Response 500: {"id": "chatcmpl-123", "object": "chat.completion", "created": 1677652288, "model": "Cably-80B", "choices": [{"index": 0, "message": {"role": "assistant", "content": ""}, "finish_reason": "stop"}], "usage": {"prompt_tokens": 0, "completion_tokens": 1, "total_tokens": 1}}
DarkAI: KeyError: 'content'
ChatGptt: IndexError: list index out of range
AIUncensored: KeyError: 'content'
Cloudflare: AttributeError: 'SimpleCookie' object has no attribute 'jar'
PollinationsAI: ClientResponseError: 500, message='Internal Server Error', url='https://text.pollinations.ai/'
Yqcloud: KeyError: 'content'
Blackbox: KeyError: 'content'
Jmuz: TypeError: Jmuz.get_models() got an unexpected keyword argument 'api_key'

This is my Code

    response  = client.chat.completions.create(
        # model="claude-3.5-sonnet",
        messages=[{'role': 'user', 'data': 'make a python code please'},{'role': 'assistant', 'data': 'Sure! Could you please specify what kind of Python code you would like me to create? For example, would you like a simple script, a specific function, a small program, or something else? Providing more details will help me generate the most appropriate code for your needs.\n\nSome common types of Python code I can help you with include:\n- Basic calculations\n- String manipulation\n- File handling\n- Data structures\n- Simple algorithms\n- Web scraping\n- Data analysis\n- Machine learning basics\n\nWhat specific task or functionality are you interested in?'}, {'role': 'user', 'data': 'make a python code please?'}, {'role': 'assistant', 'data': 'Here\'s a simple Python code that generates a random password:\n\n```python\nimport random\nimport string\n\ndef generate_password(length=12):\n    """\n    Generate a random password with specified length.\n    \n    Args:\n        length (int): Length of the password. Default is 12.\n    \n    Returns:\n        str: A randomly generated password\n    """\n    # Define character sets\n    lowercase_letters = string.ascii_lowercase\n    uppercase_letters = string.ascii_uppercase\n    numbers = string.digits\n    special_characters = string.punctuation\n    \n    # Combine all character sets\n    all_characters = lowercase_letters + uppercase_letters + numbers + special_characters\n    \n    # Generate password\n    password = \'\'.join(random.choice(all_characters) for _ in range(length))\n    \n    return password\n\n# Example usage\nif __name__ == "__main__":\n    # Generate a password with default length\n    random_password = generate_password()\n    print("Generated Password:", random_password)\n    \n    # Generate a password with custom length\n    custom_length_password = generate_password(16)\n    print("Custom Length Password:", custom_length_password)\n```\n\nThis code does the following:\n1. Imports necessary modules\n2. Creates a function to generate random passwords\n3. Uses different character sets\n4. Allows custom password length\n5. Provides example usage\n\nWould you like me to explain the code in more detail?'},{
                "role": "user",
                "content": user_prompt
    
            }],
        ignored=["Jmuz","Blackbox"],
        model=models.default,
    )
@heshanthenura heshanthenura added the bug Something isn't working label Jan 17, 2025
@TheFirstNoob
Copy link

@heshanthenura Hi, try to use {'role': 'user', 'content'
Not a data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants