Spaces:
Running
Running
Update service env names
Browse filesFiles changed (9)
1 unmodified line23456567891 unmodified lineAPI_KEY="your_openai_compatible_key" # API key for your OpenAI-compatible LLM provider.API_BASE="https://your-openai-compatible-endpoint/v1" # Base URL for the OpenAI-compatible chat-completions endpoint.MODEL_NAME="gpt-5.5" # Main model used by the agent and WebFetch summarization.SERPER_KEY_ID="your_serper_key" # https://serper.dev/JINA_API_KEYS="your_jina_key" # https://jina.ai/SERPER_KEY="your_serper_key" # https://serper.dev/JINA_KEY="your_jina_key" # https://jina.ai/MINERU_TOKEN="your_mineru_token" # https://mineru.net/
# Optional29 unmodified lines3031323334333435363729 unmodified lines| `API_KEY` | API key for your OpenAI-compatible LLM provider. || `API_BASE` | OpenAI-compatible `/v1` endpoint. || `MODEL_NAME` | Main model used by ResearchHarness. || `SERPER_KEY_ID` | WebSearch / ScholarSearch key from <https://serper.dev/>. || `JINA_API_KEYS` | WebFetch key from <https://jina.ai/>. || `SERPER_KEY` | WebSearch / ScholarSearch key from <https://serper.dev/>. || `JINA_KEY` | WebFetch key from <https://jina.ai/>. || `MINERU_TOKEN` | ReadPDF key from <https://mineru.net/>. |
## Optional Runtime Variables12 unmodified lines13141516171819202122232425268 unmodified lines35363730383912 unmodified lines return any(part.startswith("claude") for part in parts)
def model_rejects_presence_penalty(model_name: str) -> bool: normalized = str(model_name or "").strip().casefold() if not normalized: return False parts = [part for part in _MODEL_NAME_SPLIT_RE.split(normalized) if part] return any(part.startswith("gpt-5.5") for part in parts)
def apply_sampling_params( request_kwargs: dict[str, Any], *,8 unmodified lines request_kwargs["temperature"] = temperature if top_p is not None: request_kwargs["top_p"] = top_p if presence_penalty is not None: if presence_penalty is not None and not model_rejects_presence_penalty(model_name): request_kwargs["presence_penalty"] = presence_penalty289 unmodified lines29029129229329329429529615 unmodified lines31231331431531531631731822 unmodified lines341342343344344345346347289 unmodified linesBehavior:
- Calls Serper's Google Search endpoint.- Reads `SERPER_KEY_ID` at runtime.- Reads `SERPER_KEY` at runtime.
Returns:
15 unmodified linesBehavior:
- Calls Serper's Google Scholar endpoint.- Reads `SERPER_KEY_ID` at runtime.- Reads `SERPER_KEY` at runtime.
Returns:
22 unmodified lines
Dependencies:
- `JINA_API_KEYS`- `JINA_KEY`- `API_KEY`- `API_BASE`- `MODEL_NAME`129 unmodified lines13013113213313313413513513613713890 unmodified lines229230231232232233234234235236237211 unmodified lines449450451452452453454454455456457129 unmodified lines "gl": "us", "hl": "en", } serper_key = os.getenv("SERPER_KEY_ID", "").strip() serper_key = os.getenv("SERPER_KEY", "").strip() if not serper_key: return "[WebSearch] SERPER_KEY_ID is not set." return "[WebSearch] SERPER_KEY is not set." headers = { "X-API-KEY": serper_key, "Content-Type": "application/json",90 unmodified lines
def google_scholar_with_serp(self, query: str): payload = {"q": query} serper_key = os.getenv("SERPER_KEY_ID", "").strip() serper_key = os.getenv("SERPER_KEY", "").strip() if not serper_key: return "[ScholarSearch] SERPER_KEY_ID is not set." return "[ScholarSearch] SERPER_KEY is not set." headers = { "X-API-KEY": serper_key, "Content-Type": "application/json",211 unmodified lines def jina_readpage(self, url: str, runtime_deadline: Optional[float] = None) -> str: max_retries = 3 timeout = 50 jina_api_key = os.getenv("JINA_API_KEYS", "").strip() jina_api_key = os.getenv("JINA_KEY", "").strip() if not jina_api_key: return "[WebFetch] JINA_API_KEYS is not set." return "[WebFetch] JINA_KEY is not set."
last_error = "unknown page-fetch error" for attempt in range(max_retries):64 unmodified lines6566676869686970717264 unmodified lines]SENSITIVE_ENV_EXACT = { "API_KEY", "SERPER_KEY_ID", "JINA_API_KEYS", "SERPER_KEY", "JINA_KEY", "MINERU_TOKEN", "OPENAI_API_KEY", "ANTHROPIC_API_KEY",15 unmodified lines1617181920192021222315 unmodified lines "API_KEY", "API_BASE", "MODEL_NAME", "SERPER_KEY_ID", "JINA_API_KEYS", "SERPER_KEY", "JINA_KEY", "MINERU_TOKEN",)IMAGE_INPUT_REL_DIR = Path("inputs") / "images"31 unmodified lines3233343536353637383931 unmodified lines| `API_KEY` | API key for your OpenAI-compatible LLM provider. || `API_BASE` | Base URL for the OpenAI-compatible chat-completions endpoint. || `MODEL_NAME` | Main model used by ResearchHarness. || `SERPER_KEY_ID` | Serper key for `WebSearch` and `ScholarSearch`: https://serper.dev/ || `JINA_API_KEYS` | Jina key for `WebFetch`: https://jina.ai/ || `SERPER_KEY` | Serper key for `WebSearch` and `ScholarSearch`: https://serper.dev/ || `JINA_KEY` | Jina key for `WebFetch`: https://jina.ai/ || `MINERU_TOKEN` | MinerU token for `ReadPDF`: https://mineru.net/ |
Optional variables:29 unmodified lines3031323334333435363729 unmodified lines| `API_KEY` | OpenAI-compatible LLM 服务的 API key。 || `API_BASE` | OpenAI-compatible chat-completions endpoint 的 base URL。 || `MODEL_NAME` | ResearchHarness 使用的主模型。 || `SERPER_KEY_ID` | `WebSearch` 和 `ScholarSearch` 使用的 Serper key:https://serper.dev/ || `JINA_API_KEYS` | `WebFetch` 使用的 Jina key:https://jina.ai/ || `SERPER_KEY` | `WebSearch` 和 `ScholarSearch` 使用的 Serper key:https://serper.dev/ || `JINA_KEY` | `WebFetch` 使用的 Jina key:https://jina.ai/ || `MINERU_TOKEN` | `ReadPDF` 使用的 MinerU token:https://mineru.net/ |
可选变量:.env.example+2-2
README.md+2-2
agent_base/provider_compat.py+9-1
agent_base/tools/README.md+3-3
agent_base/tools/tool_web.py+6-6
agent_base/tools/tooling.py+2-2
agent_base/utils.py+2-2
docs/tutorial_en.md+2-2
docs/tutorial_zh.md+2-2