INNER CODE UNIT · Python

misconfigured

skyportal/skyportal · services/assistant/app.py:451

def misconfigured(exc):
    """Whether the endpoint refused the credentials, the model or the URL, which
    asking again will not fix."""
    response = getattr(exc, "response", None)
    return response is not None and response.status_code in (401, 403, 404)


def already_answered(session, message):
    """Whether a reply to this message has already been written."""
    return (
        session.scalar(
            sa.select(AssistantMessage.id)
            .where(
                AssistantMessage.user_id == message.user_id,
                AssistantMessage.channel == message.channel
                if message.channel
                else AssistantMessage.channel.is_(None),
                AssistantMessage.system.is_(True),

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…