repo stringclasses 454
values | file_path stringlengths 5 201 | extension stringclasses 1
value | content stringlengths 8 509k | num_lines int64 3 16.9k | size_bytes int64 8 511k |
|---|---|---|---|---|---|
OpenViking | openviking/models/embedder/litellm_embedders.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""LiteLLM Embedder Implementation
Uses litellm to provide a unified embedding interface across many providers
(OpenRouter, Ollama, vLLM, and any OpenAI-compatible endpoint).
"""
import os
from typing import Any, Dict... | 227 | 8,298 |
OpenViking | openviking/models/embedder/openai_embedders.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""OpenAI Embedder Implementation"""
from typing import Any, Dict, List, Literal, Optional
import openai
from openviking.models.embedder.base import (
DenseEmbedderBase,
EmbedResult,
HybridEmbedderBase,
... | 410 | 17,217 |
OpenViking | openviking/models/embedder/voyage_embedders.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Voyage AI dense embedder implementation."""
from typing import Any, Dict, List, Optional
import openai
from openviking.models.embedder.base import DenseEmbedderBase, EmbedResult
from openviking.utils.async_client_... | 161 | 5,688 |
OpenViking | openviking/models/embedder/base.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import asyncio
import logging
import random
import time
import weakref
from abc import ABC, abstractmethod
from dataclasses import dataclass
from threading import Lock
from typing import Any, Awaitable, Callable, Dict, ... | 850 | 30,834 |
OpenViking | openviking/models/vlm/__init__.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""VLM (Vision-Language Model) module"""
from .backends.codex_vlm import CodexVLM
from .backends.glm_vlm import GLMVLM
from .backends.kimi_vlm import KimiVLM
from .backends.litellm_vlm import LiteLLMVLMProvider
from .b... | 35 | 884 |
OpenViking | openviking/models/vlm/llm.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""
LLM utilities for OpenViking.
Provides unified structured output handling with response_format support.
"""
import json
import re
from typing import Any, Dict, List, Optional, Type, TypeVar, Union
import json_rep... | 289 | 8,656 |
OpenViking | openviking/models/vlm/registry.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""
Provider Registry — single source of truth for canonical LLM provider metadata.
"""
from __future__ import annotations
VALID_PROVIDERS: tuple[str, ...] = (
"volcengine",
"openai",
"azure",
"kimi",
... | 30 | 672 |
OpenViking | openviking/models/vlm/base.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""VLM base interface and abstract classes"""
import logging
import re
from abc import ABC, abstractmethod
from dataclasses import dataclass, field
from pathlib import Path
from typing import Any, AsyncIterator, Callab... | 1,099 | 39,571 |
OpenViking | openviking/models/vlm/token_usage.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""VLM Token usage monitoring data structures"""
from dataclasses import dataclass, field
from datetime import datetime
from typing import Dict, Optional
from openviking.utils.time_utils import format_iso8601
@datac... | 245 | 8,003 |
OpenViking | openviking/models/vlm/backends/codex_vlm.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""
Codex VLM Backend Integration
This module implements the integration with the Codex provider for Vision-Language Models (VLM).
Unlike standard OpenAI API billing endpoints which use the Chat Completions API, Codex... | 124 | 4,774 |
OpenViking | openviking/models/vlm/backends/kimi_vlm.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
from __future__ import annotations
from typing import Any, Dict
from .openai_vlm import OpenAIVLM
DEFAULT_KIMI_API_BASE = "https://api.kimi.com/coding"
DEFAULT_KIMI_MODEL = "kimi-code"
DEFAULT_KIMI_USER_AGENT = "Kim... | 37 | 1,288 |
OpenViking | openviking/models/vlm/backends/volcengine_media.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Ark Files/Responses helpers used by the VolcEngine VLM backend."""
from __future__ import annotations
import asyncio
import logging
import time
from collections.abc import Mapping
from pathlib import Path
from typi... | 377 | 11,958 |
OpenViking | openviking/models/vlm/backends/openai_vlm.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""OpenAI VLM backend implementation"""
import base64
import json
import time
from pathlib import Path
from typing import Any, Dict, List, Optional, Union
from urllib.parse import urlparse
from openviking.telemetry im... | 473 | 18,549 |
OpenViking | openviking/models/vlm/backends/codex_responses_adapter.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
from __future__ import annotations
import asyncio
import json
from types import SimpleNamespace
from typing import Any, Callable, Dict, List, Optional
def _convert_content_for_responses(content: Any) -> Any:
if ... | 310 | 11,472 |
OpenViking | openviking/models/vlm/backends/litellm_vlm.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""LiteLLM VLM Provider implementation with multi-provider support."""
import base64
import json
import os
import time
from pathlib import Path
from typing import Any, Dict, List, Optional, Union
from urllib.parse impo... | 546 | 20,735 |
OpenViking | openviking/models/vlm/backends/codex_auth.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
from __future__ import annotations
import asyncio
import base64
import json
import os
import stat
import tempfile
import threading
import time
from contextlib import contextmanager
from datetime import datetime, timez... | 714 | 25,896 |
OpenViking | openviking/models/vlm/backends/volcengine_vlm.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""VolcEngine VLM backend implementation."""
import asyncio
import base64
import json
import time
from pathlib import Path
from typing import Any, Dict, List, Optional, Union
from openviking.telemetry import tracer
fr... | 448 | 17,497 |
OpenViking | openviking/models/vlm/backends/glm_vlm.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""GLM Coding Plan VLM backend."""
from __future__ import annotations
from typing import Any, Dict
from .openai_vlm import OpenAIVLM
DEFAULT_GLM_API_BASE = "https://api.z.ai/api/coding/paas/v4"
DEFAULT_GLM_MODEL = "... | 24 | 736 |
OpenViking | openviking/models/rerank/litellm_rerank.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""
LiteLLM Rerank API Client.
"""
# For logging, use Python's built-in logging
import time
from typing import Any, List, Optional
from openviking.models.rerank.base import RerankBase
from openviking_cli.utils import ... | 136 | 4,485 |
OpenViking | openviking/models/rerank/__init__.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""
Rerank models for OpenViking.
Provides rerank functionality for hierarchical retrieval with multiple provider support:
- vikingdb: VikingDB's native rerank service
- cohere: Cohere Rerank v3.5 API
- litellm: LiteLL... | 26 | 868 |
OpenViking | openviking/models/rerank/cohere_rerank.py | .py | # Copyright (c) 2026 Antigravity / Dico Angelo
# SPDX-License-Identifier: AGPL-3.0
"""
Cohere Rerank API Client.
Drop-in replacement for VikingDB RerankClient, using Cohere's Rerank v3.5 API.
Same interface: rerank_batch(query, documents) -> List[float]
"""
# For logging, use Python's built-in logging
import time
fro... | 120 | 3,712 |
OpenViking | openviking/models/rerank/openai_rerank.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""
OpenAI-compatible Rerank API Client.
Supports third-party rerank services like Alibaba Cloud DashScope (qwen3-rerank)
via api_key + api_base configuration.
"""
# For logging, use Python's built-in logging
from typ... | 205 | 7,368 |
OpenViking | openviking/models/rerank/base.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""
RerankBase: Base class for all rerank clients.
Provides common token usage tracking functionality.
"""
import logging
from typing import Any, Dict
from openviking.utils.token_estimation import estimate_text_token... | 178 | 6,283 |
OpenViking | openviking/models/rerank/volcengine_rerank.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""
VikingDB Rerank API Client.
Provides rerank functionality for hierarchical retrieval.
"""
import json
# For logging, use Python's built-in logging
import time
from typing import List, Optional
import requests
fr... | 229 | 7,131 |
OpenViking | openviking/web_studio/__init__.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Built web-studio assets, populated by the docker web-studio-builder stage.
The actual SPA source lives at the repository root in ``web-studio/``. During
the docker build the Vite output (``web-studio/dist``) is copi... | 12 | 608 |
OpenViking | openviking/integrations/__init__.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Optional framework integrations for OpenViking."""
| 4 | 155 |
OpenViking | openviking/integrations/langchain/middleware.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Compatibility wrapper for :mod:`langchain_openviking.middleware`."""
from openviking.integrations.langchain import _forward_legacy_module
_forward_legacy_module("middleware", globals())
| 8 | 292 |
OpenViking | openviking/integrations/langchain/store.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Compatibility wrapper for :mod:`langchain_openviking.store`."""
from openviking.integrations.langchain import _forward_legacy_module
_forward_legacy_module("store", globals())
| 8 | 282 |
OpenViking | openviking/integrations/langchain/actor_peer.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Compatibility wrapper for :mod:`langchain_openviking.actor_peer`."""
from openviking.integrations.langchain import _forward_legacy_module
_forward_legacy_module("actor_peer", globals())
| 8 | 292 |
OpenViking | openviking/integrations/langchain/__init__.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Compatibility imports for the standalone ``langchain-openviking`` package."""
from __future__ import annotations
from importlib import import_module
from typing import Any
_LEGACY_EXPORTS = [
"InMemoryOpenViki... | 76 | 2,579 |
OpenViking | openviking/integrations/langchain/testing.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Compatibility wrapper for :mod:`langchain_openviking.testing`."""
from openviking.integrations.langchain import _forward_legacy_module
_forward_legacy_module("testing", globals())
| 8 | 286 |
OpenViking | openviking/integrations/langchain/messages.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Compatibility wrapper for :mod:`langchain_openviking.messages`."""
from openviking.integrations.langchain import _forward_legacy_module
_forward_legacy_module("messages", globals())
| 8 | 288 |
OpenViking | openviking/integrations/langchain/client.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Compatibility wrapper for :mod:`langchain_openviking.client`."""
from openviking.integrations.langchain import _forward_legacy_module
_forward_legacy_module("client", globals())
| 8 | 284 |
OpenViking | openviking/integrations/langchain/context.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Compatibility wrapper for :mod:`langchain_openviking.context`."""
from openviking.integrations.langchain import _forward_legacy_module
_forward_legacy_module("context", globals())
| 8 | 286 |
OpenViking | openviking/integrations/langchain/history.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Compatibility wrapper for :mod:`langchain_openviking.history`."""
from openviking.integrations.langchain import _forward_legacy_module
_forward_legacy_module("history", globals())
| 8 | 286 |
OpenViking | openviking/integrations/langchain/tools.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Compatibility wrapper for :mod:`langchain_openviking.tools`."""
from openviking.integrations.langchain import _forward_legacy_module
_forward_legacy_module("tools", globals())
| 8 | 282 |
OpenViking | openviking/integrations/langchain/retrievers.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Compatibility wrapper for :mod:`langchain_openviking.retrievers`."""
from openviking.integrations.langchain import _forward_legacy_module
_forward_legacy_module("retrievers", globals())
| 8 | 292 |
OpenViking | openviking/integrations/langchain/recording.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Compatibility wrapper for :mod:`langchain_openviking.recording`."""
from openviking.integrations.langchain import _forward_legacy_module
_forward_legacy_module("recording", globals())
| 8 | 290 |
OpenViking | tests/test_edge_cases_simple.py | .py | #!/usr/bin/env python3
# Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""
Simplified edge case tests for OpenViking that don't rely on complex imports.
These tests focus on boundary conditions and edge cases that can be tested
with minimal dependencies, highlightin... | 192 | 6,132 |
OpenViking | tests/test_session_async_commit.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Tests for async session commit support."""
import asyncio
from typing import AsyncGenerator, Tuple
import httpx
import pytest_asyncio
from openviking.server.app import create_app
from openviking.server.auth.plugi... | 71 | 2,410 |
OpenViking | tests/test_session_task_tracking.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Integration tests for session commit task tracking via HTTP API."""
import asyncio
from typing import AsyncGenerator, Tuple
import httpx
import pytest_asyncio
from openviking.core.namespace import canonical_sessi... | 530 | 18,170 |
OpenViking | tests/test_memory_lifecycle.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Tests for memory lifecycle hotness scoring (#296)."""
from datetime import datetime, timedelta, timezone
import pytest
from openviking.retrieve.memory_lifecycle import DEFAULT_HALF_LIFE_DAYS, hotness_score
NOW = ... | 125 | 4,817 |
OpenViking | tests/__init__.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""OpenViking Tests"""
| 4 | 124 |
OpenViking | tests/test_ovcli_config_schema.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""ovcli.conf stays loadable by every reader that claims to read it."""
import json
import sys
from pathlib import Path
import pytest
from openviking_cli.utils.config.ovcli_config import load_ovcli_config as load_cli... | 44 | 1,265 |
OpenViking | tests/test_task_tracker_concurrency.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import asyncio
import threading
from copy import deepcopy
from typing import Any
import pytest
class _ControllableTaskStore:
def __init__(self) -> None:
self.payloads: dict[str, dict[str, Any]] = {}
... | 1,107 | 37,245 |
OpenViking | tests/test_server_config_loader.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import json
import pytest
from openviking.server.config import (
ServerConfig,
get_server_url_from_server_data,
load_bot_gateway_token,
load_server_config,
map_bind_host_to_loopback,
)
def test_... | 296 | 9,896 |
OpenViking | tests/test_prompt_manager.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import json
from pathlib import Path
from types import SimpleNamespace
import yaml
from openviking.prompts.manager import PromptManager
from openviking.session.memory.memory_type_registry import MemoryTypeRegistry
fr... | 297 | 10,426 |
OpenViking | tests/debug_trace.py | .py | #!/usr/bin/env python3
"""Query Jaeger trace by trace ID and pretty-print for debugging.
Usage:
python tests/query_trace.py <trace_id> [--detail span_id] [--errors-only] [--raw] [--no-color]
Designed to be LLM-friendly: concise, structured output that won't blow up context windows.
"""
import argparse
import bas... | 404 | 13,270 |
OpenViking | tests/test_upload_utils.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Tests for shared upload utilities."""
from pathlib import Path
from typing import Dict, List
import pytest
from openviking.parse.parsers.upload_utils import (
detect_and_convert_encoding,
is_text_file,
... | 473 | 17,938 |
OpenViking | tests/test_task_backend_config.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
from openviking.service.task_store import PersistentTaskStore
from openviking.service.task_tracker import TaskTracker
from openviking_cli.utils.config import storage_config as storage_config_module
from openviking_cli.... | 57 | 1,921 |
OpenViking | tests/test_telemetry_runtime.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
from __future__ import annotations
import asyncio
import json
from concurrent.futures import ThreadPoolExecutor
from types import SimpleNamespace
import pytest
from openviking.models.embedder.base import DenseEmbedd... | 900 | 30,248 |
OpenViking | tests/test_task_tracker.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Unit tests for TaskTracker."""
import json
import time
import pytest
from openviking.pyagfs.exceptions import AGFSAlreadyExistsError
from openviking.server.identity import RequestContext, Role
from openviking.ser... | 594 | 20,026 |
OpenViking | tests/upload_offline_trace.py | .py | #!/usr/bin/env python3
"""Upload offline local trace JSONL into the current environment's OTel backend.
The JSONL file is produced by:
server.observability.traces.enabled = true
server.observability.traces.protocol = "local"
Run this script in a support/debug environment whose local ov.conf configures a
remo... | 317 | 10,769 |
OpenViking | tests/test_code_hosting_utils.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Tests for code_hosting_utils git SSH URL support (Issue #317)."""
import importlib
import importlib.util
import sys
from pathlib import Path
from types import ModuleType, SimpleNamespace
from unittest.mock import pa... | 787 | 25,714 |
OpenViking | tests/test_config_loader.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Tests for config_loader utilities."""
import json
import logging
import re
from logging.handlers import QueueHandler
from pathlib import Path
import pytest
from openviking_cli.utils.config import (
OPENVIKING_... | 564 | 21,043 |
OpenViking | tests/test_token_estimation.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Shared token estimation tests."""
from openviking.message import Message, TextPart
from openviking.session import Session
from openviking.utils.token_estimation import (
estimate_text_tokens,
truncate_text_... | 63 | 1,917 |
OpenViking | tests/test_link_renderer.py | .py | from openviking.session.memory.dataclass import MemoryFile
from openviking.session.memory.utils.link_renderer import LinkRenderer
from openviking.session.memory.utils.memory_file_utils import MemoryFileUtils
class TestRelativePath:
def test_same_directory(self):
result = LinkRenderer.relative_path(
... | 730 | 27,809 |
OpenViking | tests/test_edge_cases.py | .py | #!/usr/bin/env python3
# Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""
Comprehensive edge case tests for OpenViking.
This module tests boundary conditions, unicode edge cases, concurrent operations,
and security considerations that might not be covered in regula... | 504 | 18,458 |
OpenViking | tests/conftest.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Global test fixtures"""
import asyncio
import shutil
from pathlib import Path
from typing import AsyncGenerator, Generator
import pytest
import pytest_asyncio
from openviking.models.embedder.base import DenseEmbe... | 179 | 5,848 |
OpenViking | tests/client/test_write_signature_compat.py | .py | import inspect
from openviking_sdk.client import AsyncHTTPClient, SyncHTTPClient
def test_async_http_client_write_preserves_positional_telemetry():
bound = inspect.signature(AsyncHTTPClient.write).bind_partial(
object(),
"viking://resources/demo.md",
"updated",
"append",
T... | 34 | 838 |
OpenViking | tests/client/test_http_client_config.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import json
import httpx
import pytest
from openviking_cli.client.http import AsyncHTTPClient
from openviking_cli.retrieve.types import ContextType
from openviking_cli.utils.config import OPENVIKING_CLI_CONFIG_ENV
... | 566 | 17,014 |
OpenViking | tests/client/test_chat_integration.py | .py | #!/usr/bin/env python3
"""Integration test for ov chat command."""
import subprocess
import sys
from pathlib import Path
# Add root to path
root_dir = Path(__file__).parent
sys.path.insert(0, str(root_dir))
def test_chat_command_exists():
"""Test that chat command is registered."""
print("Testing chat comma... | 78 | 2,095 |
OpenViking | tests/client/test_git_versioning_http.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""End-to-end parity tests for client.snapshot.* over HTTP.
These exercise the AsyncHTTPClient.snapshot namespace surface, routed through
AsyncHTTPClient -> real FastAPI server (via httpx
ASGITransport) -> real OpenVik... | 365 | 13,110 |
OpenViking | tests/client/test_resource_parse_mode_clients.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Public Python client coverage for args.parse_mode."""
import inspect
from openviking_cli.client.sync_http import SyncHTTPClient
def test_http_client_does_not_expose_parse_mode_parameter():
assert "parse_mode... | 13 | 387 |
OpenViking | tests/client/__init__.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Client test module"""
| 5 | 127 |
OpenViking | tests/client/test_http_client_compact.py | .py | """Unit tests for request-body compaction on find/search/add_resource.
Older OpenViking instances use ``model_config = ConfigDict(extra="forbid")`` and
reject any field they do not yet define. The SDK must not attach optional fields
as ``null``/``{}`` when the caller never set them, otherwise the whole request
fails w... | 139 | 4,477 |
OpenViking | tests/client/test_http_error_mapping.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Focused tests for SDK HTTP error-code mapping."""
import pytest
from openviking_cli.client.http import AsyncHTTPClient
from openviking_cli.exceptions import (
AbortedError,
ConflictError,
OpenVikingErr... | 66 | 1,914 |
OpenViking | tests/client/test_sdk_import.py | .py | import sys
from pathlib import Path
def test_import_openviking_sdk_prefers_workspace_sdk(monkeypatch):
import openviking_cli._sdk_import as sdk_import
sdk_root = Path(__file__).resolve().parents[2] / "sdk" / "python"
for name in list(sys.modules):
if name == "openviking_sdk" or name.startswith("o... | 17 | 598 |
OpenViking | tests/client/test_http_client_local_upload.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Tests for client-side temp uploads when using localhost URLs."""
import json
import pytest
from openviking_cli.client.http import AsyncHTTPClient
from openviking_cli.utils.config import OPENVIKING_CLI_CONFIG_ENV
... | 189 | 6,012 |
OpenViking | tests/client/test_http_client_snapshot.py | .py | """Unit tests for AsyncHTTPClient git_* methods that drive /api/v1/snapshot/*."""
from typing import Any, Dict, List
import pytest
from openviking_cli.client.http import AsyncHTTPClient
pytestmark = pytest.mark.asyncio
class _FakeHTTPClient:
"""Records the last request and returns a canned response."""
d... | 296 | 9,419 |
OpenViking | tests/client/test_windows_path_handling.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Tests for cross-platform path handling in ZIP operations."""
import tempfile
import zipfile
from pathlib import Path
from openviking_cli.client.http import AsyncHTTPClient
class TestZipCreationPathNormalization:
... | 163 | 7,313 |
OpenViking | tests/client/test_rebuild_clients.py | .py | import asyncio
import threading
import zipfile
from pathlib import Path
from types import SimpleNamespace
from unittest.mock import AsyncMock, Mock, patch
import pytest
import openviking_cli.client.http as http_module
import openviking_cli.utils.async_utils as async_utils
from openviking_cli.client.http import AsyncH... | 225 | 7,555 |
OpenViking | tests/client/conftest.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Client test fixtures
Note: client and uninitialized_client fixtures have been moved to tests/conftest.py
"""
| 8 | 215 |
OpenViking | tests/connector/test_client.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Focused tests for the external Connector HTTP contract."""
from types import SimpleNamespace
import pytest
from openviking.connector import client as client_module
from openviking.connector.client import Connector... | 163 | 5,556 |
OpenViking | tests/retrieve/test_provenance.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Tests for search result provenance metadata."""
from __future__ import annotations
from openviking_cli.retrieve.types import (
ContextType,
FindResult,
MatchedContext,
QueryResult,
ThinkingTrace... | 160 | 5,670 |
OpenViking | tests/retrieve/test_intent_analyzer_query_planner.py | .py | from types import SimpleNamespace
import pytest
from openviking.retrieve import intent_analyzer as intent_module
from openviking.retrieve.intent_analyzer import IntentAnalyzer
from openviking_cli.utils.config.open_viking_config import OpenVikingConfig
class RecordingModel:
def __init__(self, response: str, mode... | 204 | 6,941 |
OpenViking | tests/retrieve/test_hierarchical_retriever_image.py | .py | import pytest
from openviking.models.embedder.base import EmbedResult
from openviking.retrieve.hierarchical_retriever import HierarchicalRetriever
from openviking.server.identity import RequestContext, Role
from openviking_cli.exceptions import InvalidArgumentError
from openviking_cli.retrieve.types import TypedQuery
... | 119 | 3,462 |
OpenViking | tests/retrieve/test_context_assembler_pipeline.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import re
from types import SimpleNamespace
from openviking.retrieve.context_assembler import pipeline as pipeline_module
from openviking.retrieve.context_assembler import rewrite as rewrite_module
from openviking.ret... | 600 | 19,644 |
OpenViking | tests/retrieve/test_hierarchical_retriever_rerank.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Hierarchical retriever rerank behavior tests."""
import asyncio
import threading
import time
import pytest
from openviking.retrieve.hierarchical_retriever import HierarchicalRetriever, RetrieverMode
from openviki... | 679 | 21,132 |
OpenViking | tests/server/test_privacy_config_service.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import pytest
from openviking.core.namespace import canonical_user_root
from openviking.privacy.skill_extractor import extract_skill_privacy_values
from openviking.privacy.skill_placeholder import placeholderize_skill... | 283 | 9,634 |
OpenViking | tests/server/test_api_sessions.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Tests for session endpoints."""
import asyncio
import json
from unittest.mock import patch
import httpx
import pytest
from fastapi import FastAPI
from starlette.requests import Request
from openviking.message imp... | 1,484 | 54,260 |
OpenViking | tests/server/test_api_skills.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import sys
import types
import zipfile
import pytest
from starlette.responses import PlainTextResponse
@pytest.fixture(autouse=True)
def _stub_mcp_endpoint(monkeypatch):
"""Keep these router tests independent fr... | 610 | 22,789 |
OpenViking | tests/server/test_add_locations.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import json
import httpx
import pytest
from openviking.server.config import AddTargetsConfig, UserConfig, load_server_config
from openviking_cli.utils.config import OPENVIKING_CONFIG_ENV
from openviking_cli.utils.con... | 147 | 4,954 |
OpenViking | tests/server/test_identity.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Tests for identity types (openviking/server/identity.py)."""
from openviking.server.identity import (
RequestContext,
ResolvedIdentity,
Role,
)
from openviking_cli.session.user_id import UserIdentifier
... | 68 | 1,990 |
OpenViking | tests/server/test_api_content.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Tests for content endpoints: read, abstract, overview, reindex."""
from types import SimpleNamespace
import pytest
from openviking.server.identity import RequestContext, Role
from openviking.server.routers import... | 263 | 9,088 |
OpenViking | tests/server/test_api_fs_content_endpoint_suite.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
from types import SimpleNamespace
import httpx
from openviking.pyagfs.exceptions import AGFSHTTPError
def _assert_error(
response: httpx.Response,
*,
status_code: int,
error_code: str,
message_f... | 272 | 9,509 |
OpenViking | tests/server/test_request_wait_tracking.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Tests for request-scoped wait behavior on write APIs."""
from types import SimpleNamespace
import pytest
from openviking.server.identity import RequestContext, Role
from openviking.storage.content_write import Co... | 277 | 9,732 |
OpenViking | tests/server/test_api_key_manager.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Tests for APIKeyManager (openviking/server/api_keys.py)."""
import asyncio
import hashlib
import uuid
import pytest
import pytest_asyncio
from openviking.pyagfs.exceptions import AGFSNotFoundError
from openviking... | 1,073 | 37,572 |
OpenViking | tests/server/test_recall_endpoint.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import httpx
from openviking.retrieve.context_assembler.params import DEFAULT_QUOTAS
from openviking.retrieve.context_assembler.recall_preset import (
DEFAULT_MIN_SCORE,
RECALL_SCORE_THRESHOLD,
fold_recall... | 176 | 5,578 |
OpenViking | tests/server/test_mcp_endpoint.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Tests for MCP endpoint tools (openviking/server/mcp_endpoint.py).
Tests the tool functions directly by setting up the identity contextvar
and service dependency, avoiding MCP protocol complexity.
"""
from types im... | 1,340 | 47,580 |
OpenViking | tests/server/test_agent_evolution_global_setting.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import json
from types import SimpleNamespace
from unittest.mock import AsyncMock
import httpx
import pytest
import pytest_asyncio
from openviking.pyagfs import AGFSNotFoundError
from openviking.server.account_settin... | 268 | 8,826 |
OpenViking | tests/server/test_profile_middleware.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import httpx
import pytest
from fastapi import APIRouter
from fastapi.responses import PlainTextResponse, StreamingResponse
from openviking.server.app import create_app
from openviking.server.config import ServerConfi... | 146 | 4,683 |
OpenViking | tests/server/test_api_fs_ls_sort.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""End-to-end coverage for ordered, limited filesystem listings."""
from types import SimpleNamespace
import pytest
from openviking.core.namespace import canonical_session_uri
from openviking.server.identity import ... | 78 | 2,746 |
OpenViking | tests/server/test_actor_peer_retrieval_targets.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Actor peer retrieval target resolution tests."""
import pytest
from openviking.core.peer_id import normalize_peer_id
from openviking.core.retrieval_targets import default_target_directories, resolve_retrieval_targ... | 174 | 5,694 |
OpenViking | tests/server/test_prometheus_metrics.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Tests for the Prometheus metrics endpoint and exposition output."""
import json
import httpx
import pytest
from openviking.metrics.core.registry import MetricRegistry
from openviking.metrics.exporters.prometheus ... | 402 | 14,624 |
OpenViking | tests/server/test_resources_temp_upload_token.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Tests for the signed-token upload path on POST /api/v1/resources/temp_upload.
The MCP ``add_resource`` tool mints a short-lived ``?token=`` for local-file paths. A POST
carrying that token (and no API key) is author... | 229 | 8,167 |
OpenViking | tests/server/test_auth.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Tests for multi-tenant authentication (openviking/server/auth.py)."""
import asyncio
import uuid
import httpx
import pytest
import pytest_asyncio
from fastapi import Depends, FastAPI
from fastapi import Request as... | 1,563 | 54,822 |
OpenViking | tests/server/test_error_envelope_status_codes.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Regression tests: error-envelope return sites must surface mapped HTTP status codes.
These routers historically returned ``Response(status="error", error=ErrorInfo(...))``
directly, which FastAPI shipped with HTTP 2... | 105 | 4,704 |
OpenViking | tests/server/test_filesystem_router.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Filesystem router tests."""
from types import SimpleNamespace
import pytest
from openviking.server.identity import RequestContext, Role
from openviking.server.routers import filesystem
from openviking_cli.session.... | 86 | 2,684 |
OpenViking | tests/server/test_api_content_write.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: Apache-2.0
"""Tests for content write endpoint."""
import pytest
async def _first_file_uri(client, root_uri: str) -> str:
resp = await client.get(
"/api/v1/fs/ls",
params={"uri": root_uri, "simple": True,... | 337 | 10,517 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.