Skip to content
This repository was archived by the owner on May 18, 2024. It is now read-only.

KeyError: 'endpoints' #242

Closed
matheeshapathirana opened this issue Nov 18, 2023 · 2 comments
Closed

KeyError: 'endpoints' #242

matheeshapathirana opened this issue Nov 18, 2023 · 2 comments

Comments

@matheeshapathirana
Copy link

I got this error. Please help me to fix this.

Looks like the environment variables exists...
Discord Token environment variable is valid
Traceback (most recent call last):
  File "/workspaces/Discord-AI-Chatbot/main.py", line 77, in <module>
    chat_models = fetch_chat_models()
  File "/workspaces/Discord-AI-Chatbot/main.py", line 67, in fetch_chat_models
    models.extend(
  File "/workspaces/Discord-AI-Chatbot/main.py", line 70, in <genexpr>
    if "chat" in model['endpoints'][0]
KeyError: 'endpoints'
@matheeshapathirana
Copy link
Author

I have temporarily fixed the issue by removing if "chat" in model['endpoints'][0] from

    if response.status_code == 200:
        ModelsData = response.json()
        models.extend(
            model['id']
            for model in ModelsData.get('data')
            if "chat" in model['endpoints'][0]      <--- THIS LINE (Line no. 70)
        )

But need a permanent solution

@L7NEG
Copy link

L7NEG commented Nov 18, 2023

me too i dont know why this error is started to showing up

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants