app-knmojt-13 / config.py
AiCoderv2's picture
Deploy Gradio app with multiple files
9f9394b verified
#
# SPDX-FileCopyrightText: Hadad <hadad@linuxmail.org>
# SPDX-License-Identifier: Apache-2.0
#
import os
ENDPOINT = os.getenv("OPENAI_API_BASE_URL") # /v1/chat/completions
API_KEY = os.getenv("OPENAI_API_KEY")
MODEL = "openai/gpt-4o-mini"
STREAM = True
RETRY = 10 # max retries for api request
# See the endpoint list at https://searx.space
# Public instances do not support JSON.
# You will need to modify the main logic to use HTML instead.
# Please refer to the SearchGPT 1.0 version for guidance.
# https://huggingface.co/spaces/umint/searchgpt/blob/0ceb431c97449f214fe952ca356d6f79f0d10983/src/engine/browser_engine.py#L34
SEARXNG = "https://umint-searxng.hf.space/search"
FORMAT = "json" # Do not use this when using public instances (doesn't support). See src/tools/workflows/web_search.py#21
READER = "https://r.jina.ai/"
TIMEOUT = 60 # 1 minute | for tools
AIOHTTP = {
"use_dns_cache": True,
"ttl_dns_cache": 300,
"limit": 100,
"limit_per_host": 30,
"enable_cleanup_closed": True
}
HEADERS = {
"User-Agent": (
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 "
"(KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
),
"Accept": (
"text/html,application/xhtml+xml,application/xml;q=0.9,"
"application/json,image/*,*/*;q=0.8"
),
"Accept-Encoding": "gzip, deflate, br",
"DNT": "1",
"Upgrade-Insecure-Requests": "1",
"Cache-Control": "no-cache, no-store, no-transform, must-revalidate, private",
"Pragma": "no-cache",
"Sec-Fetch-Dest": "document",
"Sec-Fetch-Mode": "navigate",
"Sec-Fetch-Site": "cross-site",
"Sec-Fetch-User": "?1"
}
REMINDERS = """
<system>
1. Collect all URLs, hyperlinks, references, and citations mentioned in the content.
2. Include all the source references or source links or source URLs using HTML format:
`<a href='source_link' target='_blank'>source_name_title_or_article</a>`.
</system>
"""
DESCRIPTION = """
<h2>Hi there,</h2>
<p>Welcome to <b>SearchGPT</b> V3!</p><br>
<p>Faster, smarter, and built for a seamless search experience.</p><br>
<p>Enjoy private and tracker free searching powered by
<a href="https://umint-searxng.hf.space" target="_blank">SearXNG</a> and GPT-4o Mini.
</p><br>
<p>This is a dedicated version separate from the
<a href="https://umint-openwebui.hf.space" target="_blank">main spaces</a> and designed specifically for public use.
</p><br>
<p>Interested in exploring the <b>limited models</b> available in the
<a href="https://umint-openwebui.hf.space" target="_blank">main spaces</a>?
</p>
<p><br>
<a href="https://huggingface.co/spaces/umint/ai/discussions/55" target="_blank">Click here</a> to discover them now!
</p><br>
<p><b>Like this project?</b> Feel free to buy me a
<a href="https://ko-fi.com/hadad" target="_blank">coffee</a>.
</p>
""" # Gradio