INNER CODE UNIT · Python

load_proxies

ra83205/google-bard-api · Bard.py:25

def load_proxies():
    proxy_enabled = os.getenv("PROXY_ENABLED", "False").lower() == "true"
    if proxy_enabled:
        return {
            "http": os.getenv("PROXY_HTTP", ""),
            "https": os.getenv("PROXY_HTTPS", ""),
        }
    else:
        return {}


def __create_session() -> PromptSession:
    return PromptSession(history=InMemoryHistory())


def __create_completer(commands: list, pattern_str: str = "$") -> WordCompleter:
    return WordCompleter(words=commands, pattern=re.compile(pattern_str))

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…